i have grizzly adams woring to talk. but when i have kill i cant get reward or any thing..
this is my script if anyone can fix it i will +rep..
this is my script if anyone can fix it i will +rep..
Lua:
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)
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 say(param)
npcHandler:say(param.text,param.cid)
end
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)
end
end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'demonhunter addon') or msgcontains(msg, 'demonhunter') then
if getPlayerStorageValue(cid,1280) == -1 then
npcHandler:say('Are you realy want be a {demonhunter}?', cid)
talk_state = 1
elseif getPlayerStorageValue(cid,1280) == 1 then
npcHandler:say('You don\'t kill {one thousand demons}! Back when you ready.', cid)
talk_state = 0
elseif getPlayerStorageValue(cid,1280) == 2 then
npcHandler:say('Great! You are a realy demonhunter! For reward I maked for you {first demonhunter addon} and {demon trophy}! And my second reward is access to Ferumbras Tower!', cid)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 288, 1)
doPlayerAddOutfit(cid, 289, 1)
doPlayerAddItem(cid,7393,1)
setPlayerStorageValue(cid, 1280, 3)
setPlayerStorageValue(cid, 1281, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,1282) == -1 then
npcHandler:say('If you want get next demonhunter addon kill {two thousand demons} and bring for me {two hundred demon dust}, ok?', cid)
talk_state = 2
elseif getPlayerStorageValue(cid,1282) == 1 then
npcHandler:say('You don\'t kill two thousand demons! Back when you ready.', cid)
talk_state = 0
elseif getPlayerStorageValue(cid,1282) == 2 then
npcHandler:say('Good! You have killed two thousand demons. Do you have 200 demon dust?', cid)
talk_state = 3
elseif getPlayerStorageValue(cid,1282) == 3 then
npcHandler:say('You have finished demonhunter quest!', cid)
talk_state = 0
end
elseif ((msgcontains(msg, 'oak') or msgcontains(msg, 'demon oak')) and getPlayerStorageValue(cid, 1282) == 3) and getPlayerStorageValue(cid, 13120) == -1 then
npcHandler:say('Are you intresting in Demon Oak Quest?', cid)
talk_state = 10
elseif msgcontains(msg, 'yes') then
if talk_state == 1 then
npcHandler:say('So go and kill {one thousand demons}! Letter back to me.', cid)
setPlayerStorageValue(cid, 1280, 1)
talk_state = 0
elseif talk_state == 2 then
npcHandler:say('I\'ll be waiting.', cid)
setPlayerStorageValue(cid, 1282, 1)
talk_state = 0
elseif talk_state == 3 then
if getPlayerItemCount(cid,5906) >= 200 then
if doPlayerRemoveItem(cid,5906,200) then
npcHandler:say('Thank you. Good luck in future!', cid)
doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 288, 2)
doPlayerAddOutfit(cid, 289, 2)
setPlayerStorageValue(cid, 1282, 3)
talk_state = 0
end
else
npcHandler:say('Sorry, you don\'t have 200 demon dust.', cid)
talk_state = 0
end
elseif talk_state == 10 then
npcHandler:say('It\'s very long mission adn very hard. You must kill 6666 of demons and fight with evil tree on Undead Land. Good Luck.', cid)
setPlayerStorageValue(cid, 13210, 1)
talk_state = 0
end
elseif msgcontains(msg, 'mission') then
npcHandler:say('If you\'ll be a serial murder, you must do many missions for me. Select oneself mission of {behemoth}, {lizards}, {giant spiders}, {spiders}, {drakens}, {ferumbras}, {juggernauts}, {dark torturers}, {bog raiders}, {undead dragons}, {vampires}, {dark mages}, {hand of cursed fates}, {phantasams}, {infernalists}, {sea serpents}, {nightmares}, {hell spawns}, {necromancers}, {wolfs}, {dragon lords}, {rotworms}, {minotaurs} or {deers}.', cid)
if getPlayerStorageValue(cid, 47666) == -1 then
setPlayerStorageValue(cid, 47666, 1)
end
talk_state = 0
elseif msgcontains(msg, 'juggernaut') or msgcontains(msg, 'juggernauts') then
if getPlayerStorageValue(cid,46020) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 300 juggernauts. Reward is {Piece of Massare\'s Shell} and {5,000,000 expirence}}.', cid)
setPlayerStorageValue(cid, 46020, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46020) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6540,1)
doPlayerAddExp(cid, 5000000)
setPlayerStorageValue(cid, 46020, 3)
talk_state = 0
end
elseif msgcontains(msg, 'dark torturer') or msgcontains(msg, 'dark torturers') then
if getPlayerStorageValue(cid,46021) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 500 dark torturers. Reward is {Mr. Punish\'s Handcuffs} and {3,500,000 expirence}.', cid)
setPlayerStorageValue(cid, 46021, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46021) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6537,1)
doPlayerAddExp(cid, 3500000)
setPlayerStorageValue(cid, 46021, 3)
talk_state = 0
end
elseif msgcontains(msg, 'bog raider') or msgcontains(msg, 'bog raiders') then
if getPlayerStorageValue(cid,46022) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 1000 bog riders. Reward is {Plasmother\'s Remains} and {800,000 expirence} and {10 crystal coins}.', cid)
setPlayerStorageValue(cid, 46022, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46022) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6535,1)
doPlayerAddExp(cid, 800000)
doPlayerAddItem(cid,2160,10)
setPlayerStorageValue(cid, 46022, 3)
talk_state = 0
end
elseif msgcontains(msg, 'undead dragon') or msgcontains(msg, 'undead dragons') then
if getPlayerStorageValue(cid,46023) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 600 undead dragons. Reward is {Dracola\'s Eye} and {2,500,000 expirence}.', cid)
setPlayerStorageValue(cid, 46023, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46023) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6546,1)
doPlayerAddExp(cid, 2500000)
setPlayerStorageValue(cid, 46023, 3)
talk_state = 0
end
elseif msgcontains(msg, 'vampire') or msgcontains(msg, 'vampires') then
if getPlayerStorageValue(cid,46024) == -1 then
npcHandler:say('If you kill 500 vampires I give you one vampire lord token. Letter you can change it for {vampire doll} per 50 tokens or {bat decoration} for 30 tokens.', cid)
setPlayerStorageValue(cid, 46024, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46024) == 2 then
npcHandler:say('Great job! Here is your token.', cid)
doPlayerAddItem(cid,9020,1)
setPlayerStorageValue(cid, 46024, 1)
setPlayerStorageValue(cid, 45024, 1)
talk_state = 0
end
elseif msgcontains(msg, 'dark mage') or msgcontains(msg, 'dark mages') then
if getPlayerStorageValue(cid,46025) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 600 dark mages. Reward is {grey tome} and {backpack of holding} and {addon doll}.', cid)
setPlayerStorageValue(cid, 46025, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46025) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,1985,1)
doPlayerAddItem(cid,2365,1)
doPlayerAddItem(cid,6579,1)
setPlayerStorageValue(cid, 46025, 3)
talk_state = 0
end
elseif msgcontains(msg, 'hand of cursed fate') or msgcontains(msg, 'hand of cursed fates') then
if getPlayerStorageValue(cid,46026) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 500 hand of cursed fates. Reward is {Handmaiden\'s Protector} and {4,400,000 expirence}.', cid)
setPlayerStorageValue(cid, 46026, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46026) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6539,1)
doPlayerAddExp(cid, 4400000)
setPlayerStorageValue(cid, 46026, 3)
talk_state = 0
end
elseif msgcontains(msg, 'phantasm') or msgcontains(msg, 'phantasms') then
if getPlayerStorageValue(cid,46027) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 300 phantasms. Reward is {Countess Sorrow\'s Frozen Tear}.', cid)
setPlayerStorageValue(cid, 46027, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46027) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6536,1)
setPlayerStorageValue(cid, 46027, 3)
talk_state = 0
end
elseif msgcontains(msg, 'infernalist') or msgcontains(msg, 'infernalists') then
if getPlayerStorageValue(cid,46028) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 600 inferlaists. Reward is {Imperor\'s Trident} and {25 crystal coins}.', cid)
setPlayerStorageValue(cid, 46028, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46028) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,6534,1)
doPlayerAddItem(cid,2160,25)
setPlayerStorageValue(cid, 46028, 3)
talk_state = 0
end
elseif msgcontains(msg, 'sea serpent') or msgcontains(msg, 'sea serpents') then
if getPlayerStorageValue(cid,46029) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 400 sea serpents. Reward is {Sea Serpent Trophy} and {800,000 expirence}.', cid)
setPlayerStorageValue(cid, 46029, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46029) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,10529,1)
doPlayerAddExp(cid, 800000)
setPlayerStorageValue(cid, 46029, 3)
talk_state = 0
end
elseif msgcontains(msg, 'nightmare') or msgcontains(msg, 'nightmares') then
if getPlayerStorageValue(cid,46030) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 1200 nightmares. Reward is {Bear} and {2,000,000 expirence} and {10 crystal coins}.', cid)
setPlayerStorageValue(cid, 46030, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46030) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,3954,1)
doPlayerAddExp(cid, 2000000)
doPlayerAddItem(cid,2160,10)
setPlayerStorageValue(cid, 46030, 3)
talk_state = 0
end
elseif msgcontains(msg, 'hell spawn') or msgcontains(msg, 'hell spawns') then
if getPlayerStorageValue(cid,46032) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 800 hell spawns. Reward is {Nose Ring} and {2,000,000 expirence} and {15 crystal coins}.', cid)
setPlayerStorageValue(cid, 46032, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46032) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,5804,1)
doPlayerAddExp(cid, 2000000)
doPlayerAddItem(cid,2160,15)
setPlayerStorageValue(cid, 46032, 3)
talk_state = 0
end
elseif msgcontains(msg, 'necromancer') or msgcontains(msg, 'necromancers') then
if getPlayerStorageValue(cid,46033) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 750 necormancers. Reward is {Soul Stone}.', cid)
setPlayerStorageValue(cid, 46033, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46033) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,5809,1)
setPlayerStorageValue(cid, 46033, 3)
talk_state = 0
end
elseif msgcontains(msg, 'quara predator') or msgcontains(msg, 'quara predators') then
if getPlayerStorageValue(cid,46034) == -1 then
npcHandler:say('You selected hard mission. Yours job rest at killing 600 quara predators. Reward is {Marlin Trophy} and {600,000 expirence}.', cid)
setPlayerStorageValue(cid, 46034, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46034) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7964,1)
doPlayerAddExp(cid, 600000)
setPlayerStorageValue(cid, 46034, 3)
talk_state = 0
end
elseif msgcontains(msg, 'wolf') or msgcontains(msg, 'wolfs') then
if getPlayerStorageValue(cid,46035) == -1 then
npcHandler:say('You selected easy mission. Yours job rest at killing 50 wolfs. Reward is {Wolf Trophy} and {250,000 expirence}.', cid)
setPlayerStorageValue(cid, 46035, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46035) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7394,1)
doPlayerAddExp(cid, 250000)
setPlayerStorageValue(cid, 46035, 3)
talk_state = 0
end
elseif msgcontains(msg, 'dragon lord') or msgcontains(msg, 'dragon lords') then
if getPlayerStorageValue(cid,46036) == -1 then
npcHandler:say('You selected easy mission. Yours job rest at killing 1000 dragon lords. Reward is {Dragon Claw} and {800,000 expirence} and {10 crystal coins}.', cid)
setPlayerStorageValue(cid, 46036, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46036) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,5919,1)
doPlayerAddExp(cid, 800000)
doPlayerAddItem(cid,2160,10)
setPlayerStorageValue(cid, 46036, 3)
talk_state = 0
end
elseif msgcontains(msg, 'deer') or msgcontains(msg, 'deers') then
if getPlayerStorageValue(cid,46037) == -1 then
npcHandler:say('You selected very easy mission. Yours job rest at killing 30 deers. Reward is {Deer Trophy} and {200,000 expirence}.', cid)
setPlayerStorageValue(cid, 46037, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46037) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7397,1)
doPlayerAddExp(cid, 200000)
setPlayerStorageValue(cid, 46037, 3)
talk_state = 0
end
elseif msgcontains(msg, 'minotaur') or msgcontains(msg, 'minotaurs') then
if getPlayerStorageValue(cid,46038) == -1 then
npcHandler:say('You selected very easy mission. Yours job rest at killing 100 miotaurs. Reward is {Minotaur Trophy} and {250,000 expirence}.', cid)
setPlayerStorageValue(cid, 46038, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46038) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7401,1)
doPlayerAddExp(cid, 250000)
setPlayerStorageValue(cid, 46038, 3)
talk_state = 0
end
elseif msgcontains(msg, 'rotworm') or msgcontains(msg, 'rotworms') then
if getPlayerStorageValue(cid,46039) == -1 then
npcHandler:say('You selected very easy mission. Yours job rest at killing 100 rotworms. Reward is {8 crystal coins}.', cid)
setPlayerStorageValue(cid, 46039, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,46039) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,2160,8)
setPlayerStorageValue(cid, 46039, 3)
talk_state = 0
end
elseif msgcontains(msg, 'behemoth') or msgcontains(msg, 'behemoths') then
if getPlayerStorageValue(cid,14251) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 400 behemoth. Reward is {behemoth trophy} and {1,990,000 expirence}.', cid)
setPlayerStorageValue(cid, 14251, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14251) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7396,1)
doPlayerAddExp(cid, 1990000)
setPlayerStorageValue(cid, 14251, 3)
talk_state = 0
end
elseif msgcontains(msg, 'draken') or msgcontains(msg, 'drakens') then
if getPlayerStorageValue(cid,14253) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 1000 drakens. Reward is {draken doll} and {1,000,000 expirence} and {25 crystal coins}.', cid)
setPlayerStorageValue(cid, 14253, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14253) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,11309,1)
doPlayerAddItem(cid,2160,25)
doPlayerAddExp(cid, 1000000)
setPlayerStorageValue(cid, 14253, 3)
talk_state = 0
end
elseif msgcontains(msg, 'lizard') or msgcontains(msg, 'lizards') then
if getPlayerStorageValue(cid,14255) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 900 lizards. Reward is {lizard trophy} and {800,000 expirence} and {25 crystal coins}.', cid)
setPlayerStorageValue(cid, 14255, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14255) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,11330,1)
doPlayerAddItem(cid,2160,25)
doPlayerAddExp(cid, 800000)
setPlayerStorageValue(cid, 14255, 3)
talk_state = 0
end
elseif msgcontains(msg, 'giant spider') or msgcontains(msg, 'giant spiders') then
if getPlayerStorageValue(cid,14257) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 800 giant spiders. Reward is {spiderwebs} and {1,500,000 expirence} and {10 crystal coins}.', cid)
setPlayerStorageValue(cid, 14257, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14257) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,8860,1)
doPlayerAddItem(cid,2160,10)
doPlayerAddExp(cid, 1500000)
setPlayerStorageValue(cid, 14257, 3)
talk_state = 0
end
elseif msgcontains(msg, 'spider') or msgcontains(msg, 'spiders') then
if getPlayerStorageValue(cid,14259) == -1 then
npcHandler:say('You selected very easy mission. Yours job rest at killing 40 spiders. Reward is {toy spider} and {360,000 expirence}.', cid)
setPlayerStorageValue(cid, 14259, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14259) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,9006,1)
doPlayerAddExp(cid, 360000)
setPlayerStorageValue(cid, 14259, 3)
talk_state = 0
end
elseif msgcontains(msg, 'ferumbras') then
if getPlayerStorageValue(cid,14261) == -1 then
npcHandler:say('You selected very hard mission. Yours job rest at killing 2 ferumbras. Reward is {fireflanz} and {ferumbras hat}.', cid)
setPlayerStorageValue(cid, 14261, 1)
talk_state = 0
elseif getPlayerStorageValue(cid,14261) == 2 then
npcHandler:say('Great job! Here is your reward.', cid)
doPlayerAddItem(cid,7959,1)
doPlayerAddItem(cid,5903,1)
setPlayerStorageValue(cid, 14261, 3)
talk_state = 0
end
elseif msgcontains(msg, 'doll') then
if getPlayerItemCount(cid,9020) >= 50 then
if doPlayerRemoveItem(cid,9020,50) then
doPlayerAddItem(cid,9019,1)
npcHandler:say('Here is you vampire doll.', cid)
talk_state = 0
end
else
npcHandler:say('You don\'t have 50 vampire lord tokens.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'vampire doll') then
if getPlayerItemCount(cid,9020) >= 50 then
if doPlayerRemoveItem(cid,9020,50) then
doPlayerAddItem(cid,9019,1)
npcHandler:say('Here is you vampire doll.', cid)
talk_state = 0
end
else
npcHandler:say('You don\'t have 50 vampire lord tokens.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'bat decoration') then
if getPlayerItemCount(cid,9020) >= 30 then
if doPlayerRemoveItem(cid,9020,30) then
doPlayerAddItem(cid,6492,1)
npcHandler:say('Here is you bat decoration.', cid)
talk_state = 0
end
else
npcHandler:say('You don\'t have 30 vampire lord tokens.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'no') then
npcHandler:say('Ok, then not.', cid)
talk_state = 0
end
return 1
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())