caio1523 0 Postado Setembro 30, 2009 Share Postado Setembro 30, 2009 (editado) Olá, gostaria de um Npc que Repara Soft Boots e Firewalker Boots.. os dois num único Npc para 8.5 Grato. Editado Setembro 30, 2009 por Sheikah Link para o comentário Compartilhar em outros sites More sharing options...
joaohd 200 Postado Setembro 30, 2009 Share Postado Setembro 30, 2009 toma o script aew. o xml c faz ae. local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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(not npcHandler:isFocused(cid)) then return false end ------------------------------------------------------------------------------- if msgcontains(msg, 'soft boots') or msgcontains(msg, 'boots') or msgcontains(msg, 'soft') then selfSay('Yeah, i can repair your soft boots for 10000 gold. Do you want?', cid) talk_state = 1 elseif msgcontains(msg, 'yes') and talk_state == 1 then if getPlayerItemCount(cid,6530) >= 1 then if doPlayerRemoveMoney(cid,10000) then selfSay('Here you are.', cid) doPlayerRemoveItem(cid,6530,1) doPlayerAddItem(cid,2640,1) talk_state = 0 else selfSay('You do not have enough money.', cid) talk_state = 0 end else selfSay('You do not have worn soft boots.', cid) talk_state = 0 end elseif msgcontains(msg, 'firewalker boots') or msgcontains(msg, 'firewalker') then selfSay('Yeah, i can repair your firewalker boots for 50000 gold. Do you want?', cid) talk_state = 2 elseif msgcontains(msg, 'yes') and talk_state == 2 then if getPlayerItemCount(cid,9934) >= 1 then if doPlayerRemoveMoney(cid,50000) then selfSay('Here you are.', cid) doPlayerRemoveItem(cid,9934,1) doPlayerAddItem(cid,9933,1) talk_state = 0 else selfSay('You do not have enough money.', cid) talk_state = 0 end else selfSay('You do not have worn firewalker boots.', cid) talk_state = 0 end elseif msg == 'no' and talk_state >= 1 then selfSay('Ok then.', cid) talk_state = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) eu testei e deu certim. flw Link para o comentário Compartilhar em outros sites More sharing options...
caio1523 0 Postado Setembro 30, 2009 Autor Share Postado Setembro 30, 2009 Opa valew.. funcionou certinho. Link para o comentário Compartilhar em outros sites More sharing options...
BravHart 21 Postado Setembro 30, 2009 Share Postado Setembro 30, 2009 Duvida Sanda, Link para o comentário Compartilhar em outros sites More sharing options...
helinholima 13 Postado Setembro 30, 2009 Share Postado Setembro 30, 2009 Dúvida Sanada, Tópico Fechado Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados