Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local SMSG_NPC_TEXT_UPDATE = 384
- local MAX_GOSSIP_TEXT_OPTIONS = 8
- function Player:GossipSetText(text, textID)
- local data = CreatePacket(SMSG_NPC_TEXT_UPDATE, 100);
- data:WriteULong(textID or 0x7FFFFFFF)
- for i = 1, MAX_GOSSIP_TEXT_OPTIONS do
- data:WriteFloat(0) -- Probability
- data:WriteString(text) -- Text
- data:WriteString(text) -- Text
- data:WriteULong(0) -- language
- data:WriteULong(0) -- emote
- data:WriteULong(0) -- emote
- data:WriteULong(0) -- emote
- data:WriteULong(0) -- emote
- data:WriteULong(0) -- emote
- data:WriteULong(0) -- emote
- end
- self:SendPacket(data)
- end
- local nEntry = 85000;
- local GossipCat = {
- {"|TInterface\\icons\\Ability_warrior_offensivestance:30:30:-20|t|cFFFF0000 Guerrier|r", 100},
- }
- local GossipTP = {
- -- E, M, X, Y, Z, O, NAME, ID
- {100, 13, 28.164017, -10.482026, -144.708603, 2.785897, "|TInterface\\icons\\Ability_warrior_titansgrip:30:30:-20|t|cFFFF0000 Poigne du titan|r", 101},
- {100, 0, 0, 0, 0, 0, "|TInterface\\icons\\Achievement_bg_returnxflags_def_wsg:30:30:-20|t|cFFFFFFE0 Retour|r", 0},
- --
- }
- local function onGossipHello(event, player, object)
- for i=1, #GossipCat do
- player:GossipMenuAddItem(9, GossipCat[i][1], 0, GossipCat[i][2])
- end
- player:GossipSetText(" |cFF556B2F [ |cFFFF0000Enchanté |cFF556B2F"..player:GetName().."|cFFFF0000, que puis-je faire pour toi ? |cFF556B2F]")
- player:GossipSendMenu(0x7FFFFFFF, object)
- end
- RegisterCreatureGossipEvent(nEntry, 1, onGossipHello)
- local function onGossipSelect(event, player, object, sender, intid, code)
- for i=1, #GossipCat do
- if intid == GossipCat[i][2] then
- for j=1, #GossipTP do
- if GossipCat[i][2] == GossipTP[j][1] then
- player:GossipMenuAddItem(9, GossipTP[j][7], 0, GossipTP[j][8])
- end
- end
- player:GossipSetText(" ")
- player:GossipSendMenu(0x7FFFFFFF, object)
- end
- end
- for j=1, #GossipTP do
- if intid == GossipTP[j][8] and GossipTP[j][8] == 0 then
- onGossipHello(event, player, object)
- elseif intid == GossipTP[j][8] then
- player:Teleport(GossipTP[j][2], GossipTP[j][3], GossipTP[j][4], GossipTP[j][5], GossipTP[j][6])
- end
- end
- end
- RegisterCreatureGossipEvent(nEntry, 2, onGossipSelect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement