local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler
nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler
nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler
nCreatureSay(cid, type, msg) end
function onThink() npcHandler
nThink() end
function rechargeSoft(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local playermoney = getPlayerMoney(cid)
if playermoney >= 100000 then
if doPlayerRemoveItem(cid,6530,1) == 1 then
doPlayerAddItem(cid, 6132, 1)
doPlayerRemoveMoney(cid, 100000)
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({'repair'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to repair your soft boots for 100000 gold coins?'})
node1:addChildKeyword({'yes'}, rechargeSoft, {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 soft boots for 100000 gold coins."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can repair a pair of worn soft boots for 100000 gold coins."})
npcHandler:addModule(FocusModule:new())