From e7fd2e2f9c85f7c4196a8bc26eb156dc30271138 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 13 Oct 2022 12:54:10 -0400 Subject: [PATCH] Scripts/Gossips: Set gossip menu id for scripts that load menu items from database Port From (https://github.com/TrinityCore/TrinityCore/commit/e65fae7bcd451a2f779c3a6097d0e072a673c384) --- Source/Game/Entities/Player/Player.cs | 2 ++ .../BlackrockMountain/BlackrockDepths/TombOfSeven.cs | 2 ++ Source/Scripts/World/NpcInnkeeper.cs | 1 + Source/Scripts/World/NpcSpecial.cs | 1 + 4 files changed, 6 insertions(+) diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index a61b5b3ee..e7f106217 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -7406,6 +7406,8 @@ namespace Game.Entities // Closes the Menu public void CloseGossipMenu() { PlayerTalkClass.SendCloseGossip(); } + public void InitGossipMenu(uint menuId) { PlayerTalkClass.GetGossipMenu().SetMenuId(menuId); } + //Clears the Menu public void ClearGossipMenu() { PlayerTalkClass.ClearMenus(); } } diff --git a/Source/Scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/TombOfSeven.cs b/Source/Scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/TombOfSeven.cs index 2bac63188..1f6a9ad5b 100644 --- a/Source/Scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/TombOfSeven.cs +++ b/Source/Scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/TombOfSeven.cs @@ -214,6 +214,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.TombOfSeven switch (action) { case eTradeskill.GossipActionInfoDef + 1: + player.InitGossipMenu(TextIds.GossipSelectDoomrel); player.AddGossipItem(TextIds.GossipSelectDoomrel, TextIds.GossipMenuIdContinue, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2); player.SendGossipMenu(2605, me.GetGUID()); break; @@ -232,6 +233,7 @@ namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockDepths.TombOfSeven public override bool OnGossipHello(Player player) { + player.InitGossipMenu(TextIds.GossipMenuChallenge); player.AddGossipItem(TextIds.GossipMenuChallenge, TextIds.GossipMenuIdChallenge, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1); player.SendGossipMenu(2601, me.GetGUID()); diff --git a/Source/Scripts/World/NpcInnkeeper.cs b/Source/Scripts/World/NpcInnkeeper.cs index 2152e0380..8e9199890 100644 --- a/Source/Scripts/World/NpcInnkeeper.cs +++ b/Source/Scripts/World/NpcInnkeeper.cs @@ -41,6 +41,7 @@ namespace Scripts.World.NpcInnkeeper public override bool OnGossipHello(Player player) { + player.InitGossipMenu(Gossip.MenuId); if (Global.GameEventMgr.IsHolidayActive(HolidayIds.HallowsEnd) && !player.HasAura(SpellIds.TrickOrTreated)) player.AddGossipItem(Gossip.MenuEventId, 0, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1); diff --git a/Source/Scripts/World/NpcSpecial.cs b/Source/Scripts/World/NpcSpecial.cs index 71bab2315..66571b552 100644 --- a/Source/Scripts/World/NpcSpecial.cs +++ b/Source/Scripts/World/NpcSpecial.cs @@ -1417,6 +1417,7 @@ namespace Scripts.World.NpcSpecial public override bool OnGossipHello(Player player) { + player.InitGossipMenu(GossipMenus.MenuIdWormhole); if (me.IsSummon()) { if (player == me.ToTempSummon().GetSummoner())