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
-- OTServ event handling functions end
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
function creatureSayCallback(cid, type, msg)
pera1 = getPlayerStorageValue(cid, 15064)
pera2 = getPlayerStorageValue(cid, 8809)
sex = getPlayerSex(cid)
pos = getPlayerPosition(cid)
if msgcontains(msg, 'outlocked hell') and npcHandler.focus == cid then
if isPremium(cid) then
selfSay('give me 10 sniper gloves and I let you entrance!')
else
selfSay('Sorry, you need a premium account to make this addon.')
end
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 and npcHandler.focus == cid then
if addon2 == -1 or pera2 == 0 then
if pera1 == 1 then
if getPlayerItemCount(cid,5875) >= 10 then
if doPlayerTakeItem(cid,5875,10) then
travel(cid, 33256, 31629, 15)
selfSay('Enjoy you visit.')
doSendMagicEffect(pos, 12)
if sex == 0 then
doPlayerAddItem(cid,2273,1)
else
doPlayerAddItem(cid,2273,1)
end
end
else
selfSay('AAAAAAAAAAAAAAAARGHHHHHH!!!! DONT TRY TO FOOL ME HUMAN!..')
end
else
selfSay('I WILL NOT LET FOOLS ENTER! Complete the Blessed shield quest and you have whats needed in here!!..')
end
else
selfSay('Sorry, OMG.')
end
talk_state = 0
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Zawz argib soul. MWAHAHAHAHAHA')
talk_state = 0
end
return 1
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())