Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monsters =
- {
- ["Ushuriel"] = {teleportPos = {x = 10249, y = 10350, z = 12, stackpos = 1}, toPos = {x = 10173, y = 10560, z = 13}},
- ["Zugurosh"] = {teleportPos = {x = 10392, y = 10523, z = 13, stackpos = 1}, toPos = {x = 10313, y = 10472, z = 13}},
- ["Madareth"] = {teleportPos = {x = 10343, y = 10458, z = 13, stackpos = 1}, toPos = {x = 10288, y = 10364, z = 13}},
- ["Annihilon"] = {teleportPos = {x = 10637, y = 10465, z = 13, stackpos = 1}, toPos = {x = 10294, y = 10678, z = 13}},
- ["Hellgorak"] = {teleportPos = {x = 33105, y = 31735, z = 11, stackpos = 1}, toPos = {x = 33105, y = 31734, z = 11}}
- }
- local brothers =
- {
- ["Golgordan"] = {teleportPos = {x = 10510, y = 10344, z = 13}, toPos = {x = 10408, y = 10414, z = 13}, brother = "Latrivan"},
- ["Latrivan"] = {teleportPos = {x = 10510, y = 10344, z = 13}, toPos = {x = 10408, y = 10414, z = 13}, brother = "Golgordan"},
- brothersArea =
- {
- fromPos = {x = 10498, y = 10340, z = 13},
- toPos = {x = 10512, y = 10350, z = 13}
- }
- }
- local tempo = 5 --seconds(3 minutes)
- function onKill(cid, target, lastHit)
- if(monsters[getCreatureName(target)]) then
- local t = monsters[getCreatureName(target)]
- doCreateTeleport(1387, t.toPos, t.teleportPos)
- doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
- doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
- addEvent(doRemoveTeleport, tempo * 1000, t.teleportPos)
- elseif(brothers[getCreatureName(target)]) then
- t = brothers[getCreatureName(target)]
- local brother = getCreatureByName(t.brother)
- if(isMonster(brother) == true) then
- if(isInRange(getCreaturePosition(brother), brothers.brothersArea.fromPos, brothers.brothersArea.toPos) == true) then
- return true
- else
- doCreateTeleport(1387, t.toPos, t.teleportPos)
- doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
- doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
- addEvent(doRemoveTeleport, tempo * 1000, t.teleportPos)
- end
- end
- end
- return true
- end
- function doRemoveTeleport(position)
- if(getTileThingByPos(position).itemid > 0) then
- doRemoveItem(getTileThingByPos(position).uid)
- doSendMagicEffect(position, CONST_ME_POFF)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement