Npc que troca a quantidade editavel de itens por 1 item de ID diferente.
Vá em Data/NPC/Scripts/e crie um arquivo chamado = trocaitems.lua
E cole esse código dentro e salve.
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 playerHaveItems(cid, itemid) local items = type(itemid) == "table" and itemid or {itemid} for i = 1, #items do if getPlayerItemCount(cid, items[i]) <= 0 then return false end end return true end function doPlayerRemoveItems(cid, itemid, count) local items = type(itemid) == "table" and itemid or {itemid} for i = 1, #items do doPlayerRemoveItem(cid, items[i], count ~= nil and count or 1) end return nil end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, "trocar") then if playerHaveItems(cid, {5896, 6569, 2674, 5894, 5888, 5881, 5901}) then doPlayerRemoveItems(cid, {5896, 6569, 2674, 5894, 5888, 5881, 5901}, 700) doPlayer***Item(cid, 2521, 1) else selfSay("Voce precisa de 700 Future orb, 700 water pendant, 700 Stone orb, 700 Essenses of fire, 700 Feathers, 700 bottles of poison e 700 Ice Orb, Para Conseguir Uma Master Ball.") end end return true endnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:***Module(FocusModule:new())
Agora vá em Data/Npc/e crie um arquivo chamado = Nomedonpc.xml
E cole esse código dentro e salve
<npc name="Nomedonpc" script="trocaitems.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="169" head="114" body="86" legs="114" feet="0" ***ons="2"/> <parameters> <parameter key="message_greet" value="Ola, diga {trocar} para trocar 7 items por 1."/> </parameters> </npc>
Tradução:
Azul: ID dos itens
Vermelho: quantidade
Verde: ID que o Npc irá te dar
Amarelo: Mensagem se não tiver os itens
Laranja: Nome do Npc
Rosa: Mensagem para trocar os itens
creditos:
~Luquinhas
Nova Web Cheats