function onKill(cid, target, lastHit) -- Security check dla potworów, jeśli gdzieś są używane storage w potworach, żeby się nie gryzło z Task Systemem local player = isPlayer(cid) if not player or isPlayer(target) then return true end local startedTasks = getPlayerStartedTasks(cid) local monsterName = getCreatureName(target):lower() for taskmonster, task_id in ipairs(startedTasks) do if (startedTasks and #startedTasks > 0) then local currentTask = tasks[task_id] if isInArray(currentTask.creatures, monsterName) then local status = KILLSSTORAGE_BASE + task_id local killsCount = getPlayerStorageValue(cid, status) if killsCount < currentTask.killsRequired then if(getPlayerStorageValue(cid, status) < 0) then setPlayerStorageValue(cid, status, 0) end local party = getPartyMembers(cid) setPlayerStorageValue(cid, status, killsCount + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You killed " ..(killsCount+1).. " of " .. currentTask.killsRequired .. " " .. currentTask.raceName .. " so far.") if killsCount == currentTask.killsRequired then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! You completed " .. currentTask.raceName .. " task! (Killed " ..(killsCount+1).. " of " .. currentTask.killsRequired .. "). Go back to Grizzly Adams and report it to get reward!") end if party then if cid then -- Anty Duplikat jebany return true end for it, member in ipairs(party) do if member then local member_status = getPlayerStorageValue(member, status) if member_status < currentTask.killsRequired then setPlayerStorageValue(member, status, member_status + 1) doPlayerSendTextMessage(member, MESSAGE_STATUS_CONSOLE_BLUE, "You killed " ..(member_status+1).. " of " .. currentTask.killsRequired .. " " .. currentTask.raceName .. " so far.") if member_status == currentTask.killsRequired then doPlayerSendTextMessage(member, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! You completed " .. currentTask.raceName .. " task! (Killed " ..(member_status+1).. " of " .. currentTask.killsRequired .. "). Go back to Grizzly Adams and report it to get reward!") end end end end end end end end end return true end