function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "GhazbaranTeleport") -- Eventname
local creaturename = getCreatureName(cid)
local in_pos = {x=477, y=233, z=9, stackpos=2} -- Teleport pos
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=450, y=242, z=10, stackpos=1} -- Reward room? pos
local time_to_pass = 60 -- in seconds
local tpID = 1387
if creaturename == 'Ghazbaran' then -- Creature name
teleport = doCreateTeleport(tpID, to_pos, in_pos)
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
doCreatureSay(cid, "You have 60 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport4, (1000*time_to_pass))
end
end
function removeTeleport4()
if getThingfromPos({x=477, y=233, z=9, stackpos=1}).itemid == 1387 then -- Teleport pos all 3 lines
doRemoveItem(getThingfromPos({x=477, y=233, z=9, stackpos=1}).uid,2)
doSendMagicEffect({x=477, y=233, z=9, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end