I am doing wrath of the emperor quest last boss, but not exactly as real tibia.
When u talk to npc and say "yes", the first boss spawns, when u kill it, the next boss spawns at the pos that the first boss died, then next spawns, and for last boss a tp appear on boss deadlocation that leads to tp room.
As of now it works to talk with npc and spawn the first boss, this is happening in the NPC script. I have script in creaturescripts, onKill function for the rest, but this does not work, help is apprecieated! Thanks!
Here is the creaturescript:
When u talk to npc and say "yes", the first boss spawns, when u kill it, the next boss spawns at the pos that the first boss died, then next spawns, and for last boss a tp appear on boss deadlocation that leads to tp room.
As of now it works to talk with npc and spawn the first boss, this is happening in the NPC script. I have script in creaturescripts, onKill function for the rest, but this does not work, help is apprecieated! Thanks!
Here is the creaturescript:
Code:
local config = {
timeToRemove = 180, -- seconds
message = "You now have 3 minutes to exit this room through the teleporter or the teleporter will dissapear. It will bring you to the reward room",
teleportId = 9711,
bosses = { -- Monster Name, Teleport Position
["Snake God Essence"] = { pos={ x=33066, y=31153, z=15, stackpos=1 }},
["Snake Thing"] = { pos={ x=33066, y=31153, z=15, stackpos=1 }},
["Lizard Abomination"] = { pos={ x=33066, y=31153, z=15, stackpos=1 }},
["Mutated Zalomon"] = { pos={ x=33066, y=31153, z=15, stackpos=1 }, aid=9955}
},
Area = {
fromPos = {x=33056, y=31143, z=15},
toPos = {x=33076, y=31161, z=15}
}
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
if (t = "Snake God Essence") then
doSummonCreature("Snake Thing", {x=33066, y=31153, z=15})
elseif (t = "Snake Thing") then
doSummonCreature("Lizard Abomination"), {x=33066, y=31153, z=15})
elseif (t = "Lizard Abomination") then
doSummonCreature("Mutated Zalomon"), {x=33066, y=31153, z=15})
else if (t = "Mutated Zalomon")then
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
return TRUE
end