Advertisement
Guest User

lua teleporter

a guest
Mar 6th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.47 KB | None | 0 0
  1. -- Variables
  2. local NPC_ID = 90001
  3.  
  4. -- Triggers for Teleporter
  5. function GossipMenu(pUnit, event, pPlayer)
  6.     pUnit:GossipCreateMenu(100, pPlayer, 0)
  7.     pUnit:GossipMenuAddItem(2, "|cFF0000FFAlliance Cities", 101, 0)
  8.     pUnit:GossipMenuAddItem(2, "|cFFFF0000Horde Cities", 102, 0)
  9.     pUnit:GossipMenuAddItem(2, "|cFFFFFF00Neutral Cities", 103, 0)
  10.     pUnit:GossipMenuAddItem(9, "Instances", 104, 0)
  11.     pUnit:GossipMenuAddItem(9, "Raids", 105, 0)
  12.     pUnit:GossipMenuAddItem(9, "Arena and Battlegrounds", 106, 0)
  13.     pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  14.     pUnit:GossipSendMenu(pPlayer)
  15. end
  16.  
  17. -- Submenus
  18.  
  19. function GossipSubmenu(pUnit, event, pPlayer, id, intid, code)
  20.     if (intid == 101) then
  21.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  22.         pUnit:GossipMenuAddItem(2, "Stormwind", 201, 0)
  23.         pUnit:GossipMenuAddItem(2, "IronForge", 202, 0)
  24.         pUnit:GossipMenuAddItem(2, "Darnassus", 203, 0)
  25.         pUnit:GossipMenuAddItem(2, "The Exodar", 204, 0)
  26.         pUnit:GossipMenuAddItem(7, "Never mind", 998, 0) -- Pointing to secondary "main" menu (intid 998)
  27.         pUnit:GossipSendMenu(pPlayer)
  28.     end
  29.     if (intid == 102) then
  30.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  31.         pUnit:GossipMenuAddItem(2, "Undercity", 301, 0)
  32.         pUnit:GossipMenuAddItem(2, "Orgrimmar", 302, 0)
  33.         pUnit:GossipMenuAddItem(2, "Silvermoon", 303, 0)
  34.         pUnit:GossipMenuAddItem(2, "Thunder Bluff", 304, 0)
  35.         pUnit:GossipMenuAddItem(7, "Never mind", 998, 0) -- Pointing to secondary "main" menu (intid 998)
  36.         pUnit:GossipSendMenu(pPlayer)
  37.     end
  38.     if (intid == 103) then
  39.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  40.         pUnit:GossipMenuAddItem(2, "Dalaran", 401, 0)
  41.         pUnit:GossipMenuAddItem(2, "Shattrath", 402, 0)
  42.         pUnit:GossipMenuAddItem(7, "Never mind", 998, 0) -- Pointing to secondary "main" menu (intid 998)
  43.         pUnit:GossipSendMenu(pPlayer)
  44.     end
  45.     if (intid == 104) then
  46.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  47.         pUnit:GossipMenuAddItem(9, "Instances Level 11-40", 501, 0)
  48.         pUnit:GossipMenuAddItem(9, "Instances Level 41-70", 502, 0)
  49.         pUnit:GossipMenuAddItem(9, "Instances Level 71-80", 503, 0)
  50.         pUnit:GossipMenuAddItem(7, "Never mind", 998, 0) -- Pointing to secondary "main" menu (intid 998)
  51.         pUnit:GossipSendMenu(pPlayer)
  52.     end
  53.     if (intid == 105) then
  54.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  55.         pUnit:GossipMenuAddItem(9, "Vanilla Raids", 601, 0)
  56.         pUnit:GossipMenuAddItem(9, "The Burning Crusade Raids", 602, 0)
  57.         pUnit:GossipMenuAddItem(9, "Wrath of the Lich King Raids", 603, 0)
  58.         pUnit:GossipMenuAddItem(7, "Never mind", 998, 0) -- Pointing to secondary "main" menu (intid 998)
  59.         pUnit:GossipSendMenu(pPlayer)
  60.     end
  61.     if (intid == 106) then
  62.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  63.         pUnit:GossipSendMenu(pPlayer)
  64.     end
  65.  
  66. -- SubSubmenus
  67.  
  68. -- Instance subsubmenu
  69.  
  70.     if (intid == 501) then
  71.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  72.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(13-16) Ragefire Chasm", 5001, 0)
  73.         pUnit:GossipMenuAddItem(9, "|cFF0000FF(17-20) Deadmines", 5002, 0)
  74.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(17-20) Wailing Caverns", 5003, 0)
  75.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(18-21) Shadowfang Keep", 5004, 0)
  76.         pUnit:GossipMenuAddItem(9, "(21-24) Blackfathom Deeps", 5005, 0)
  77.         pUnit:GossipMenuAddItem(9, "|cFF0000FF(22-25) The Stockade", 5006, 0)
  78.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(24-27) Razorfen Kraul", 5007, 0)
  79.         pUnit:GossipMenuAddItem(9, "|cFF0000FF(25-28) Gnomeragan", 5008, 0)
  80.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(29-35) Scarlet Monastery", 5009, 0)
  81.         pUnit:GossipMenuAddItem(9, "|cFFFF0000(34-37) Razorfen Downs", 5010, 0)
  82.         pUnit:GossipMenuAddItem(9, "(37-40) Uldaman", 5011, 0)
  83.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  84.         pUnit:GossipSendMenu(pPlayer)
  85.     end
  86.     if (intid == 502) then
  87.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  88.         pUnit:GossipMenuAddItem(9, "(43-46) Zul'Farrak", 5012, 0)
  89.         pUnit:GossipMenuAddItem(9, "(45-48) Maraudon", 5013, 0)
  90.         pUnit:GossipMenuAddItem(9, "(47-50) Sunken Temple", 5014, 0)
  91.         pUnit:GossipMenuAddItem(9, "(53-56) Blackrock Mountain", 5015, 0)
  92.         pUnit:GossipMenuAddItem(9, "(55-65) Dire Maul", 5016, 0)
  93.         pUnit:GossipMenuAddItem(9, "(55-65) Stratholme", 5017, 0)
  94.         pUnit:GossipMenuAddItem(9, "(55-65) Scholomance", 5018, 0)
  95.         pUnit:GossipMenuAddItem(9, "(59-75) Hellfire Citadel", 5019, 0)
  96.         pUnit:GossipMenuAddItem(9, "(62-75) Coilfang Reservoir", 5020, 0)
  97.         pUnit:GossipMenuAddItem(9, "(64-75) Auchindoun", 5021, 0)
  98.         pUnit:GossipMenuAddItem(9, "(66-75) Caverns of Time", 5022, 0)
  99.         pUnit:GossipMenuAddItem(9, "(67-75) Temperst Keep", 5023, 0)
  100.         pUnit:GossipMenuAddItem(9, "(68-75) Magisters' Terrace", 5024, 0)
  101.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  102.         pUnit:GossipSendMenu(pPlayer)
  103.     end
  104.     if (intid == 503) then
  105.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  106.         pUnit:GossipMenuAddItem(9, "(69-80) Utgarde", 5025, 0)
  107.         pUnit:GossipMenuAddItem(9, "(71-80) The Nexus", 5026, 0)
  108.         pUnit:GossipMenuAddItem(9, "(72-75) Azjol-Nerub", 5027, 0)
  109.         pUnit:GossipMenuAddItem(9, "(74-76) Drak'Tharon Keep", 5028, 0)
  110.         pUnit:GossipMenuAddItem(9, "(75-77) The Violet Hold", 5029, 0)
  111.         pUnit:GossipMenuAddItem(9, "(76-78) Gundrak", 5030, 0)
  112.         pUnit:GossipMenuAddItem(9, "(77-80) Ulduar", 5031, 0)
  113.         pUnit:GossipMenuAddItem(9, "(79-80) Icecrown: The Frozen Halls", 5032, 0)
  114.         pUnit:GossipMenuAddItem(9, "(79-80) Trial of the Champion", 5033, 0)
  115.         pUnit:GossipMenuAddItem(9, "(79-80) The Culling of Stratholme", 5034, 0)
  116.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  117.         pUnit:GossipSendMenu(pPlayer)
  118.     end
  119.    
  120. -- Raids subsubmenu
  121.    
  122.     if (intid == 601) then
  123.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  124.         pUnit:GossipMenuAddItem(9, "Blackwing Lair", 6001, 0)
  125.         pUnit:GossipMenuAddItem(9, "Molten Core", 6002, 0)
  126.         pUnit:GossipMenuAddItem(9, "Ahn'Qiraj", 6003, 0)
  127.         pUnit:GossipMenuAddItem(9, "Zul'Gurub", 6004, 0)
  128.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  129.         pUnit:GossipSendMenu(pPlayer)
  130.     end
  131.     if (intid == 602) then
  132.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  133.         pUnit:GossipMenuAddItem(9, "Black Temple", 6005, 0)
  134.         pUnit:GossipMenuAddItem(9, "Caverns of Time: Hyjal Summit", 6006, 0)
  135.         pUnit:GossipMenuAddItem(9, "Coilfang Reservoir: Serpentshrine Cavern", 6007, 0)
  136.         pUnit:GossipMenuAddItem(9, "Gruul's Lair", 6008, 0)
  137.         pUnit:GossipMenuAddItem(9, "Hellfire Citadel: Magtheridon's Lair", 6009, 0)
  138.         pUnit:GossipMenuAddItem(9, "Karazhan", 6010, 0)
  139.         pUnit:GossipMenuAddItem(9, "Sunwell Plateau", 6011, 0)
  140.         pUnit:GossipMenuAddItem(9, "Tempest Keep: The Eye", 6012, 0)
  141.         pUnit:GossipMenuAddItem(9, "Zul'Aman", 6013, 0)
  142.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  143.         pUnit:GossipSendMenu(pPlayer)
  144.     end
  145.     if (intid == 603) then
  146.         pUnit:GossipCreateMenu(99, pPlayer, 0)
  147.         pUnit:GossipMenuAddItem(9, "Ruby Sanctum", 6014, 0)
  148.         pUnit:GossipMenuAddItem(9, "Icecrown Citadel", 6015, 0)
  149.         pUnit:GossipMenuAddItem(9, "Onyxia's Lair", 6016, 0)
  150.         pUnit:GossipMenuAddItem(9, "Trial of the Crusader", 6017, 0)
  151.         pUnit:GossipMenuAddItem(9, "Vault of Archavon", 6018, 0)
  152.         pUnit:GossipMenuAddItem(9, "Ulduar", 6019, 0)
  153.         pUnit:GossipMenuAddItem(9, "Eye of Eternity", 6020, 0)
  154.         pUnit:GossipMenuAddItem(9, "Obsidian Sanctum", 6021, 0)
  155.         pUnit:GossipMenuAddItem(9, "Naxxramas", 6022, 0)
  156.         pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  157.         pUnit:GossipSendMenu(pPlayer)
  158.     end
  159.        
  160. -- Alliance Cities Submenu
  161.  
  162. if (intid == 201) then
  163.     pPlayer:Teleport(0, -9097.097656, 410.506897, 92.346672, 0.636173)
  164. end
  165. if (intid == 202) then
  166.     pPlayer:Teleport(0, -5025.391602, -828.789307, 495.314972, 5.332860)
  167. end
  168. if (intid == 203) then
  169.     pPlayer:Teleport(1, 9953.144531, 2242.597412, 1333.742676, 1.661118)
  170. end
  171. if (intid == 204) then
  172.     pPlayer:Teleport(530, -3993.284424, -11857.405273, 0.294113, 1.036726)
  173. end
  174.  
  175. -- Horde Cities Submenu
  176.  
  177. if (intid == 301) then
  178.     pPlayer:Teleport(0, 1830.857000, 238.410660, 60.552223, 3.129816)
  179. end
  180. if (intid == 302) then
  181.     pPlayer:Teleport(1, 1369.838501, -4373.277932, 26.054956, 0.118578)
  182. end
  183. if (intid == 303) then
  184.     pPlayer:Teleport(530, 9339.971680, -7277.881836, 13.959989, 6.276899)
  185. end
  186. if (intid == 304) then
  187.     pPlayer:Teleport(1, -1286.187500, 146.413681, 129.646484, 5.030490)
  188. end
  189.  
  190. -- Neutral Cities Submenu
  191.  
  192. if (intid == 401) then
  193.     pPlayer:Teleport(571, 5815.270020, 473.489990, 658.796021, 4.660030)
  194. end
  195. if (intid == 402) then
  196.     pPlayer:Teleport(530, -1527.330444, 5318.916016, 8.916401, 2.890269)
  197. end
  198.  
  199. -- Instances Submenu
  200.  
  201. if (intid == 5001) then
  202.     pPlayer:Teleport(m, x, y, z, o)
  203. end
  204. if (intid == 5002) then
  205.     pPlayer:Teleport(m, x, y, z, o)
  206. end
  207. if (intid == 5003) then
  208.     pPlayer:Teleport(m, x, y, z, o)
  209. end
  210. if (intid == 5004) then
  211.     pPlayer:Teleport(m, x, y, z, o)
  212. end
  213. if (intid == 5005) then
  214.     pPlayer:Teleport(m, x, y, z, o)
  215. end
  216. if (intid == 5006) then
  217.     pPlayer:Teleport(m, x, y, z, o)
  218. end
  219. if (intid == 5007) then
  220.     pPlayer:Teleport(m, x, y, z, o)
  221. end
  222. if (intid == 5008) then
  223.     pPlayer:Teleport(m, x, y, z, o)
  224. end
  225. if (intid == 5009) then
  226.     pPlayer:Teleport(m, x, y, z, o)
  227. end
  228. if (intid == 5010) then
  229.     pPlayer:Teleport(m, x, y, z, o)
  230. end
  231. if (intid == 5011) then
  232.     pPlayer:Teleport(m, x, y, z, o)
  233. end
  234. if (intid == 5012) then
  235.     pPlayer:Teleport(m, x, y, z, o)
  236. end
  237. if (intid == 5013) then
  238.     pPlayer:Teleport(m, x, y, z, o)
  239. end
  240. if (intid == 5014) then
  241.     pPlayer:Teleport(m, x, y, z, o)
  242. end
  243. if (intid == 5015) then
  244.     pPlayer:Teleport(m, x, y, z, o)
  245. end
  246. if (intid == 5016) then
  247.     pPlayer:Teleport(m, x, y, z, o)
  248. end
  249. if (intid == 5017) then
  250.     pPlayer:Teleport(m, x, y, z, o)
  251. end
  252. if (intid == 5018) then
  253.     pPlayer:Teleport(m, x, y, z, o)
  254. end
  255. if (intid == 5020) then
  256.     pPlayer:Teleport(m, x, y, z, o)
  257. end
  258. if (intid == 5021) then
  259.     pPlayer:Teleport(m, x, y, z, o)
  260. end
  261. if (intid == 5022) then
  262.     pPlayer:Teleport(m, x, y, z, o)
  263. end
  264. if (intid == 5023) then
  265.     pPlayer:Teleport(m, x, y, z, o)
  266. end
  267. if (intid == 5024) then
  268.     pPlayer:Teleport(m, x, y, z, o)
  269. end
  270. if (intid == 5025) then
  271.     pPlayer:Teleport(m, x, y, z, o)
  272. end
  273. if (intid == 5026) then
  274.     pPlayer:Teleport(m, x, y, z, o)
  275. end
  276. if (intid == 5027) then
  277.     pPlayer:Teleport(m, x, y, z, o)
  278. end
  279. if (intid == 5028) then
  280.     pPlayer:Teleport(m, x, y, z, o)
  281. end
  282. if (intid == 5029) then
  283.     pPlayer:Teleport(m, x, y, z, o)
  284. end
  285. if (intid == 5030) then
  286.     pPlayer:Teleport(m, x, y, z, o)
  287. end
  288. if (intid == 5031) then
  289.     pPlayer:Teleport(m, x, y, z, o)
  290. end
  291. if (intid == 5032) then
  292.     pPlayer:Teleport(m, x, y, z, o)
  293. end
  294. if (intid == 5033) then
  295.     pPlayer:Teleport(m, x, y, z, o)
  296. end
  297. if (intid == 5034) then
  298.     pPlayer:Teleport(m, x, y, z, o)
  299. end
  300.  
  301. -- Raids Submenu
  302.  
  303. if (intid == 6001) then
  304.     pPlayer:Teleport(m, x, y, z, o)
  305. end
  306. if (intid == 6002) then
  307.     pPlayer:Teleport(m, x, y, z, o)
  308. end
  309. if (intid == 6003) then
  310.     pPlayer:Teleport(m, x, y, z, o)
  311. end
  312. if (intid == 6004) then
  313.     pPlayer:Teleport(m, x, y, z, o)
  314. end
  315. if (intid == 6005) then
  316.     pPlayer:Teleport(m, x, y, z, o)
  317. end
  318. if (intid == 6006) then
  319.     pPlayer:Teleport(m, x, y, z, o)
  320. end
  321. if (intid == 6007) then
  322.     pPlayer:Teleport(m, x, y, z, o)
  323. end
  324. if (intid == 6008) then
  325.     pPlayer:Teleport(m, x, y, z, o)
  326. end
  327. if (intid == 6009) then
  328.     pPlayer:Teleport(m, x, y, z, o)
  329. end
  330. if (intid == 6010) then
  331.     pPlayer:Teleport(m, x, y, z, o)
  332. end
  333. if (intid == 6011) then
  334.     pPlayer:Teleport(m, x, y, z, o)
  335. end
  336. if (intid == 6012) then
  337.     pPlayer:Teleport(m, x, y, z, o)
  338. end
  339. if (intid == 6013) then
  340.     pPlayer:Teleport(m, x, y, z, o)
  341. end
  342. if (intid == 6014) then
  343.     pPlayer:Teleport(m, x, y, z, o)
  344. end
  345. if (intid == 6015) then
  346.     pPlayer:Teleport(m, x, y, z, o)
  347. end
  348. if (intid == 6016) then
  349.     pPlayer:Teleport(m, x, y, z, o)
  350. end
  351. if (intid == 6017) then
  352.     pPlayer:Teleport(m, x, y, z, o)
  353. end
  354. if (intid == 6018) then
  355.     pPlayer:Teleport(m, x, y, z, o)
  356. end
  357. if (intid == 6019) then
  358.     pPlayer:Teleport(m, x, y, z, o)
  359. end
  360. if (intid == 6020) then
  361.     pPlayer:Teleport(m, x, y, z, o)
  362. end
  363. if (intid == 6021) then
  364.     pPlayer:Teleport(m, x, y, z, o)
  365. end
  366. if (intid == 6022) then
  367.     pPlayer:Teleport(m, x, y, z, o)
  368. end
  369.  
  370.  
  371. if(intid == 998)then -- main menu 2 (needed since we can't get back to the "GossipMenu" function from "GossipSubmenu" function)
  372.     pUnit:GossipCreateMenu(100, pPlayer, 0)
  373.     pUnit:GossipMenuAddItem(2, "|cFF0000FFAlliance Cities", 101, 0)
  374.     pUnit:GossipMenuAddItem(2, "|cFFFF0000Horde Cities", 102, 0)
  375.     pUnit:GossipMenuAddItem(2, "|cFFFFFF00Neutral Cities", 103, 0)
  376.     pUnit:GossipMenuAddItem(9, "Instances", 104, 0)
  377.     pUnit:GossipMenuAddItem(9, "Raids", 105, 0)
  378.     pUnit:GossipMenuAddItem(9, "Arena and Battlegrounds", 106, 0)
  379.     pUnit:GossipMenuAddItem(7, "Never mind", 999, 0)
  380.     pUnit:GossipSendMenu(pPlayer)
  381. end
  382.  
  383.  
  384. if (intid == 999) then
  385.     pPlayer:GossipComplete()
  386. end
  387. end
  388.  
  389. -- RegisterUnitEvents
  390.  
  391. RegisterUnitGossipEvent(90001, 1, "GossipMenu")
  392. RegisterUnitGossipEvent(90001, 2, "GossipSubmenu")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement