Gente hoje resolvi fazer um NPC realmente muito eficiente ...
Um npc de recharger da Firewalker boots.
Lá vai os scripts...
1º Passo:
Entre na sua pasta do otserver, data/npc copie qualquer arquivo da pasta e renomeie para fire recharger.xml, apage tudo oque tem dentro e coloque:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Recharger" script="data/npc/scripts/firerecharg.lua" access="3" lookdir="2"
walkinterval="2000">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="243" head="79" body="94" legs="114" feet="77" addons="3"/>
</npc>
2º Passo:
Agora entre na pasta: data/npc/scripts, copie qualquer arquivo e renomeie para firerecharg.lua, apage tudo que tem dentro e coloque:
--------------------------------------------------------------
----------Recharger Firewalker boots by Ricktcs---------------
--------------------------------------------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 rechargeFirewalker(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local playermoney = getPlayerMoney(cid)
if playermoney >= 20000 then
if doPlayerRemoveItem(cid,9934,1) == 1 then
doPlayerAddItem(cid, 9933, 1)
doPlayerRemoveMoney(cid, 20000)
npcHandler:say("Here are your new firewalker boots!", cid)
else
npcHandler:say("You don't have worn firewalker boots.", cid)
end
else
npcHandler:say("You don't have enough money.", cid)
end
keywordHandler:moveUp(1)
return true
end
local node1 = keywordHandler:addKeyword({'firewalker boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to repair your firewalker boots for 20000 gold coins?'})
node1:addChildKeyword({'yes'}, rechargeFirewalker, {blessing = 1})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn {firewalker boots} for 20000 gold coins."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn {firewalker boots} for 20000 gold coins."})
npcHandler:addModule(FocusModule:new())
Pronto esta ai seu NPC recharger da Firewalker Boots. Para recarregar a firewalker boots é só voce falar ao NPC:
Hi
help (ou offer, ou firewalker boots se quiser ser mais direto)
firewalker boots
yes.
Espero que eu tenha ajudado algumas pessoas.
COMENTE!
~Ricktcs~