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
local storage_id = 9000
local function onGreet_Callback(cid)
local player = Player(cid)
local storage = player:getStorageValue(storage_id)
if storage < 1 then
npcHandler:setMessage(MESSAGE_GREET, "Will only say this the first time.")
player:setStorageValue(storage_id, 1)
else
npcHandler:setMessage(MESSAGE_GREET, "Will say ever time after the first time.")
end
return true
end
npcHandler:setCallback(CALLBACK_GREET, onGreet_Callback)
npcHandler:addModule(FocusModule:new())