local teleportToPosition = Position(32271, 32261, 12)
local function removeTeleport(position)
local teleportItem = Tile(position):getItemById(1387)
if teleportItem then
teleportItem:remove()
position:sendMagicEffect(CONST_ME_POFF)
end
end
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster or targetMonster:getName():lower() ~= 'firebreath' then
return true
end
local position = targetMonster:getPosition()
position:sendMagicEffect(CONST_ME_TELEPORT)
local item = Game.createItem(1387, 1, position)
if item:isTeleport() then
item:setDestination(teleportToPosition)
end
targetMonster:say('You have deafeated firebreath! Enter the teleport to claim your reward. It will dissapear in 10 seconds.', TALKTYPE_MONSTER_SAY, 0, 0, position)
--remove portal after 10 secs.
addEvent(removeTeleport, 10 *1000, position)
return true
end