• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

creature script daily task counter

bum bum

zatania developer
Joined
Aug 23, 2010
Messages
24
Reaction score
1
hello otlanders i have a script for my daily hunt npc that dont add value on kill of the monsters if someone have a little time to help i would priciate it very much

bum bum

Lua:
local config = {
  ["dragon"] = {storage = 22, count = 30},
  ["wyrm"] = {storage = 23, count = 50},
  ["dragon lord"] = {storage = 26, count = 75},
  ["hydra"] = {storage = 27, count = 100},
  ["behemoth"] = {storage = 30, count = 250},
  ["Serpent spawn"] = {storage = 31, count = 120},
  ["medusa"] = {storage = 34, count = 150},
  ["grim reaper"] = {storage = 35, count = 150},
  ["demon"] = {storage = 38, count = 150},
  ["ghastly dragon"] = {storage = 39, count = 150},
  ["demon"] = {storage = 61, count = 150},
  ["undead dragon"] = {storage = 62, count = 150},
  ["demon"] = {storage = 41, count = 150},
  ["juggernaut"] = {storage = 42, count = 150},
}
function onKill(cid, target, lastHit)
local creature, task, kills = config[getCreatureName(target):lower()], getPlayerStorageValue(cid, 2423), getPlayerStorageValue(cid, 2425)
local function isSummon(cid)
return getCreatureMaster(cid) ~= cid or false
end
if creature and lastHit then
if isPlayer(target) or isSummon(target) then return true end
if task == creature.storage then
setPlayerStorageValue(cid, 2425, kills + 1)
if kills < creature.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed " .. getCreatureName(target) .. " [" .. kills .. "/" .. creature.count.."]")
elseif kills == creature.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed the last " .. getCreatureName(target) .. ", go back to NPC and report.")
end
end
end
return true
end
 
Back
Top