kusanagy

NPC Teleport Lua

Sep 25th, 2017
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.64 KB | None | 0 0
  1. local NpcEntry = 60200
  2.  
  3. function Npc_Teleport(event, player, unit)
  4.             if (player:IsInCombat() == true) then
  5.                     player:SendAreaTriggerMessage("U can't use this while u are in combat!")
  6.             else
  7.                     Npc_Menu(unit, player)
  8.             end
  9.     end
  10.      
  11.  
  12.  
  13. function Npc_Menu(unit, player) -- Home Page
  14. local plyr = player:GetRace()
  15. if (plyr == 1) or (plyr == 3) or (plyr == 4) or (plyr == 7) or (plyr == 11) then
  16.  player:GossipMenuAddItem(8, " [City] |CFF3366FF Alliance Cities", 0, 3)
  17. end
  18. if (plyr == 2) or (plyr == 5) or (plyr == 6) or (plyr == 8) or (plyr == 10) then --darkportal ----5567
  19. player:GossipMenuAddItem(8, " [City] |CFFCC0000 Horde Cities", 0, 2)
  20. end
  21.  
  22. player:GossipMenuAddItem(8, " Mall [Dalaran]", 0, 348)
  23. player:GossipMenuAddItem(8, " Mall [Shattrath]", 0, 342)
  24. player:GossipMenuAddItem(2, " Outland Dungeons", 0, 4)
  25. player:GossipMenuAddItem(2, " Outland Raids", 0, 5)
  26. player:GossipMenuAddItem(2, " Azeroth Dungeons", 0, 6)
  27. player:GossipMenuAddItem(2, " [Raid] Azeroth Raids", 0, 7)
  28. player:GossipMenuAddItem(9, " |CFFAB062C[PVP]|r Areas", 0, 8)
  29. player:GossipMenuAddItem(5, " [Tools] |CFF06ABA9 Heal me!", 0, 994)
  30. player:GossipMenuAddItem(4, " [Tools] |CFF06ABA9 Buff Me!", 0, 995)
  31. player:GossipMenuAddItem(4, " |CFFAB062CRemove Sickness!", 0, 996)
  32. player:GossipSendMenu(1, unit)
  33. end
  34.  
  35. function Teleporter_Events(event, player, unit, sender, intid, code)
  36. if(intid == 990) then
  37. local plyr = player:GetRace()
  38. if (plyr == 1) or (plyr == 3) or (plyr == 4) or (plyr == 7) or (plyr == 11) then
  39.  player:GossipMenuAddItem(8, " [City] |CFF3366FF Alliance Cities", 0, 3)
  40. end
  41. if (plyr == 2) or (plyr == 5) or (plyr == 6) or (plyr == 8) or (plyr == 10) then --darkportal ----5567
  42. player:GossipMenuAddItem(8, " [City] |CFFCC0000 Horde Cities", 0, 2)
  43. end
  44.  
  45. player:GossipMenuAddItem(8, " Mall [Dalaran]", 0, 348)
  46. player:GossipMenuAddItem(8, " Mall [Shattrath]", 0, 342)
  47. player:GossipMenuAddItem(2, " Outland Dungeons", 0, 4)
  48. player:GossipMenuAddItem(2, " Outland Raids", 0, 5)
  49. player:GossipMenuAddItem(2, " Azeroth Dungeons", 0, 6)
  50. player:GossipMenuAddItem(2, " [Raid] Azeroth Raids", 0, 7)
  51. player:GossipMenuAddItem(9, " |CFFAB062C[PVP]|r Areas", 0, 8)
  52. player:GossipMenuAddItem(5, " [Tools] |CFF06ABA9 Heal me!", 0, 994)
  53. player:GossipMenuAddItem(4, " [Tools] |CFF06ABA9 Buff Me!", 0, 995)
  54. player:GossipMenuAddItem(4, " |CFFAB062CRemove Sickness!", 0, 996)
  55. player:GossipSendMenu(1, unit)
  56. end
  57.  
  58. if(intid == 2) then
  59. player:GossipClearMenu()
  60. player:GossipMenuAddItem(8, "|CFFCC0000 Orgrimmar", 0, 300)
  61. player:GossipMenuAddItem(8, "|CFFCC0000 Undercity", 0, 301)
  62. player:GossipMenuAddItem(8, "|CFFCC0000 Thunder Bluff", 0, 302)
  63. player:GossipMenuAddItem(8, "|CFFCC0000 Silvermoon City", 0, 303)
  64. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  65. player:GossipSendMenu(1, unit)
  66. end
  67.  
  68. if(intid == 3) then
  69. player:GossipClearMenu()
  70. player:GossipMenuAddItem(8, "|CFF3366FF Stormwind", 0, 304)
  71. player:GossipMenuAddItem(8, "|CFF3366FF Ironforge", 0, 305)
  72. player:GossipMenuAddItem(8, "|CFF3366FF Darnassus", 0, 306)
  73. player:GossipMenuAddItem(8, "|CFF3366FF The Exodar", 0, 307)
  74. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  75. player:GossipSendMenu(1, unit)
  76. end
  77.  
  78. if(intid == 4) then
  79. player:GossipClearMenu()
  80. player:GossipMenuAddItem(2, " Hellfire Ramparts", 0, 308)
  81. player:GossipMenuAddItem(2, " Blood Furnace", 0, 309)
  82. player:GossipMenuAddItem(2, " Shattered Halls", 0, 310)
  83. player:GossipMenuAddItem(2, " Underbog", 0, 311)
  84. player:GossipMenuAddItem(2, " Slave Pens", 0, 312)
  85. player:GossipMenuAddItem(2, " Mana Tombs", 0, 313)
  86. player:GossipMenuAddItem(2, " Sethekk Halls", 0, 314)
  87. player:GossipMenuAddItem(2, " Shadow Labyrinth", 0, 315)
  88. player:GossipMenuAddItem(2, " The Mechanar", 0, 316)
  89. player:GossipMenuAddItem(2, " Arcatraz", 0, 317)
  90. player:GossipMenuAddItem(2, " Caverns of Time", 0, 318)
  91. player:GossipMenuAddItem(2, " Serpentshrine Cavern", 0, 319)
  92. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  93. player:GossipSendMenu(1, unit)
  94. end
  95.  
  96. if(intid == 5) then
  97. player:GossipClearMenu()
  98. player:GossipMenuAddItem(2, " Black Temple", 0, 330)
  99. player:GossipMenuAddItem(2, " Tempest Keep", 0, 331)
  100. player:GossipMenuAddItem(2, " Karazhan", 0, 337)
  101. player:GossipMenuAddItem(2, " Zul'Aman", 0, 341)
  102. player:GossipMenuAddItem(2, " Gruul's Lair", 0, 375)
  103. --player:GossipMenuAddItem(2, " Maghteridon's Lair", 0, 332)
  104. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  105. player:GossipSendMenu(1, unit)
  106. end
  107.  
  108. if(intid == 6) then
  109. player:GossipClearMenu()
  110. player:GossipMenuAddItem(2, " Shadowfang Keep", 0, 320)
  111. player:GossipMenuAddItem(2, " Scarlet Monastery", 0, 321)
  112. player:GossipMenuAddItem(2, " Zul'Farrak", 0, 322)
  113. player:GossipMenuAddItem(2, " Scholomance", 0, 323)
  114. player:GossipMenuAddItem(2, " The Deadmines", 0, 324)
  115. player:GossipMenuAddItem(2, " Uldaman", 0, 325)
  116. player:GossipMenuAddItem(2, " Sunken temple", 0, 326)
  117. player:GossipMenuAddItem(2, " Lower Blackrock Depths", 0, 327)
  118. player:GossipMenuAddItem(2, " Dire Maul", 0, 328)
  119. --player:GossipMenuAddItem(2, " Upper Blackrock Depths", 0, 329)
  120. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  121. player:GossipSendMenu(1, unit)
  122. end
  123.  
  124. if(intid == 7) then
  125. player:GossipClearMenu()
  126. player:GossipMenuAddItem(2, " Zul'Gurub", 0, 336)
  127. player:GossipMenuAddItem(2, " Molten Core", 0, 334)
  128. player:GossipMenuAddItem(2, " Blackwing Lair", 0, 335)
  129. player:GossipMenuAddItem(2, " Onyxia's Lair", 0, 333)
  130. player:GossipMenuAddItem(2, " Ruins of Ahn'Qiraj 340", 0, 338)
  131. player:GossipMenuAddItem(2, " Temple of Ahn'Qiraj 341", 0, 339)
  132. player:GossipMenuAddItem(2, " Naxxramas", 0, 340)
  133. player:GossipMenuAddItem(7, " [Main Menu]", 0, 990)
  134. player:GossipSendMenu(1, unit)
  135. end
  136.  
  137. if(intid == 8) then
  138. player:GossipClearMenu()
  139. player:GossipMenuAddItem(2, "|cffFF4500 Nagrand Arena", 0, 343)
  140. player:GossipMenuAddItem(2, "|cffFF4500 Gurubashi Arena", 0, 345)
  141. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  142. player:GossipSendMenu(1, unit)
  143. end
  144.  
  145.  
  146. -----Coordinates Go Below-----
  147.  
  148. if(intid == 300) then --Orgrimmar--
  149. player:Teleport(1, 1371.068970, -4370.801758, 26.052483, 0)
  150. player:GossipComplete()
  151. end
  152.  
  153. if(intid == 301) then --Undercity--
  154. player:Teleport(0, 2050.203125, 285.650604, 56.994549, 0)
  155. player:GossipComplete()
  156. end
  157.  
  158. if(intid == 302) then --Thunder Bluff--
  159. player:Teleport(1, -1304.569946, 205.285004, 68.681396, 0)
  160. player:GossipComplete()
  161. end
  162.  
  163. if(intid == 303) then --Silvermooon City--
  164. player:Teleport(530, 9400.486328, -7278.376953, 14.206780, 0)
  165. player:GossipComplete()
  166. end
  167.  
  168. -----------------------------------------------------------
  169.  
  170. if(intid == 304) then --Stormwind City--
  171. player:Teleport(0, -9165.678711,470.176544, 103.978409, 0)
  172. player:GossipComplete()
  173. end
  174.  
  175. if(intid == 305) then --Ironforge--
  176. player:Teleport(0, -4977.095215, -888.452942, 501.621216, 0)
  177. player:GossipComplete()
  178. end
  179.  
  180. if(intid == 306) then --Darnassus--
  181. player:Teleport(1, 9943.809570, 2275.350098, 1341.390015, 0)
  182. player:GossipComplete()
  183. end
  184.  
  185. if(intid == 307) then --The Exodar--
  186. player:Teleport(530, -3792.557861, -11691.3, -105.241, 0)
  187. player:GossipComplete()
  188. end
  189.  
  190. ----------------------------------------------------------
  191.  
  192. if(intid == 308) then --HellFire Ramparts--
  193. player:Teleport(530, -360.670990, 3071.899902, -15.097700, 0)
  194. player:GossipComplete()
  195. end
  196.  
  197. if(intid == 309) then --Blood Furnace--
  198. player:Teleport(530, -303.506012, 3164.820068, 31.742500, 0)
  199. player:GossipComplete()
  200. end
  201.  
  202. if(intid == 310) then --Shattered Halls--
  203. player:Teleport(530, -311.083527, 3083.291748, -3.745923, 0)
  204. player:GossipComplete()
  205. end
  206.  
  207. if(intid == 311) then --Underbog--
  208. player:Teleport(530, 777.088989, 6763.450195, -72.062561, 0)
  209. player:GossipComplete()
  210. end
  211.  
  212. if(intid == 312) then --Slave Pens--
  213. player:Teleport(530, 719.507996, 6999.339844, -73.074303, 0)
  214. player:GossipComplete()
  215. end
  216.  
  217. if(intid == 313) then --Mana-Tombs--
  218. player:Teleport(530, -3079.810059, 4943.040039, -101.046997, 0)
  219. player:GossipComplete()
  220. end
  221.  
  222. if(intid == 314) then --Setthek Halls--
  223. player:Teleport(530, -3362.219971, 4660.410156, -101.049004, 0)
  224. player:GossipComplete()
  225. end
  226.  
  227. if(intid == 315) then --Shadow Labyrinth--
  228. player:Teleport(530, -3645.060059, 4943.620117, -101.047997, 0)
  229. player:GossipComplete()
  230. end
  231.  
  232. if(intid == 316) then --The Mechanar--
  233. player:Teleport(530, 2862.409912, 1546.089966, 252.158691, 0)
  234. player:GossipComplete()
  235. end
  236.  
  237. if(intid == 317) then --Arcatraz--
  238. player:Teleport(530, 3311.598145, 1332.745117, 505.557251, 0)
  239. player:GossipComplete()
  240. end
  241.  
  242. if(intid == 318) then --Cavern of Time--
  243. player:Teleport(1, -8519.718750, -4297.542480, -208.441376, 0)
  244. player:GossipComplete()
  245. end
  246.  
  247. if(intid == 319) then --Serpentshrine Cavern--
  248. player:Teleport(530, 830.542908, 6865.445801, -63.785503, 0)
  249. player:GossipComplete()
  250. end
  251.  
  252. ----------------------------------------------------------
  253.  
  254. if(intid == 330) then --Black Temple--
  255. player:Teleport(530, -3628.623291, 314.697510, 38.257904, 0)
  256. player:GossipComplete()
  257. end
  258.  
  259. if(intid == 331) then --Tempest Keep--
  260. player:Teleport(530, 3089.057129, 1394.752197, 186.302628, 0)
  261. player:GossipComplete()
  262. end
  263.  
  264. if(intid == 332) then --Magtheridon's Lair--
  265. player:Teleport(530, -313.678986, 3088.350098, -116.501999, 0)
  266. player:GossipComplete()
  267. end
  268.  
  269. if(intid == 337) then --Karazhan--
  270. player:Teleport(0, -11124.789063, -2016.765259, 47.125431, 0)
  271. player:GossipComplete()
  272. end
  273.  
  274. if(intid == 341) then --Zul'Aman--
  275. player:Teleport(530, 6850, -7950, 170, 0)
  276. player:GossipComplete()
  277. end
  278.  
  279. if(intid == 375) then --Gruul's Lair--
  280. player:Teleport(530, 3530.207031, 5126.354492, 2.917513, 0)
  281. player:GossipComplete()
  282. end
  283.  
  284. ----------------------------------------------------------
  285.  
  286. if(intid == 333) then --Onyxia's Lair--
  287. player:Teleport(1, -4730.574219, -3743.315186, 57.275661, 3.557852)
  288. player:GossipComplete()
  289. end
  290.  
  291. if(intid == 334) then --Molten Core--
  292. player:Teleport(409, 1089.486816, -470.366241, -106.475876, 0)
  293. player:GossipComplete()
  294. end
  295.  
  296. if(intid == 335) then --Blackwing Lair--
  297. player:Teleport(469, -7665.55, -1102.49, 400.679, 0)
  298. player:GossipComplete()
  299. end
  300.  
  301. if(intid == 336) then --Zul'Gurub--
  302. player:Teleport(0, -11919.073242, -1202.459374, 92.298744, 0)
  303. player:GossipComplete()
  304. end
  305.  
  306. if(intid == 338) then --Ruins of Ahn'Qiraj
  307. player:Teleport(1, -8394.730469, 1485.658447, 21.038563, 0)
  308. player:GossipComplete()
  309. end
  310.  
  311. if(intid == 339) then --Temple of Ahn'Qiraj
  312. player:Teleport(1, -8247.316406, 1970.156860, 129.071472, 0)
  313. player:GossipComplete()
  314. end
  315.  
  316. if(intid == 340) then --Naxxramas
  317. player:Teleport(533, 3006.06, -3436.72, 293.891, 0)
  318. player:GossipComplete()
  319. end
  320.  
  321. ----------------------------------------------------------
  322.  
  323. if(intid == 320) then --Shadowfang Keep--
  324. player:Teleport(0, -234.675003, 1561.630005, 77.473145, 1.240310)
  325. player:GossipComplete()
  326. end
  327.  
  328. if(intid == 321) then --Scarlet Monastarey--
  329. player:Teleport(0, 2843.570069, -692.133972, 139.330734, 0)
  330. player:GossipComplete()
  331. end
  332.  
  333. if(intid == 322) then --Zul'Farrak--
  334. player:Teleport(1, -6801.189941, -2893.020020, 9.941879, 0.158639)
  335. player:GossipComplete()
  336. end
  337.  
  338. if(intid == 323) then --Scholomance--
  339. player:Teleport(0, 1264.672363, -2558.375000, 94.128685, 0)
  340. player:GossipComplete()
  341. end
  342.  
  343. if(intid == 324) then --The Deamines--
  344. player:Teleport(0, -11208.843750, 1667.725952, 24.624727, 0)
  345. player:GossipComplete()
  346. end
  347.  
  348. if(intid == 325) then --Uldaman--
  349. player:Teleport(0, -6085.118652, -3220.368164, 262.885529, 0)
  350. player:GossipComplete()
  351. end
  352.  
  353. if(intid == 326) then --Sunken Temple--
  354. player:Teleport(0, -10349.099609, -3849.669922, -41.240356, 0)
  355. player:GossipComplete()
  356. end
  357.  
  358. if(intid == 327) then --Lower Blackrock Spire--
  359. player:Teleport(0, -7734.138184, -1515.616333, 133.851135, 1.105376)
  360. player:GossipComplete()
  361. end
  362.  
  363. if(intid == 328) then --Dire Maul--
  364. player:Teleport(1, -3981.025391, 788.601379, 161.007019, 0)
  365. player:GossipComplete()
  366. end
  367.  
  368. if(intid == 329) then --Upper Blackrock Spire--
  369. player:Teleport(469, -766.245117, -1103.233154, 399.680328, 0)
  370. player:GossipComplete()
  371. end
  372.  
  373. ----------------------------------------------------------
  374.  
  375. if(intid == 342) then --Shattrath (Mall)--
  376. player:Teleport(530, -1877.179077, 5458.045898, -12.427818, 5.190694)
  377. player:GossipComplete()
  378. end
  379.  
  380. if(intid == 348) then --Dalaran City (Mall #2)--
  381. player:Teleport(571, 5821.965820, 642.128479, 648.014038, 3.224844)
  382. player:GossipComplete()
  383. end
  384.  
  385. ----------------------------------------------------------
  386.  
  387. if(intid == 343) then --Nagrand Arena--
  388. player:Teleport(530, -2044.768799, 6654.127441, 13.054342, 0)
  389. player:GossipComplete()
  390. end
  391.  
  392.  
  393. if(intid == 345) then --Gurubashi Arena--
  394. player:Teleport(530,-2011.498413, 6601.716797, 12.434589, 0)
  395. player:GossipComplete()
  396. end
  397.  
  398. ----------------------------------------------------------
  399.  
  400. if (intid == 994) then -- Heal
  401. player:SetHealth(player:GetMaxHealth())
  402. player:SendAreaTriggerMessage("your life has been recovered!")
  403. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  404. player:GossipComplete()
  405. end
  406.  
  407. if (intid == 996) then -- Remove Sickness
  408.     player:RemoveAura(15007)
  409.     player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  410.     player:GossipComplete()
  411. end
  412.  
  413. if(intid == 995) then
  414. player:GossipClearMenu()
  415. player:AddAura(33077, player)
  416. player:AddAura(33078, player)
  417. player:AddAura(33079, player)
  418. player:AddAura(33080, player)
  419. player:AddAura(33081, player)
  420. player:AddAura(33082, player)
  421. player:AddAura(42995, player)
  422. player:AddAura(48161, player)
  423. player:AddAura(25898, player)
  424. player:SendAreaTriggerMessage("You're now Buffed!")
  425. player:GossipMenuAddItem(7, "[Main Menu]", 0, 990)
  426. player:GossipSendMenu(1, unit)
  427. end
  428. end
  429.  
  430. RegisterCreatureGossipEvent(NpcEntry, 1, Npc_Teleport)
  431. RegisterCreatureGossipEvent(NpcEntry, 2, Teleporter_Events)
Advertisement
Add Comment
Please, Sign In to add comment