Postado Maio 5, 2015 10 anos Eu procurei bastante por um npc de learnspells e nao achei entao eu to usando uma talkactions de learnspells que eu consegui achar aqui no tk, mas meu maior problema eh, eu quero que o player ganhe uma storage qnd ele aprender a spell pra essa storage impedir ele de aprender outra spell, tirando assim aquela coisa padrao de todo mundo da mesma voc terem as mesmas spells fazendo o player as vezes escolher entre uma ou outra e nao ter as 2, eu queria um exemplo com uma spell que nao pode ser usada com tal storage e um exemplo que ganha a storage ao mesmo tempo que aprende uma spell, espero que alguem tenha entendido dou rep + 3 vezes pra quem me ajudar (alem de ficar eternamente grato por me ajudar a permitir um player ter suas proprias builds no tibia) Aki o script da talkaction: local tab = { ["exori frigo"] = {spell = "Ice Strike", item = {1234, 5}}, -- ["nome da spell"] = {spell = "nome da conjuração da spell", item = {itemid, quantidade}}, ["exori mort"] = {spell = "Death Strike", item = {1234, 5}}, ["exori vis"] = {spell = "Energy Strike", item = {1234, 5}}, ["exori flam"] = {spell = "Flame Strike", item = {1234, 5}}, ["exori tera"] = {spell = "Terra Strike", item = {1234, 5}}, ["exori san"] = {spell = "Divine Missile", item = {1234, 5}} } function onSay(cid, words, param, channel) local sparam = string.lower(param) if(param == "") then return doPlayerSendCancel(cid, "Enter the name of the spell you want to LEARN.") end if not (tab[sparam]) then return doPlayerSendCancel(cid, "Spell not found.") end if(getPlayerLearnedInstantSpell(cid, tab[sparam].spell)) then return doPlayerSendCancel(cid, "You already have learned this spell.") end if(getPlayerItemCount(cid, tab[sparam].item[1]) >= tab[sparam].item[2]) then doPlayerLearnInstantSpell(cid, tab[sparam].spell) doPlayerRemoveItem(cid, tab[sparam].item[1], tab[sparam].item[2]) doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned the spell!") else doPlayerSendCancel(cid, "You need "..tab[sparam].item[2].." "..getItemNameById(tab[sparam].item[1]).." to learn this spell.") end return true end Obs: os itens e os nomes das spells eu vou mudar todos nao tem importancia alguma
Postado Maio 5, 2015 10 anos Solução local tab = { ["exori frigo"] = {spell = "Ice Strike", item = {1234, 5}}, -- ["nome da spell"] = {spell = "nome da conjuração da spell", item = {itemid, quantidade}}, ["exori mort"] = {spell = "Death Strike", item = {1234, 5}}, ["exori vis"] = {spell = "Energy Strike", item = {1234, 5}}, ["exori flam"] = {spell = "Flame Strike", item = {1234, 5}}, ["exori tera"] = {spell = "Terra Strike", item = {1234, 5}}, ["exori san"] = {spell = "Divine Missile", item = {1234, 5}} } function onSay(cid, words, param, channel) local sparam = string.lower(param) if(param == "") then return doPlayerSendCancel(cid, "Enter the name of the spell you want to LEARN.") end if not (tab[sparam]) then return doPlayerSendCancel(cid, "Spell not found.") end if getPlayerStorageValue(cid, 1754) >= 1 then doPlayerSendCancel(cid, "You already have learned an spell.") end if(getPlayerLearnedInstantSpell(cid, tab[sparam].spell)) then return doPlayerSendCancel(cid, "You already have learned this spell.") end if(getPlayerItemCount(cid, tab[sparam].item[1]) >= tab[sparam].item[2]) then doPlayerLearnInstantSpell(cid, tab[sparam].spell) doPlayerRemoveItem(cid, tab[sparam].item[1], tab[sparam].item[2]) setPlayerStorageValue(cid, 1754, 1) doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned the spell!") else doPlayerSendCancel(cid, "You need "..tab[sparam].item[2].." "..getItemNameById(tab[sparam].item[1]).." to learn this spell.") end return true end Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Maio 12, 2015 10 anos Autor local tab = { ["exori frigo"] = {spell = "Ice Strike", item = {1234, 5}}, -- ["nome da spell"] = {spell = "nome da conjuração da spell", item = {itemid, quantidade}}, ["exori mort"] = {spell = "Death Strike", item = {1234, 5}}, ["exori vis"] = {spell = "Energy Strike", item = {1234, 5}}, ["exori flam"] = {spell = "Flame Strike", item = {1234, 5}}, ["exori tera"] = {spell = "Terra Strike", item = {1234, 5}}, ["exori san"] = {spell = "Divine Missile", item = {1234, 5}} } function onSay(cid, words, param, channel) local sparam = string.lower(param) if(param == "") then return doPlayerSendCancel(cid, "Enter the name of the spell you want to LEARN.") end if not (tab[sparam]) then return doPlayerSendCancel(cid, "Spell not found.") end if getPlayerStorageValue(cid, 1754) >= 1 then doPlayerSendCancel(cid, "You already have learned an spell.") end if(getPlayerLearnedInstantSpell(cid, tab[sparam].spell)) then return doPlayerSendCancel(cid, "You already have learned this spell.") end if(getPlayerItemCount(cid, tab[sparam].item[1]) >= tab[sparam].item[2]) then doPlayerLearnInstantSpell(cid, tab[sparam].spell) doPlayerRemoveItem(cid, tab[sparam].item[1], tab[sparam].item[2]) setPlayerStorageValue(cid, 1754, 1) doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have learned the spell!") else doPlayerSendCancel(cid, "You need "..tab[sparam].item[2].." "..getItemNameById(tab[sparam].item[1]).." to learn this spell.") end return true end Era exatamente o que eu queria, obrigado!
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.