Advertisement
Kaiquegabriel

Untitled

Jul 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. local monsters =
  2. {
  3. ["Ushuriel"] = {teleportPos = {x = 10249, y = 10350, z = 12, stackpos = 1}, toPos = {x = 10173, y = 10560, z = 13}},
  4. ["Zugurosh"] = {teleportPos = {x = 10392, y = 10523, z = 13, stackpos = 1}, toPos = {x = 10313, y = 10472, z = 13}},
  5. ["Madareth"] = {teleportPos = {x = 10343, y = 10458, z = 13, stackpos = 1}, toPos = {x = 10288, y = 10364, z = 13}},
  6. ["Annihilon"] = {teleportPos = {x = 10637, y = 10465, z = 13, stackpos = 1}, toPos = {x = 10294, y = 10678, z = 13}},
  7. ["Hellgorak"] = {teleportPos = {x = 33105, y = 31735, z = 11, stackpos = 1}, toPos = {x = 33105, y = 31734, z = 11}}
  8. }
  9.  
  10. local brothers =
  11. {
  12. ["Golgordan"] = {teleportPos = {x = 10510, y = 10344, z = 13}, toPos = {x = 10408, y = 10414, z = 13}, brother = "Latrivan"},
  13. ["Latrivan"] = {teleportPos = {x = 10510, y = 10344, z = 13}, toPos = {x = 10408, y = 10414, z = 13}, brother = "Golgordan"},
  14.  
  15. brothersArea =
  16. {
  17. fromPos = {x = 10498, y = 10340, z = 13},
  18. toPos = {x = 10512, y = 10350, z = 13}
  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