RANK_NONE = 0
RANK_HUNTSMAN = 1
RANK_RANGER = 2
RANK_BIGGAMEHUNTER = 3
RANK_TROPHYHUNTER = 4
RANK_ELITEHUNTER = 5
REWARD_MONEY = 1
REWARD_EXP = 2
REWARD_ACHIEVEMENT = 3
REWARD_STORAGE = 4
REWARD_POINT = 5
end
elseif msg:lower() == "cancel" then
local started = getPlayerStartedTasks(cid)
if started and #started > 0 then
selfSay("Cancelling a task will make the count restart. Wich task you want to cancel?", cid)
talkState[talkUser] = 2
else
selfSay("You haven't started any task yet.", cid)
end
elseif getTaskByName(msg) and talkState[talkUser] == 2 and isInArray(getPlayerStartedTasks(cid), getTaskByName(msg)) then
local task = getTaskByName(msg)
if getCreatureStorage(cid, KILLSSTORAGE_BASE + task) > 0 then
selfSay("You currently killed " .. getCreatureStorage(cid, KILLSSTORAGE_BASE + task) .. "/" .. tasks[task].killsRequired .. " " .. tasks[task].raceName .. ". Cancelling this task will restart the count. Are you sure you want to cancel this task?", cid)
else
selfSay("Are you sure you want to cancel this task?", cid)
end
talkState[talkUser] = 3
cancel[cid] = task
elseif msg:lower() == "yes" and talkState[talkUser] == 3 then
doCreatureSetStorage(cid, QUESTSTORAGE_BASE + cancel[cid], -1)
doCreatureSetStorage(cid, KILLSSTORAGE_BASE + cancel[cid], -1)
selfSay("You have cancelled the task " .. (tasks[cancel[cid]].name or tasks[cancel[cid]].raceName) .. ".", cid)
talkState[talkUser] = 0
elseif isInArray({"points", "rank"}, msg:lower()) then
selfSay("At this time, you have " .. getCreatureStorage(cid, POINTSSTORAGE) .. " Paw & Fur points. You " .. (getPlayerRank(cid) == 5 and "are an Elite Hunter" or getPlayerRank(cid) == 4 and "are a Trophy Hunter" or getPlayerRank(cid) == 3 and "are a Big Game Hunter" or getPlayerRank(cid) == 2 and "are a Ranger" or getPlayerRank(cid) == 1 and "are a Huntsman" or "haven't been ranked yet") .. ".", cid)
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())