Guest User

Global Lua teleporter (Already modified)

a guest
Mar 16th, 2015
1,446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. --[[ How to add new locations!
  2.  
  3. Example:
  4.  
  5. The first line will be the main menu ID (Here [1],
  6. increment this for each main menu option!),
  7. the main menu gossip title (Here "Horde Cities"),
  8. as well as which faction can use the said menu (Here 1 (Horde)).
  9. 0 = Alliance, 1 = Horde, 2 = Both
  10.  
  11. The second line is the name of the main menu's sub menus,
  12. separated by name (Here "Orgrimmar") and teleport coordinates
  13. using Map, X, Y, Z, O (Here 1, 1503, -4415.5, 22, 0)
  14.  
  15. [1] = { "Horde Cities", 1, --
  16. {"Orgrimmar", 1, 1503, -4415.5, 22, 0},
  17. },
  18.  
  19. You can copy paste the above into the script and change the values as informed.
  20. ]]
  21.  
  22.  
  23. local UnitEntry = 190005
  24.  
  25. local T = {
  26. [1] = { "|TInterface\\icons\\achievement_bg_winwsg:35|t Horde Cities", 1,
  27. {"|TInterface\\icons\\achievement_zone_durotar:35|t Orgrimmar", 1, 1503, -4415.5, 22, 0},
  28. {"|TInterface\\icons\\achievement_zone_tirisfalglades_01:35|t Undercity", 0, 1831, 238.5, 61.6, 0},
  29. {"|TInterface\\icons\\achievement_zone_mulgore_01:35|t Thunderbluff", 1, -1278, 122, 132, 0},
  30. {"|TInterface\\icons\\achievement_zone_bloodmystisle_01:35|t Silvermoon", 530, 9484, -7294, 15, 0},
  31. },
  32. [2] = { "|TInterface\\icons\\achievement_pvp_a_a:35|t Alliance Cities", 0,
  33. {"|TInterface\\icons\\achievement_zone_elwynnforest:35|t Stormwind", 0, -8905, 560, 94, 0.62},
  34. {"|TInterface\\icons\\achievement_zone_dunmorogh:35|t Ironforge", 0, -4795, -1117, 499, 0},
  35. {"|TInterface\\icons\\achievement_zone_ashenvale_01:35|t Darnassus", 1, 9952, 2280.5, 1342, 1.6},
  36. {"|TInterface\\icons\\achievement_zone_zangarmarsh:35|t The Exodar", 530, -3863, -11736, -106, 2},
  37. },
  38. [3] = { "|TInterface\\icons\\achievement_bg_winwsg:35|t PvP Locations", 2,
  39. {"|TInterface\\icons\\inv_wand_22:35|t Gurubashi Arena", 0, -13233.189453, 219.459229, 31.936506, 1.0},
  40. },
  41. [4] = { "|TInterface\\icons\\ability_mount_drake_blue:35|t Neutral Cities", 2,
  42. {"|TInterface\\icons\\achievement_reputation_kirintor:35|t Dalaran", 571, 5807.794922, 588.387268, 660.937134, 1.6},
  43. {"|TInterface\\icons\\achievement_reputation_wyrmresttemple:35|t Shattrath", 530, -1806.164307, 5323.119141, -12.428000, 2.1},
  44. },
  45. [5] = { "|TInterface\\icons\\inv_shield_48:35|t Transmogrification", 2,
  46. {"|TInterface\\icons\\inv_shield_48:35|t Transmogrification", 571, 5848.136230, 853.395081, 843.217224, 4.8},
  47.  
  48. },
  49. };
  50.  
  51.  
  52. --[[ CODE STUFFS! DO NOT EDIT BELOW ]]--
  53. --[[ UNLESS YOU KNOW WHAT YOU'RE DOING! ]]--
  54.  
  55. function Teleporter_Gossip(event, player, unit)
  56. if (#T <= 10) then
  57. for i, v in ipairs(T) do
  58. if(v[2] == 2 or v[2] == player:GetTeam()) then
  59. player:GossipMenuAddItem(0, v[1], 0, i)
  60. end
  61. end
  62. player:GossipSendMenu(1, unit)
  63. else
  64. print("This teleporter only supports 10 different menus.")
  65. end
  66. end
  67.  
  68. function Teleporter_Event(event, player, unit, sender, intid, code)
  69. if(intid == 0) then
  70. Teleporter_Gossip(event, player, unit)
  71. elseif(intid <= 10) then
  72. for i, v in ipairs(T[intid]) do
  73. if (i > 2) then
  74. player:GossipMenuAddItem(0, v[1], 0, intid..i)
  75. end
  76. end
  77. player:GossipMenuAddItem(0, "Back", 0, 0)
  78. player:GossipSendMenu(1, unit)
  79. elseif(intid > 10) then
  80. for i = 1, #T do
  81. for j, v in ipairs(T[i]) do
  82. if(intid == tonumber(i..j)) then
  83. player:GossipComplete()
  84. player:Teleport(v[2], v[3], v[4], v[5], v[6])
  85. end
  86. end
  87. end
  88. end
  89. end
  90.  
  91. RegisterCreatureGossipEvent(UnitEntry, 1, Teleporter_Gossip)
  92. RegisterCreatureGossipEvent(UnitEntry, 2, Teleporter_Event)
Advertisement
Add Comment
Please, Sign In to add comment