Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.17 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_dungeon_ulduarraid_misc_04:30:30:-20|t|CFFff00ea Zone Farm|r", 25},
  28. {"|TInterface\\icons\\Achievement_bg_winwsg:30:30:-20|t|cFFFF4500 Zone PvP|r", 30},
  29. {"|TInterface\\icons\\Achievement_dungeon_nexus70_normal:30:30:-20|t|cFF1E90FF Transmogrification|r", 35},
  30. {"|TInterface\\icons\\Achievement_boss_ragnaros:30:30:-20|t|cFFFF0000 WorldBoss|r", 40},
  31. }
  32.  
  33. local GossipTP = {
  34. -- E, M, X, Y, Z, O, NAME, ID
  35. {10, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF556B2F Zone Shop|r", 101},
  36. {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},
  37. {10, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  38. --
  39. {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},
  40. {15, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF7B68EE T2 (Scholomance)|r", 152},
  41. {15, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_qiraj_jewelblessed:30:30:-20|t|cFF7B68EE T3 (Uldaman)|r", 151},
  42. {15, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  43. --
  44. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Ability_warlock_backdraft:30:30:-20|t|CFFff00ea Zone Spell|r", 251},
  45. {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},
  46. {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},
  47. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_shirt_01:30:30:-20|t|CFFff00ea Zone Chemise|r", 251},
  48. {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},
  49. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_enchant_disenchant:30:30:-20|t|CFFff00ea Zone Enchantement|r", 251},
  50. {25, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_mount_darkphoenixa:30:30:-20|t|CFFff00ea Zone Monture|r", 251},
  51. {25, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  52. --
  53. {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},
  54. {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},
  55. {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},
  56. {30, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  57. --
  58. {35, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFF556B2F Transmogrification|r", 351},
  59. --
  60. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 0|r", 401},
  61. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 1|r", 401},
  62. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 2|r", 401},
  63. {40, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Inv_misc_runedorb_01:30:30:-20|t|cFFFF0000 3|r", 401},
  64. {40, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
  65. };
  66.  
  67. local function onGossipHello(event, player, object)
  68. for i=1, #GossipCat do
  69. player:GossipMenuAddItem(9, GossipCat[i][1], 0, GossipCat[i][2])
  70. end
  71. player:GossipSetText(" |cFF556B2F [ |cFFFF0000Enchanté |cFF556B2F"..player:GetName().."|cFFFF0000, que puis-je faire pour toi ? |cFF556B2F]")
  72. player:GossipSendMenu(0x7FFFFFFF, object)
  73. end
  74. RegisterCreatureGossipEvent(nEntry, 1, onGossipHello)
  75.  
  76. local function onGossipSelect(event, player, object, sender, intid, code)
  77. for i=1, #GossipCat do
  78. if intid == GossipCat[i][2] then
  79. for j=1, #GossipTP do
  80. if GossipCat[i][2] == GossipTP[j][1] then
  81. player:GossipMenuAddItem(9, GossipTP[j][7], 0, GossipTP[j][8])
  82. end
  83. end
  84. player:GossipSetText(" ")
  85. player:GossipSendMenu(0x7FFFFFFF, object)
  86. end
  87. end
  88. for j=1, #GossipTP do
  89. if intid == GossipTP[j][8] and GossipTP[j][8] == 0 then
  90. onGossipHello(event, player, object)
  91. elseif intid == GossipTP[j][8] then
  92. player:Teleport(GossipTP[j][2], GossipTP[j][3], GossipTP[j][4], GossipTP[j][5], GossipTP[j][6])
  93. end
  94. end
  95. end
  96. RegisterCreatureGossipEvent(nEntry, 2, onGossipSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement