Advertisement
Guest User

TeleporteurLua

a guest
Aug 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.85 KB | None | 0 0
  1. local SMSG_NPC_TEXT_UPDATE = 384
  2. local MAX_GOSSIP_TEXT_OPTIONS = 8
  3.  
  4. function Player:GossipSetText(text, textID)
  5. local data = CreatePacket(SMSG_NPC_TEXT_UPDATE, 100);
  6. data:WriteULong(textID or 0x7FFFFFFF)
  7. for i = 1, MAX_GOSSIP_TEXT_OPTIONS do
  8. data:WriteFloat(0) -- Probability
  9. data:WriteString(text) -- Text
  10. data:WriteString(text) -- Text
  11. data:WriteULong(0) -- language
  12. data:WriteULong(0) -- emote
  13. data:WriteULong(0) -- emote
  14. data:WriteULong(0) -- emote
  15. data:WriteULong(0) -- emote
  16. data:WriteULong(0) -- emote
  17. data:WriteULong(0) -- emote
  18. end
  19. self:SendPacket(data)
  20. end
  21.  
  22. local nEntry = 85000;
  23.  
  24. local GossipCat = {
  25. {"|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFF556B2F Auberge|r", 10},
  26. {"|TInterface\\icons\\Achievement_boss_kickandtrick:30:30:-20|t|cFF7B68EE Donjons & Raids|r", 15},
  27. {"|TInterface\\icons\\Achievement_bg_trueavshutout:30:30:-20|t|cffffff00 Événements|r", 20},
  28. {"|TInterface\\icons\\Achievement_dungeon_ulduarraid_misc_04:30:30:-20|t|CFFff00ea Zone Farm|r", 25},
  29. {"|TInterface\\icons\\Achievement_bg_winwsg:30:30:-20|t|cFFFF4500 Zone PvP|r", 30},
  30. {"|TInterface\\icons\\Achievement_dungeon_nexus70_normal:30:30:-20|t|cFF1E90FF Transmogrification|r", 35},
  31. {"|TInterface\\icons\\Achievement_boss_ragnaros:30:30:-20|t|cFFFF0000 WorldBoss|r", 40};
  32. }
  33.  
  34. local GossipTP = {
  35. -- E, M, X, Y, Z, O, NAME, ID
  36. {10, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF556B2F Zone Shop|r", 101},
  37. {10, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_ore_cobalt:30:30:-20|t|cFF556B2F Zone V.I.P", 102},
  38. {10, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0};
  39. --
  40. {15, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF7B68EE T1 (Fort de Durn)|r", 151},
  41. {15, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF7B68EE T2 (Scholomance)|r", 152},
  42. {15, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF7B68EE T3 (Uldaman)|r", 151},
  43. {15, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  44. --
  45. {20, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Ability_hunter_snipershot:30:30:-20|t|cffffff00 Chasseur de primes|r", 201},
  46. {20, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Achievement_reputation_ogre:30:30:-20|t|cffffff00 Série d'boss|r", 202},
  47. {20, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Achievement_halloween_bat_01:30:30:-20|t|cffffff00 Vole petit papillon|r", 203},
  48. {20, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  49. --
  50. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Ability_warlock_backdraft:30:30:-20|t|CFFff00ea Zone Spell|r", 251},
  51. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_bag_24_netherweave_imbued:30:30:-20|t|CFFff00ea Zone Sac|r", 251},
  52. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_shirt_guildtabard_01:30:30:-20|t|CFFff00ea Zone Tabard|r", 251},
  53. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_shirt_01:30:30:-20|t|CFFff00ea Zone Chemise|r", 251},
  54. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_jewelcrafting_nightseye_03:30:30:-20:-20|t|CFFff00ea Zone Gemmes|r", 251},
  55. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_enchant_disenchant:30:30:-20|t|CFFff00ea Zone Enchantement|r", 251},
  56. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_mount_darkphoenixa:30:30:-20|t|CFFff00ea Zone Monture|r", 251},
  57. {25, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  58. --
  59. {30, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF4500 Zone FFA|r", 301},
  60. {30, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF4500 Zone Arène|r", 301},
  61. {30, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF4500 Zone Duel|r", 301},
  62. {30, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  63. --
  64. {35, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFF556B2F Transmogrification|r", 351},
  65. --
  66. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 0|r", 401},
  67. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 1|r", 401},
  68. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 2|r", 401},
  69. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 3|r", 401},
  70. {40, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0};
  71. }
  72.  
  73. local function onGossipHello(event, player, object)
  74. for i=1, #GossipCat do
  75. player:GossipMenuAddItem(9, GossipCat[i][1], 0, GossipCat[i][2])
  76. end
  77. player:GossipSetText(" |cFF556B2F [ |cFFFF0000Enchanté |cFF556B2F"..player:GetName().."|cFFFF0000, que puis-je faire pour toi ? |cFF556B2F]")
  78. player:GossipSendMenu(0x7FFFFFFF, object)
  79. end
  80. RegisterCreatureGossipEvent(nEntry, 1, onGossipHello)
  81.  
  82. local function onGossipSelect(event, player, object, sender, intid, code)
  83. for i=1, #GossipCat do
  84. if intid == GossipCat[i][2] then
  85. for j=1, #GossipTP do
  86. if GossipCat[i][2] == GossipTP[j][1] then
  87. player:GossipMenuAddItem(9, GossipTP[j][7], 0, GossipTP[j][8])
  88. end
  89. end
  90. player:GossipSetText(" ")
  91. player:GossipSendMenu(0x7FFFFFFF, object)
  92. end
  93. end
  94. for j=1, #GossipTP do
  95. if intid == GossipTP[j][8] and GossipTP[j][8] == 0 then
  96. onGossipHello(event, player, object)
  97. elseif intid == GossipTP[j][8] then
  98. player:Teleport(GossipTP[j][2], GossipTP[j][3], GossipTP[j][4], GossipTP[j][5], GossipTP[j][6])
  99. end
  100. end
  101. end
  102. RegisterCreatureGossipEvent(nEntry, 2, onGossipSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement