Core: Update to 10.2.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/1eea1d11b14d2ae065ab0f1888fba3b1ef03874f)
This commit is contained in:
@@ -607,8 +607,17 @@ namespace Game
|
||||
{
|
||||
// This packet is completely irrelevant, it triggers PVP_TYPES_ENABLED lua event but that is not handled in interface code as of 6.1.2
|
||||
PVPOptionsEnabled pvpOptionsEnabled = new();
|
||||
pvpOptionsEnabled.RatedBattlegrounds = false;
|
||||
pvpOptionsEnabled.PugBattlegrounds = true;
|
||||
SendPacket(new PVPOptionsEnabled());
|
||||
pvpOptionsEnabled.WargameBattlegrounds = false;
|
||||
pvpOptionsEnabled.WargameArenas = false;
|
||||
pvpOptionsEnabled.RatedArenas = false;
|
||||
pvpOptionsEnabled.ArenaSkirmish = false;
|
||||
pvpOptionsEnabled.SoloShuffle = false;
|
||||
pvpOptionsEnabled.RatedSoloShuffle = false;
|
||||
pvpOptionsEnabled.BattlegroundBlitz = false;
|
||||
pvpOptionsEnabled.RatedBattlegroundBlitz = false;
|
||||
SendPacket(pvpOptionsEnabled);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestPvpRewards, Processing = PacketProcessing.Inplace)]
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace Game
|
||||
CalendarSendCalendar packet = new();
|
||||
packet.ServerTime = currTime;
|
||||
|
||||
var invites = Global.CalendarMgr.GetPlayerInvites(guid);
|
||||
foreach (var invite in invites)
|
||||
var playerInvites = Global.CalendarMgr.GetPlayerInvites(guid);
|
||||
foreach (var invite in playerInvites)
|
||||
{
|
||||
CalendarSendCalendarInviteInfo inviteInfo = new();
|
||||
inviteInfo.EventID = invite.EventId;
|
||||
@@ -45,7 +45,7 @@ namespace Game
|
||||
var playerEvents = Global.CalendarMgr.GetPlayerEvents(guid);
|
||||
foreach (var calendarEvent in playerEvents)
|
||||
{
|
||||
CalendarSendCalendarEventInfo eventInfo;
|
||||
CalendarSendCalendarEventInfo eventInfo = new();
|
||||
eventInfo.EventID = calendarEvent.EventId;
|
||||
eventInfo.Date = calendarEvent.Date;
|
||||
eventInfo.EventClubID = calendarEvent.GuildId;
|
||||
@@ -61,7 +61,6 @@ namespace Game
|
||||
foreach (InstanceLock instanceLock in Global.InstanceLockMgr.GetInstanceLocksForPlayer(_player.GetGUID()))
|
||||
{
|
||||
CalendarSendCalendarRaidLockoutInfo lockoutInfo = new();
|
||||
|
||||
lockoutInfo.MapID = (int)instanceLock.GetMapId();
|
||||
lockoutInfo.DifficultyID = (uint)instanceLock.GetDifficultyId();
|
||||
lockoutInfo.ExpireTime = (int)Math.Max((instanceLock.GetEffectiveExpiryTime() - GameTime.GetSystemTime()).TotalSeconds, 0);
|
||||
|
||||
@@ -111,8 +111,6 @@ namespace Game
|
||||
while (result.NextRow() && charResult.Characters.Count < 200);
|
||||
}
|
||||
|
||||
charResult.IsAlliedRacesCreationAllowed = CanAccessAlliedRaces();
|
||||
|
||||
foreach (var requirement in Global.ObjectMgr.GetRaceUnlockRequirements())
|
||||
{
|
||||
EnumCharactersResult.RaceUnlock raceUnlock = new();
|
||||
@@ -811,9 +809,8 @@ namespace Game
|
||||
|
||||
SendFeatureSystemStatus();
|
||||
|
||||
MOTD motd = new();
|
||||
motd.Text = Global.WorldMgr.GetMotd();
|
||||
SendPacket(motd);
|
||||
foreach (var motdLine in Global.WorldMgr.GetMotd())
|
||||
Global.WorldMgr.SendServerMessage(ServerMessageType.String, motdLine, pCurrChar);
|
||||
|
||||
SendSetTimeZoneInformation();
|
||||
|
||||
@@ -2544,6 +2541,29 @@ namespace Game
|
||||
GetPlayer().SetStandState(packet.StandState);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SavePersonalEmblem)]
|
||||
void HandleSavePersonalEmblem(SavePersonalEmblem savePersonalEmblem)
|
||||
{
|
||||
if (_player.GetNPCIfCanInteractWith(savePersonalEmblem.Vendor, NPCFlags.None, NPCFlags2.PersonalTabardDesigner) == null)
|
||||
{
|
||||
SendPacket(new PlayerSavePersonalEmblem(GuildEmblemError.InvalidVendor));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Guild.EmblemInfo.ValidateEmblemColors((uint)savePersonalEmblem.PersonalTabard.EmblemStyle, (uint)savePersonalEmblem.PersonalTabard.EmblemColor,
|
||||
(uint)savePersonalEmblem.PersonalTabard.BorderStyle, (uint)savePersonalEmblem.PersonalTabard.BorderColor, (uint)savePersonalEmblem.PersonalTabard.BackgroundColor))
|
||||
{
|
||||
SendPacket(new PlayerSavePersonalEmblem(GuildEmblemError.InvalidTabardColors));
|
||||
return;
|
||||
}
|
||||
|
||||
_player.SetPersonalTabard(savePersonalEmblem.PersonalTabard.EmblemStyle, savePersonalEmblem.PersonalTabard.EmblemColor,
|
||||
savePersonalEmblem.PersonalTabard.BorderStyle, savePersonalEmblem.PersonalTabard.BorderColor,
|
||||
savePersonalEmblem.PersonalTabard.BackgroundColor);
|
||||
|
||||
SendPacket(new PlayerSavePersonalEmblem(GuildEmblemError.Success));
|
||||
}
|
||||
|
||||
void SendCharCreate(ResponseCodes result, ObjectGuid guid = default)
|
||||
{
|
||||
CreateChar response = new();
|
||||
|
||||
@@ -17,27 +17,44 @@ namespace Game
|
||||
public partial class WorldSession
|
||||
{
|
||||
[WorldPacketHandler(ClientOpcodes.TabardVendorActivate, Processing = PacketProcessing.Inplace)]
|
||||
void HandleTabardVendorActivate(Hello packet)
|
||||
void HandleTabardVendorActivate(TabardVendorActivate tabardVendorActivate)
|
||||
{
|
||||
Creature unit = GetPlayer().GetNPCIfCanInteractWith(packet.Unit, NPCFlags.TabardDesigner, NPCFlags2.None);
|
||||
Creature unit = GetPlayer().GetNPCIfCanInteractWith(tabardVendorActivate.Vendor, NPCFlags.TabardDesigner, NPCFlags2.None);
|
||||
if (unit == null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WORLD: HandleTabardVendorActivateOpcode - {0} not found or you can not interact with him.", packet.Unit.ToString());
|
||||
Log.outDebug(LogFilter.Network, $"WORLD: HandleTabardVendorActivateOpcode - {tabardVendorActivate.Vendor} not found or you can not interact with him.");
|
||||
return;
|
||||
}
|
||||
|
||||
TabardVendorType type = (TabardVendorType)tabardVendorActivate.Type;
|
||||
if (type != TabardVendorType.Guild && type != TabardVendorType.Personal)
|
||||
return;
|
||||
|
||||
// remove fake death
|
||||
if (GetPlayer().HasUnitState(UnitState.Died))
|
||||
GetPlayer().RemoveAurasByType(AuraType.FeignDeath);
|
||||
|
||||
SendTabardVendorActivate(packet.Unit);
|
||||
SendTabardVendorActivate(tabardVendorActivate.Vendor, type);
|
||||
}
|
||||
|
||||
public void SendTabardVendorActivate(ObjectGuid guid)
|
||||
public void SendTabardVendorActivate(ObjectGuid guid, TabardVendorType type)
|
||||
{
|
||||
NPCInteractionOpenResult npcInteraction = new();
|
||||
npcInteraction.Npc = guid;
|
||||
npcInteraction.InteractionType = PlayerInteractionType.TabardVendor;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TabardVendorType.Guild:
|
||||
npcInteraction.InteractionType = PlayerInteractionType.GuildTabardVendor;
|
||||
break;
|
||||
case TabardVendorType.Personal:
|
||||
npcInteraction.InteractionType = PlayerInteractionType.PersonalTabardVendor;
|
||||
break;
|
||||
default:
|
||||
Log.outFatal(LogFilter.Server, $"Unsupported tabard vendor type {type}");
|
||||
break;
|
||||
}
|
||||
|
||||
npcInteraction.Success = true;
|
||||
SendPacket(npcInteraction);
|
||||
}
|
||||
@@ -345,7 +362,7 @@ namespace Game
|
||||
|
||||
_player.SetPetSlot(setPetSlot.PetNumber, (PetSaveMode)setPetSlot.DestSlot);
|
||||
}
|
||||
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RepairItem, Processing = PacketProcessing.Inplace)]
|
||||
void HandleRepairItem(RepairItem packet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user