Advertisement
GiovaniRodrigo

inq

Jul 21st, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.47 KB | None | 0 0
  1. local monsters =
  2. {
  3.     ["Ushuriel"] = {teleportPos = {x = 33160, y = 31728, z = 11, stackpos = 1}, toPos = {x = 33069, y = 31783, z = 13}},
  4.     ["Zugurosh"] = {teleportPos = {x = 33127, y = 31692, z = 11, stackpos = 1}, toPos = {x = 33371, y = 31613, z = 14}},
  5.     ["Madareth"] = {teleportPos = {x = 33197, y = 31765, z = 11, stackpos = 1}, toPos = {x = 33153, y = 31781, z = 12}},
  6.     ["Annihilon"] = {teleportPos = {x = 33197, y = 31701, z = 11, stackpos = 1}, toPos = {x = 33199, y = 31686, z = 12}},
  7.     ["Hellgorak"] = {teleportPos = {x = 33104, y = 31732, z = 11, stackpos = 1}, toPos = {x = 33111, y = 31682, z = 12}}
  8. }
  9.  
  10. local brothers =
  11. {
  12.     ["Golgordan"] = {teleportPos = {x = 33232, y = 31732, z = 11}, toPos = {x = 33038, y = 31753, z = 15}, brother = "Latrivan"},
  13.     ["Latrivan"] = {teleportPos = {x = 33232, y = 31732, z = 11}, toPos = {x = 33038, y = 31753, z = 15}, brother = "Golgordan"},
  14.  
  15.     brothersArea =
  16.     {
  17.         fromPos = {x = 33233, y = 31721, z = 11},
  18.         toPos = {x = 33241, y = 31735, z = 11}
  19.     }
  20. }
  21. local tempo = 5 --seconds(3 minutes)
  22.  
  23. function onKill(cid, target, lastHit)
  24.     if(monsters[getCreatureName(target)]) then
  25.         local t = monsters[getCreatureName(target)]
  26.         doCreateTeleport(1387, t.toPos, t.teleportPos)
  27.         doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
  28.         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))
  29.         addEvent(doRemoveTeleport, tempo * 1000, t.teleportPos)
  30.     elseif(brothers[getCreatureName(target)]) then
  31.         t = brothers[getCreatureName(target)]
  32.         local brother = getCreatureByName(t.brother)
  33.         if(isMonster(brother) == true) then
  34.             if(isInRange(getCreaturePosition(brother), brothers.brothersArea.fromPos, brothers.brothersArea.toPos) == true) then
  35.                 return true
  36.             else
  37.                 doCreateTeleport(1387, t.toPos, t.teleportPos)
  38.                 doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
  39.                 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))
  40.                 addEvent(doRemoveTeleport, tempo * 1000, t.teleportPos)
  41.             end
  42.         end
  43.     end
  44.     return true
  45. end
  46.  
  47. function doRemoveTeleport(position)
  48.     if(getTileThingByPos(position).itemid > 0) then
  49.         doRemoveItem(getTileThingByPos(position).uid)
  50.         doSendMagicEffect(position, CONST_ME_POFF)
  51.     end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement