local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 onCreatureAppear(cid)
npcHandler:onCreatureAppear(cid)
function onCreatureDisappear(cid)
npcHandler:onCreatureDisappear(cid)
function onCreatureSay(cid, type, msg)
npcHandler:onCreatureSay(cid, type, msg)
function onThink()
npcHandler:onThink()
function say(param)
npcHandler:say(param.text,param.cid)
function delayedSay(text, delay, cid)
if(not npcHandler:isFocused(cid)) then
return FALSE
else
local param = {cid = cid, text = text}
local delay = delay or 0
local cid = cid or 0
local nid = getNpcCid()
addEvent(say, delay, param)
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
if msgcontains(msg, 'tasks') then
npcHandler:say('If you\'ll be a serial murder, you must do many missions for me. Select oneself tasks of {Cyclops}, {Behemoth}, {Dragon}, {Dragon Lord}, {Hydra}, {Infernalist}, {Medusa}, {Undead Dragon}, {Fury}, {Warlock}, {Wyrm}, {Plaguesmith}, {Bog Raider}, {Grim Reaper}, {Ghazbaran}, {Hellhound}, {Nightmare} or {Demon}.', cid)
if getPlayerStorageValue(cid, 47666) == -1 then
setPlayerStorageValue(cid, 47666, 1)
talk_state = 0
elseif msgcontains(msg, 'cyclops') or msgcontains(msg, 'cyclops') then
if getPlayerStorageValue(cid,60001) == -1 then
npcHandler:say('Yours job rest at killing 550 cyclops. Reward is {1 Gold Ingots} and {41,250 expirence}}.', cid)
setPlayerStorageValue(cid, 60001, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60001) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,1)
doPlayerAddExp(cid, 41250)
setPlayerStorageValue(cid, 60001, 3)
talk_state = 0
elseif msgcontains(msg, 'behemoth') or msgcontains(msg, 'behemoths') then
if getPlayerStorageValue(cid,60002) == -1 then
npcHandler:say('Yours job rest at killing 1500 behemoth. Reward is {3 Gold Ingots} and {1,875,000 expirence}.', cid)
setPlayerStorageValue(cid, 60002, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60002) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,3)
doPlayerAddExp(cid, 1875000)
setPlayerStorageValue(cid, 60002, 3)
talk_state = 0
elseif msgcontains(msg, 'dragon') or msgcontains(msg, 'dragons') then
if getPlayerStorageValue(cid,60003) == -1 then
npcHandler:say('Yours job rest at killing 2000 dragon. Reward is {4 Gold Ingots} and {700,000 expirence}.', cid)
setPlayerStorageValue(cid, 60003, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60003) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,4)
doPlayerAddExp(cid, 700000)
setPlayerStorageValue(cid, 60003, 3)
talk_state = 0
elseif msgcontains(msg, 'dragon lord') or msgcontains(msg, 'dragon lords') then
if getPlayerStorageValue(cid,60004) == -1 then
npcHandler:say('Yours job rest at killing 6000 dragon lord. Reward is {12 Gold Ingots} and {6,300,000 expirence}.', cid)
setPlayerStorageValue(cid, 60004, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60004) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,12)
doPlayerAddExp(cid, 6300000)
setPlayerStorageValue(cid, 60004, 3)
talk_state = 0
elseif msgcontains(msg, 'hydra') or msgcontains(msg, 'hydras') then
if getPlayerStorageValue(cid,60005) == -1 then
npcHandler:say('Yours job rest at killing 2000 hydra. Reward is {4 Gold Ingots} and {2,100,000 expirence}.', cid)
setPlayerStorageValue(cid, 60005, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60005) == 2 then
npcHandler:say('Great job! Here is your token.', cid)
doPlayerAddItem(cid,9971,4)
doPlayerAddExp(cid, 2100000)
setPlayerStorageValue(cid, 60005, 1)
talk_state = 0
elseif msgcontains(msg, 'infernalist') or msgcontains(msg, 'infernalist') then
if getPlayerStorageValue(cid,60006) == -1 then
npcHandler:say('Yours job rest at killing 4000 infernalist. Reward is {8 Gold Ingots} and {8,000,000 expirence}.', cid)
setPlayerStorageValue(cid, 60006, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60006) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,8)
doPlayerAddExp(cid, 8000000)
setPlayerStorageValue(cid, 60006, 3)
talk_state = 0
elseif msgcontains(msg, 'medusa') or msgcontains(msg, 'medusa') then
if getPlayerStorageValue(cid,60007) == -1 then
npcHandler:say('Yours job rest at killing 4500 medusa. Reward is {9 Gold Ingots} and {9,112,500 expirence}.', cid)
setPlayerStorageValue(cid, 60007, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60007) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,9)
doPlayerAddExp(cid, 9112500)
setPlayerStorageValue(cid, 60007, 3)
talk_state = 0
elseif msgcontains(msg, 'undead dragon') or msgcontains(msg, 'undead dragons') then
if getPlayerStorageValue(cid,60008) == -1 then
npcHandler:say('Yours job rest at killing 3500 undead dragon. Reward is {7 Gold Ingots} and {12,600,000 expirence}.', cid)
setPlayerStorageValue(cid, 60008, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60008) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,7)
doPlayerAddExp(cid, 12600000)
setPlayerStorageValue(cid, 60008, 3)
talk_state = 0
elseif msgcontains(msg, 'fury') or msgcontains(msg, 'furys') then
if getPlayerStorageValue(cid,60009) == -1 then
npcHandler:say('Yours job rest at killing 6000 fury. Reward is {12 Gold Ingots} and {13,500,000 expirence}.', cid)
setPlayerStorageValue(cid, 60009, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60009) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,12)
doPlayerAddExp(cid, 13500000)
setPlayerStorageValue(cid, 60009, 3)
talk_state = 0
elseif msgcontains(msg, 'warlock') or msgcontains(msg, 'warlocks') then
if getPlayerStorageValue(cid,60010) == -1 then
npcHandler:say('Yours job rest at killing 2500 warlock. Reward is {5 Gold Ingots} and {5,000,000 expirence}.', cid)
setPlayerStorageValue(cid, 60010, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60010) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,5)
doPlayerAddExp(cid, 5000000)
setPlayerStorageValue(cid, 60010, 3)
talk_state = 0
elseif msgcontains(msg, 'wyrm') or msgcontains(msg, 'wyrms') then
if getPlayerStorageValue(cid,60011) == -1 then
npcHandler:say('Yours job rest at killing 3500 wyrm. Reward is {7 Gold Ingots}, {2,537,500 expirence}.', cid)
setPlayerStorageValue(cid, 60011, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60011) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,7)
doPlayerAddExp(cid, 2537500)
setPlayerStorageValue(cid, 60011, 3)
talk_state = 0
elseif msgcontains(msg, 'plaguesmith') or msgcontains(msg, 'plaguesmiths') then
if getPlayerStorageValue(cid,60012) == -1 then
npcHandler:say('Yours job rest at killing 2500 plaguesmith. Reward is {5 Gold Ingots} and {5,625,000 expirence}.', cid)
setPlayerStorageValue(cid, 60012, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60012) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,5)
doPlayerAddExp(cid, 5625000)
setPlayerStorageValue(cid, 60012, 3)
talk_state = 0
elseif msgcontains(msg, 'bog raider') or msgcontains(msg, 'bog raiders') then
if getPlayerStorageValue(cid,60013) == -1 then
npcHandler:say('Yours job rest at killing 1000 bog raider. Reward is {2 Gold Ingots} and {400,000 expirence}.', cid)
setPlayerStorageValue(cid, 60013, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60013) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,2)
doPlayerAddExp(cid, 400000)
setPlayerStorageValue(cid, 60013, 3)
talk_state = 0
elseif msgcontains(msg, 'ghazbaran') or msgcontains(msg, 'ghazbarans') then
if getPlayerStorageValue(cid,60014) == -1 then
npcHandler:say('Yours job rest at killing 3 ghazbaran. Reward is {3 Gold Ingots}, {22,500 expirence}.', cid)
setPlayerStorageValue(cid, 60014, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60014) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,3)
doPlayerAddExp(cid, 22500)
setPlayerStorageValue(cid, 60014, 3)
talk_state = 0
elseif msgcontains(msg, 'hellhound') or msgcontains(msg, 'hellhounds') then
if getPlayerStorageValue(cid,60015) == -1 then
npcHandler:say('Yours job rest at killing 5000 hellhound. Reward is {17,000,000 expirence} and {10 Gold Ingots}.', cid)
setPlayerStorageValue(cid, 60015, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60015) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddExp(cid, 17000000)
doPlayerAddItem(cid,9971,10)
setPlayerStorageValue(cid, 60015, 3)
talk_state = 0
elseif msgcontains(msg, 'nightmare') or msgcontains(msg, 'nightmares') then
if getPlayerStorageValue(cid,60016) == -1 then
npcHandler:say('Yours job rest at killing 6000 nightmare. Reward is {6,450,000 expirence} and {12 Gold Ingots}.', cid)
setPlayerStorageValue(cid, 60016, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60015) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddExp(cid, 6450000)
doPlayerAddItem(cid,9971,12)
setPlayerStorageValue(cid, 60016, 3)
talk_state = 0
elseif msgcontains(msg, 'demon') or msgcontains(msg, 'demons') then
if getPlayerStorageValue(cid,60017) == -1 then
npcHandler:say('Yours job rest at killing 6000 demon. Reward is {18,000,000 expirence} and {12 Gold Ingots}.', cid)
setPlayerStorageValue(cid, 60017, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,60017) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9971,12)
doPlayerAddExp(cid,18000000)
setPlayerStorageValue(cid, 60017, 3)
talk_state = 0
elseif msgcontains(msg, 'no') then
npcHandler:say('Ok, then not.', cid)
talk_state = 0
return 1
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())