Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''nicksystem''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

Encontrado 1 registro

  1. LionM

    Nick System PDA

    Cria um arquivo chamado namer.xml em data/npc e cole isso <?xml version="1.0" encoding="UTF-8"?><npc name="Namer" script="nick.lua" walkinterval="350000" floorchange="0" speed="0" lookdir="2"> <health now="150" max="150"/> <look type="614" head="115" body="122" legs="0" feet="76"/> <parameters> </parameters></npc> Agora, cria outro arquivo chamado Nick.lua em data/npc/scripts e cole isso local focus = 0local talk_start = 0local conv = 0local target = 0local following = falselocal attacking = falselocal talkState = {}local finalname = ""function onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid thenselfSay('Good bye sir!')focus = 0talk_start = 0endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str)return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msge)local msg = string.lower(msge)local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if focus == cid then talk_start = os.clock() endlocal auras = {"red aura", "blue aura", "green aura", "yellow aura", "white aura", "gray aura", "cyan aura", "purple aura", "orange aura"}if (msgcontains(msg, 'hi') and (focus == 0) and (getDistanceToCreature(cid) <= 4)) then focus = cid conv = 1 talk_start = os.clock() selfSay("Ola, "..getCreatureName(cid).."! Eu posso dar apelido ao seu pokemonou uma aura elementar se tiver pelo menos com boost 50+.")elseif (msgcontains(msg, "no") or msgcontains(msg, "bye")) and focus == cid and conv ~= 3 then selfSay("Sem problema entao senhor, volte quando estiver disposto!") focus = 0elseif (msgcontains(msg, "apelido") or msgcontains(msg, "nickname")) and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Desculpe, voce nao tem um pokemon no slot principal!") focus = 0 return true end selfSay("Coloque o pokemon que ira receber um apelido no slot principal e me diga, qual sera seu apelido?") conv = 3 elseif msgcontains(msg, "aura") and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Desculpe, mas voce nao tem um pokemon no slot principal!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Desculpe mas seu pokemon nao possui boost +50!") focus = 0 return true end if getItemAttribute(pb, "aura") and getItemAttribute(pb, "aura") ~= "" then selfSay("Desculpe, mas seu pokemon ja possui uma aura elementar.") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Retorne seu pokemon para a pokebola!") focus = 0 return true end selfSay("Escolha uma destas auras: red aura, blue aura, green aura, yellow aura, white aura, gray aura, cyan aura, purple aura, orange aura. Which one do you prefer?") conv = 9 elseif isInArray(auras, msg) and focus == cid and conv == 9 then selfSay("Are you sure that you want to put a "..msg.." in your pokemon?") conv = 11 local d, e = msg:find('(.-) aura') auraFinal = string.sub(msg, d -1, e - 5) elseif msgcontains(msg, "yes") and focus == cid and conv == 11 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Me perdoe mas voce nao tem um pokemon no slot principal!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Desculpe mas seu pokemon nao possui boost +50!") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Retorne seu pokemon para a pokebola!") focus = 0 return true end doItemSetAttribute(pb, "aura", auraFinal) selfSay("Pronto! Agora seu pokemon possui uma nova aura elementar. Aproveite") focus = 0 conv = 0 elseif conv == 3 and focus == cid then local tablee = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "w", "y", "z", ".", ":", "'", '"', "~", "^", "@", "#", "$", "%", "&", "*", "(", ")", "-", "+", "_", "?", ">", "<", "•", ";", "°", "¹", "²", "³", "£", "¢", "¬", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} local table = {"'", '"', "!", "ã", "õ", "ç", "´", "`", "á", "à", "ó", "ò", "é", "è", "í", "ì", "ú", "ù", "¹", "²", "³", "£", "¢", "¬", "§", "°", "º", "ª", "•", "|"} for a = 1, #table do if string.find(msg, table[a]) then selfSay("Lamento, este apelido tem simbolos invaidos.") return true end end if string.len(msg) <= 1 or string.len(msg) >= 19 then selfSay("Lamento, este apelido e muito longo ou muito curto!") return true end local pokename = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") selfSay("Voce tem certeza que quer alterar o nome de seu pokemon de "..pokename.." para \""..msge.."\"? isto vai custar 10 hundred dollars.") conv = 5 finalname = msgeelseif msgcontains(msg, "yes") and focus == cid and conv == 5 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Onde esta seu pokemon?! Coloque ele no slot principal!") focus = 0 return true end if doPlayerRemoveMoney(cid, 100000) == false then selfSay("Voce nao tenho dinheiro suficiente para me pagar pelos meus serviços, volte mais tarde.") focus = 0 conv = 0 return true end local nick = ""..finalname.."" local description = "Contem um "..getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke").."." selfSay("Pronto! Agora seu pokemon tem um novo apelido, aproveite!") doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "nick", nick) local newdes = description.."\nIt's nickname is: "..finalname.."." doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "description", newdes) local hp = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "happy") doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "happy", hp + 25) if #getCreatureSummons(cid) >= 1 then adjustStatus(getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8).uid) end focus = 0 conv = 0 endend local intervalmin = 38local intervalmax = 70local delay = 25local number = 1local messages = {"Quer dar apelido ao seu pokemon? Fale comigo!", "Voce sabia que seu pokemon fica mais feliz quando voce o da um apelido?", "Todos seus pokemons querem ter um apelido, converse comigo", "Pokemons amam apelidos, voce deve dar os seus um.", }function onThink() if focus == 0 then selfTurn(1) delay = delay - 0.5 if delay <= 0 then selfSay(messages[number]) number = number + 1 if number > #messages then number = 1 end delay = math.random(intervalmin, intervalmax) end return true else if not isCreature(focus) then focus = 0 return true end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then focus = 0 return true end if (os.clock() - talk_start) > 45 then focus = 0 selfSay("Volte outra hora!") end if getDistanceToCreature(focus) > 3 then selfSay("Enjoy!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) endreturn trueend Prints: Créditos Bluester
×
×
  • Criar Novo...