Zaggyzigzig
plx itens menz
Using Avesta 7.6 old school, onkill doesn't work.... heres my files take a look please!
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- XVX FORGER START --
function mission(cid, message, keywords, parameters, node)
if(npcHandler.focus ~= cid) then
return false
end
if getPlayerStorageValue(cid, 5002) == -1 then
npcHandler:say('You have accepted the mission!', cid)
setPlayerStorageValue(cid,5002,1)
else
npcHandler:say('You already have this mission.', cid)
end
end
function report(cid, message, keywords, parameters, node)
if(npcHandler.focus ~= cid) then
return false
end
if getPlayerStorageValue(cid, 19000) == 5 then
npcHandler:say('Here is your reward', cid)
doPlayerAddItem(cid, 2152, 80)
doPlayerAddExp(cid, 2000)
else
npcHandler:say('come back when you killed 5 rats. Killed:[' .. (getPlayerStorageValue(cid, 19000)+1) .. '/5] Rats.', cid)
end
end
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "You can claim a Mission, report as mission or leave the mission."})
local node1 = keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Hmm, Do you want to go kill 5 rats for me ?'})
node1:addChildKeyword({'yes'}, mission, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you want this mission.', reset = true})
local node2 = keywordHandler:addKeyword({'report'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You would like to report the mission, have you killed 5 rats?'})
node2:addChildKeyword({'yes'}, report, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you killed 5 rats.', reset = true})
npcHandler:addModule(FocusModule:new())
Last edited by a moderator: