Postado Setembro 2, 2014 10 anos Bom teria como eu blokear certo nomes a por no pokemon? é que tem players que bota o nome de shiny no pokemon e engana o outro trouxa... eu queria saber se alguem sabeiria botar algo que fizesse com que o npc se negaria a botar este nick ele (não colocasse)? agradeço Mostrar conteúdo oculto local focus = 0 local talk_start = 0 local conv = 0 local target = 0 local following = false local attacking = false local talkState = {} local finalname = "" function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye sir!') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function 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() end local 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("Hello, "..getCreatureName(cid).."! I can give your pokemon a nickname or i can put in your pokemon a elemental aura, if he is boosted at least +50...") elseif (msgcontains(msg, "no") or msgcontains(msg, "bye")) and focus == cid and conv ~= 3 then selfSay("No problem then, sir. Come back when you feel like it!") focus = 0 elseif (msgcontains(msg, "nick") or msgcontains(msg, "nickname")) and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end selfSay("Put your pokemon at the main slot and tell me, what nickname would you like me to give to your pokemon?") conv = 3 elseif msgcontains(msg, "aura") and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Sorry, your pokemon is not boosted +50!") focus = 0 return true end if getItemAttribute(pb, "aura") and getItemAttribute(pb, "aura") ~= "" then selfSay("Sorry, your pokemon already have a elemental aura!") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Return your pokemon for your pokeball!") focus = 0 return true end selfSay("You can choose one of these 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("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Sorry, your pokemon is not boosted +50!") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Return your pokemon for your pokeball!") focus = 0 return true end doItemSetAttribute(pb, "aura", auraFinal) selfSay("Done! Now your pokemon have a new elemental aura. Enjoy it!") 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("Sorry, the nick has invalid symbols.") return true end end if string.len(msg) <= 1 or string.len(msg) >= 19 then selfSay("Sorry, that nick is too long or too short!") return true end local pokename = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") selfSay("Are you sure that you want to change your's "..pokename.." name to \""..msge.."\"? This is going to cost you 10 hundred dollars.") conv = 5 finalname = msge elseif msgcontains(msg, "yes") and focus == cid and conv == 5 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Where is your pokemon?! You have to keep it at the main slot!") focus = 0 return true end if doPlayerRemoveMoney(cid, 100000) == false then selfSay("You don't have enough money to afford this service, come back later.") focus = 0 conv = 0 return true end local nick = ""..finalname.."" local description = "Contains a "..getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke").."." selfSay("Done! Your pokemon now has a new name, enjoy it!") 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 end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Want to give some nicknames to your pokemon? Talk to me!", "Did you know your pokemon gets a little happier when you give him a nickname?", "Every pokemon wants to have a nickname! Come talk to me!", "Pokemons love nicknames, you should give yours one.", } 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("Come back some other time!") end if getDistanceToCreature(focus) > 3 then selfSay("Enjoy!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end Servidor com sources estáveis, com sistemas completos e tudo atualizados, para saber mais acessem https://www.facebook.com/pokeVKS
Postado Setembro 4, 2014 10 anos Autor @up Servidor com sources estáveis, com sistemas completos e tudo atualizados, para saber mais acessem https://www.facebook.com/pokeVKS
Postado Setembro 4, 2014 10 anos O tópico foi movido para a área correta, preste mais atenção da próxima vez! Leia as regras do fórum: http://tibiaking.com/forum/topic/1281-regras-gerais/?p=7680 Este tópico foi movido: De: "OTServ → Scripting → Monsters e NPCs" Para: "OTServ → Suporte OTServ → Suporte de Scripts" Ajudei = REP+ Não dou suporte por PM qualquer dúvida procure no fórum,caso não encontre oque procura crie um tópico. [email protected]" /> | TFS 0.4 DEV | %5Bcreaturescript%5D Icones no minimap com descrição%5Btalkaction%5D Adicionar ou remover VIP do player.%5Bcreaturescripts%5D Senha para porta%5Btalkaction%5D Mandar mensagem para pasta do servidorMapa Evento War Castle%5Baction%5D Canoa em MovimentoTeleport Scroll System%5Bcreaturescripts%5D Recompensa por level para X vocations%5Btalkaction%5D Adicionar X item para o player%5Btalkactions%5D Adicionar item para todos players online%5Baction%5D Item que teleporta o player para house[action+movement] Passaporte para entrar no barco
Postado Setembro 4, 2014 10 anos Solução Mostrar conteúdo oculto local focus = 0 local talk_start = 0 local conv = 0 local target = 0 local following = false local attacking = false local talkState = {} local finalname = "" local edit = { blockNicks = {"Shiny charizardo", "Shiny SmiX"}, -- Aqui vc botas os apelidos a serem bloqueados msg = "Desculpe, mas este apelido é bloqueado." -- Aqui a msg q vai madar caso ele tente mudar para esses nomes } function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye sir!') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function 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() end local 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("Hello, "..getCreatureName(cid).."! I can give your pokemon a nickname or i can put in your pokemon a elemental aura, if he is boosted at least +50...") elseif (msgcontains(msg, "no") or msgcontains(msg, "bye")) and focus == cid and conv ~= 3 then selfSay("No problem then, sir. Come back when you feel like it!") focus = 0 elseif (msgcontains(msg, "nick") or msgcontains(msg, "nickname")) and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end selfSay("Put your pokemon at the main slot and tell me, what nickname would you like me to give to your pokemon?") conv = 3 elseif msgcontains(msg, "aura") and focus == cid and conv == 1 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Sorry, your pokemon is not boosted +50!") focus = 0 return true end if getItemAttribute(pb, "aura") and getItemAttribute(pb, "aura") ~= "" then selfSay("Sorry, your pokemon already have a elemental aura!") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Return your pokemon for your pokeball!") focus = 0 return true end selfSay("You can choose one of these 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("Sorry, you don't have a pokemon in the main slot!") focus = 0 return true end local pb = getPlayerSlotItem(cid, 8).uid if not getItemAttribute(pb, "boost") or getItemAttribute(pb, "boost") < 50 then selfSay("Sorry, your pokemon is not boosted +50!") focus = 0 return true end if #getCreatureSummons(cid) >= 1 then selfSay("Return your pokemon for your pokeball!") focus = 0 return true end doItemSetAttribute(pb, "aura", auraFinal) selfSay("Done! Now your pokemon have a new elemental aura. Enjoy it!") 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("Sorry, the nick has invalid symbols.") return true end end if string.len(msg) <= 1 or string.len(msg) >= 19 then selfSay("Sorry, that nick is too long or too short!") return true end local pokename = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke") --Editado if(isInArray(edit.blockNicks, msge)) the SelfSay(edit.msg) return true end selfSay("Are you sure that you want to change your's "..pokename.." name to \""..msge.."\"? This is going to cost you 10 hundred dollars.") conv = 5 finalname = msge elseif msgcontains(msg, "yes") and focus == cid and conv == 5 then if getPlayerSlotItem(cid, 8).uid <= 0 then selfSay("Where is your pokemon?! You have to keep it at the main slot!") focus = 0 return true end if doPlayerRemoveMoney(cid, 100000) == false then selfSay("You don't have enough money to afford this service, come back later.") focus = 0 conv = 0 return true end local nick = ""..finalname.."" local description = "Contains a "..getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke").."." selfSay("Done! Your pokemon now has a new name, enjoy it!") 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 end end local intervalmin = 38 local intervalmax = 70 local delay = 25 local number = 1 local messages = {"Want to give some nicknames to your pokemon? Talk to me!", "Did you know your pokemon gets a little happier when you give him a nickname?", "Every pokemon wants to have a nickname! Come talk to me!", "Pokemons love nicknames, you should give yours one.", } 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("Come back some other time!") end if getDistanceToCreature(focus) > 3 then selfSay("Enjoy!") focus = 0 return true end local dir = doDirectPos(npcpos, focpos) selfTurn(dir) end return true end Pronto! Boa sorte! Sou Ozz/Forsaken/SmiX! Projeto PokeXAlpha, com sources, feito do 0. Infelizmente faço equipe com o Noninhooo! Fã de:<p>
Postado Setembro 4, 2014 10 anos Autor Obrigado agradeço Reputado, Podem feixar o topico profavor. Servidor com sources estáveis, com sistemas completos e tudo atualizados, para saber mais acessem https://www.facebook.com/pokeVKS
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.