Crie outro arquivo chamado softboots.lua em npc/scripts contendo:
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 rechargeSoft(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local playermoney = getPlayerMoney(cid)
if playermoney >= 10000 then
if doPlayerRemoveItem(cid,6530,1) == 1 then
doPlayerAddItem(cid, 6132, 1)
doPlayerRemoveMoney(cid, 10000)
npcHandler:say("Here are your new soft boots!", cid)
else
npcHandler:say("You don't have worn soft boots.", cid)
end
else
npcHandler:say("You don't have enough money.", cid)
end
keywordHandler:moveUp(1)
return true
end
local node1 = keywordHandler:addKeyword({'soft boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to repair your soft boots for 10000 gold coins?'})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn soft boots for 10000 gold coins."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn soft boots for 10000 gold coins."})
npcHandler:addModule(FocusModule:new())
Está feito seu NPC, fale hi soft boots yes, e terá sua soft boots nova
info
Grupo: Marquês
Registrado: 01/03/06
Posts: 1k
Reputação: +38
Gênero: Masculino
Este NPC pede uma quantia em dinheiro e renova a soft boots.
Crie um arquivo chamado Soft Boots Recharger.xml em data/npc contendo:
Crie outro arquivo chamado softboots.lua em npc/scripts contendo:
Está feito seu NPC, fale hi soft boots yes, e terá sua soft boots nova