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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
elseif msgcontains(msg, "balance") then
local balance = getPlayerBalance(cid)
npcHandler:say(balance >= 10000000 and "I think you must be one of the richest inhabitants of Tibia! Your account balance is " .. balance .. " gold." or balance >= 1000000 and "Wow, you've reached the magic number of one million gp! Your account balance is " .. balance .. " gold." or balance >= 100000 and "You certainly have made a pretty penny. Your account balance is " .. balance .. " gold." or "Your account balance is " .. balance .. " gold.", cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())