Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monsters =
- {
- ["Ushuriel"] = {teleportPos = {x = 33160, y = 31728, z = 11, stackpos = 1}, toPos = {x = 33069, y = 31783, z = 13}},
- ["Zugurosh"] = {teleportPos = {x = 33127, y = 31692, z = 11, stackpos = 1}, toPos = {x = 33371, y = 31613, z = 14}},
- ["Madareth"] = {teleportPos = {x = 33197, y = 31765, z = 11, stackpos = 1}, toPos = {x = 33153, y = 31781, z = 12}},
- ["Annihilon"] = {teleportPos = {x = 33197, y = 31701, z = 11, stackpos = 1}, toPos = {x = 33199, y = 31686, z = 12}},
- ["Hellgorak"] = {teleportPos = {x = 33104, y = 31732, z = 11, stackpos = 1}, toPos = {x = 33111, y = 31682, z = 12}}
- }
- local brothers =
- {
- ["Golgordan"] = {teleportPos = {x = 33232, y = 31732, z = 11}, toPos = {x = 33038, y = 31753, z = 15}, brother = "Latrivan"},
- ["Latrivan"] = {teleportPos = {x = 33232, y = 31732, z = 11}, toPos = {x = 33038, y = 31753, z = 15}, brother = "Golgordan"},
- brothersArea =
- {
- fromPos = {x = 33233, y = 31721, z = 11},
- toPos = {x = 33241, y = 31735, z = 11}
- }
- }
- 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