local colorMsg = "orange"
local tableBoss = {
["[EXP] Statue"] = {seconds = 3600, newBoss = "[EXP] Statue"}
}
local function timer(position, duration, color)
for i = 0, (duration - 1) do
addEvent(function()
doSendAnimatedText(position, tostring(duration - i), color)
end, i * 1000)
end
end
local lastTarget = nil
function onKill(cid, target, damage, flags)
if lastTarget and lastTarget == target then
return true
end
lastTarget = target
if isPlayer(target) then
return true
end
local boss = tableBoss[getCreatureName(target)]
if not boss then
return true
end
local position = getThingPos(target)
doPlayerSendTextMessage(cid, MESSAGE_TYPES[colorMsg], "The boss will be born in " .. boss.seconds .. " seconds.")
timer(position, boss.seconds, COLOR_WHITE)
addEvent(doCreateMonster, boss.seconds * 1000, boss.newBoss, position)
return true
end