Olá, achei em outro lugara, não testei, fica ctg..
talkaction/script/wand.lua
function onSay(cid, words, param)local param = string.lower(param)local table = {["fire"] = 12031,["ice"] = 12032,["earth"] = 12033,["death"] = 12034,["energy"] = 12035,["holy"] = 12036}local id = 12609 --- aqui vai o id da wandlocal a = table[param]if not a thendoPlayerSendTextMessage(cid, 28, "Digite !wand info para saber os elementos disponiveis")return trueendif (param == "info") thenfor element, stor in pairs(table) dotext = "Elementos: "..element..""doPlayerPopupFYI(cid, text)endendif getPlayerItemCount(cid, id) >= 1 thensetPlayerStorageValue(cid, 12031, 0)setPlayerStorageValue(cid, 12032, 0)setPlayerStorageValue(cid, 12033, 0)setPlayerStorageValue(cid, 12034, 0)setPlayerStorageValue(cid, 12035, 0)setPlayerStorageValue(cid, 12036, 0)setPlayerStorageValue(cid, a, 1)doPlayerSendTextMessage(cid, 27 , "Você mudou o elemento da wand para ".. param .. ".")elsedoPlayerSendTextMessage(cid, 28, "Desculpe, mais você precisa ter a ".. getItemNameById(id) .. " para trocar o elemento.")endreturn trueend
talkaction.xml
<talkaction words="!wand" event="script" value="wand.lua"/>
agora em data/weapons/scripts crie um arquivo e renomeie para wand1.lua e adicione isso dentro:
<wand id="xxx" level="50" mana="13" min="0" max="0" type="earth" event="script" value="wand1.lua"> <!-- wand of effects --><vocation id="1"/><vocation id="2"/><vocation id="5"/><vocation id="6"/>
em items.xml
<item id="xxx" article="the" name="nome da sua wand"><attribute key="description" value="Você pode mudar o elemento da wand digitando !wand elemento desejado." /><attribute key="weight" value="2300" /><attribute key="weaponType" value="wand" /><attribute key="shootType" value="holy" /><attribute key="range" value="8" />
em data/creaturescripts/scripts login.lua antes do ultimo return true adicione essa linha:
if getPlayerStorageValue(cid, 12036) == -1 thensetPlayerStorageValue(cid, 12036, 1)end
Créditos Skyforever.