npc que troca 8 itens diferentes por 1 so, e se tentasse trocar novamente não ia dar.
valendo rep+
npc que troca 8 itens diferentes por 1 so, e se tentasse trocar novamente não ia dar.
valendo rep+
Se gostou da um rep+ =D
POKEMON CENTURION CLICK/\
Para contatos:
Skype: claudio.alexandre95
Msn: cacaiu_alexandre@hotmail.com
Facebook: http://www.facebook....io.alexandre.90
bom vc só falou que quer um npc que troca 8 item por 1 mais não deu detalhes como npc ia falar esc
então fisso um rapidinho aqui testa ai
data\npc\scripts\nomedoarquivo.lua
------------------- By Notle ------------------- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local troca = {2163,2164,2165,2166,2167,2168,2169,2170} -- id dos item que vai ser trocados local id = 2160 --- id do item que vai ganhar dps da troca local quant = 100 -- item que ganhar Contém quantos? local sto = 1585 -- Storage function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if msgcontains(msg, 'trocaitem') then status = getPlayerStorageValue(cid,sto) if status == -1 then if doPlayerRemoveItem(cid,troca[1],1) and doPlayerRemoveItem(cid,troca[2],1)and doPlayerRemoveItem(cid,troca[3],1) and doPlayerRemoveItem(cid,troca[4],1) and doPlayerRemoveItem(cid,troca[5],1) and doPlayerRemoveItem(cid,troca[6],1) and doPlayerRemoveItem(cid,troca[7],1) and doPlayerRemoveItem(cid,troca[8],1) then doPlayerAddItem(cid,id,quant) setPlayerStorageValue(cid,sto,1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "coloca um texto aqui") -- edita aqui else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você Não Contém Uns Dos Itens Não Posso Troca.") -- edita aqui end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não Pode Troca De novo") end return TRUE end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
data\npc\nomedoarquivo.xml
<npc name="NOMEDONPC" script="data/npc/scripts/nomedoarquivo.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="78" body="88" legs="0" feet="88" addons="3"/> <parameters> <parameter key="message_greet" value="Ola. Para mais informacoes de meus servicos diga {trocaitem}." /> <parameter key="message_farewell" value="Tchau." /> <parameter key="message_walkaway" value="Tchau." /> </parameters> </npc>
Por Favor quando for fazer pedidos faz o pedido com mais clareza e com os mínimos detalhes
GOSTO DOS MEUS SCRIPT CLICK EM CURTIR :D
Vlw xd rep+
Se gostou da um rep+ =D
POKEMON CENTURION CLICK/\
Para contatos:
Skype: claudio.alexandre95
Msn: cacaiu_alexandre@hotmail.com
Facebook: http://www.facebook....io.alexandre.90