Core/Garrisons: Implement SMSG_GARRISON_OPEN_TALENT_NPC opcode

Port From (https://github.com/TrinityCore/TrinityCore/commit/4772c4817f1b34553f1c697e2aedc0372af9aea2)
This commit is contained in:
hondacrx
2022-10-11 20:27:05 -04:00
parent d1f5ca2f49
commit f441175665
10 changed files with 112 additions and 4 deletions
+5
View File
@@ -746,6 +746,11 @@ namespace Game.Misc
public int FriendshipFactionID;
}
public class GossipMenuItemAddon
{
public int? GarrTalentTreeID;
}
public class PointOfInterest
{
public uint Id;
@@ -3111,5 +3111,14 @@ namespace Game.Entities
SendPacket(displayToast);
}
void SendGarrisonOpenTalentNpc(ObjectGuid guid, int garrTalentTreeId, int friendshipFactionId)
{
GarrisonOpenTalentNpc openTalentNpc = new();
openTalentNpc.NpcGUID = guid;
openTalentNpc.GarrTalentTreeID = garrTalentTreeId;
openTalentNpc.FriendshipFactionID = friendshipFactionId;
SendPacket(openTalentNpc);
}
}
}
+7
View File
@@ -2612,6 +2612,13 @@ namespace Game.Entities
PlayerTalkClass.SendCloseGossip();
SendRespecWipeConfirm(guid, 0, SpecResetType.Glyphs);
break;
case GossipOptionNpc.GarrisonTalent:
{
GossipMenuAddon addon = Global.ObjectMgr.GetGossipMenuAddon(menuId);
GossipMenuItemAddon itemAddon = Global.ObjectMgr.GetGossipMenuItemAddon(menuId, gossipListId);
SendGarrisonOpenTalentNpc(guid, itemAddon != null ? itemAddon.GarrTalentTreeID.GetValueOrDefault(0) : 0, addon != null ? addon.FriendshipFactionID : 0);
break;
}
case GossipOptionNpc.Transmogrify:
GetSession().SendOpenTransmogrifier(guid);
break;