Core: Updated to 10.0.2

Port From (https://github.com/TrinityCore/TrinityCore/commit/e98e1283ea0034baf6be9aa2ffb386eb5582801b)
This commit is contained in:
hondacrx
2022-12-28 15:25:15 -05:00
parent 2dc12dbb69
commit 989b80b056
100 changed files with 6591 additions and 4112 deletions
@@ -784,12 +784,12 @@ namespace Game.Networking.Packets
public struct AuctionListFilterSubClass
{
public int ItemSubclass;
public uint InvTypeMask;
public ulong InvTypeMask;
public AuctionListFilterSubClass(WorldPacket data)
{
InvTypeMask = data.ReadUInt64();
ItemSubclass = data.ReadInt32();
InvTypeMask = data.ReadUInt32();
}
}
@@ -138,6 +138,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8(classAvailability.ClassID);
_worldPacket.WriteUInt8(classAvailability.ActiveExpansionLevel);
_worldPacket.WriteUInt8(classAvailability.AccountExpansionLevel);
_worldPacket.WriteUInt8(classAvailability.MinActiveExpansionLevel);
}
}
@@ -166,7 +167,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt16(SuccessInfo.NumPlayersAlliance.Value);
if(SuccessInfo.ExpansionTrialExpiration.HasValue)
_worldPacket.WriteInt32(SuccessInfo.ExpansionTrialExpiration.Value);
_worldPacket.WriteInt64(SuccessInfo.ExpansionTrialExpiration.Value);
foreach (VirtualRealmInfo virtualRealm in SuccessInfo.VirtualRealms)
virtualRealm.Write(_worldPacket);
@@ -220,7 +221,7 @@ namespace Game.Networking.Packets
public bool ForceCharacterTemplate; // forces the client to always use a character template when creating a new character. @see Templates. @todo implement
public ushort? NumPlayersHorde; // number of horde players in this realm. @todo implement
public ushort? NumPlayersAlliance; // number of alliance players in this realm. @todo implement
public int? ExpansionTrialExpiration; // expansion trial expiration unix timestamp
public long? ExpansionTrialExpiration; // expansion trial expiration unix timestamp
public struct GameTime
{
@@ -34,25 +34,6 @@ namespace Game.Networking.Packets
public ulong XP;
}
class OpenHeartForge : ServerPacket
{
public OpenHeartForge() : base(ServerOpcodes.OpenHeartForge) { }
public override void Write()
{
_worldPacket.WritePackedGuid(ForgeGUID);
}
public ObjectGuid ForgeGUID;
}
class CloseHeartForge : ServerPacket
{
public CloseHeartForge() : base(ServerOpcodes.CloseHeartForge) { }
public override void Write() { }
}
class AzeriteEssenceUnlockMilestone : ClientPacket
{
public AzeriteEssenceUnlockMilestone(WorldPacket packet) : base(packet) { }
@@ -141,19 +122,4 @@ namespace Game.Networking.Packets
public bool IsHeartEquipped;
}
class AzeriteRespecNPC : ServerPacket
{
public AzeriteRespecNPC(ObjectGuid npcGuid) : base(ServerOpcodes.AzeriteRespecNpc)
{
NpcGUID = npcGuid;
}
public override void Write()
{
_worldPacket.WritePackedGuid(NpcGUID);
}
public ObjectGuid NpcGUID;
}
}
@@ -573,12 +573,15 @@ namespace Game.Networking.Packets
public int Unused2;
public int WeeklyPlayed;
public int WeeklyWon;
public int RoundsSeasonPlayed;
public int RoundsSeasonWon;
public int RoundsWeeklyPlayed;
public int RoundsWeeklyWon;
public int BestWeeklyRating;
public int LastWeeksBestRating;
public int BestSeasonRating;
public int PvpTierID;
public int Unused3;
public int WeeklyBestWinPvpTierID;
public int Unused4;
public int Rank;
public bool Disqualified;
@@ -593,12 +596,15 @@ namespace Game.Networking.Packets
data.WriteInt32(Unused2);
data.WriteInt32(WeeklyPlayed);
data.WriteInt32(WeeklyWon);
data.WriteInt32(RoundsSeasonPlayed);
data.WriteInt32(RoundsSeasonWon);
data.WriteInt32(RoundsWeeklyPlayed);
data.WriteInt32(RoundsWeeklyWon);
data.WriteInt32(BestWeeklyRating);
data.WriteInt32(LastWeeksBestRating);
data.WriteInt32(BestSeasonRating);
data.WriteInt32(PvpTierID);
data.WriteInt32(Unused3);
data.WriteInt32(WeeklyBestWinPvpTierID);
data.WriteInt32(Unused4);
data.WriteInt32(Rank);
data.WriteBit(Disqualified);
@@ -33,21 +33,6 @@ namespace Game.Networking.Packets
public ObjectGuid Guid;
}
class BlackMarketOpenResult : ServerPacket
{
public BlackMarketOpenResult() : base(ServerOpcodes.BlackMarketOpenResult) { }
public override void Write()
{
_worldPacket .WritePackedGuid(Guid);
_worldPacket.WriteBit(Enable);
_worldPacket.FlushBits();
}
public ObjectGuid Guid;
public bool Enable = true;
}
class BlackMarketRequestItems : ClientPacket
{
public BlackMarketRequestItems(WorldPacket packet) : base(packet) { }
@@ -44,12 +44,14 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(IsNewPlayerRestrictionSkipped);
_worldPacket.WriteBit(IsNewPlayerRestricted);
_worldPacket.WriteBit(IsNewPlayer);
_worldPacket.WriteBit(IsTrialAccountRestricted);
_worldPacket.WriteBit(DisabledClassesMask.HasValue);
_worldPacket.WriteBit(IsAlliedRacesCreationAllowed);
_worldPacket.WriteInt32(Characters.Count);
_worldPacket.WriteInt32(MaxCharacterLevel);
_worldPacket.WriteInt32(RaceUnlockData.Count);
_worldPacket.WriteInt32(UnlockedConditionalAppearances.Count);
_worldPacket.WriteInt32(RaceLimitDisables.Count);
if (DisabledClassesMask.HasValue)
_worldPacket.WriteUInt32(DisabledClassesMask.Value);
@@ -57,6 +59,9 @@ namespace Game.Networking.Packets
foreach (UnlockedConditionalAppearance unlockedConditionalAppearance in UnlockedConditionalAppearances)
unlockedConditionalAppearance.Write(_worldPacket);
foreach (RaceLimitDisableInfo raceLimitDisableInfo in RaceLimitDisables)
raceLimitDisableInfo.Write(_worldPacket);
foreach (CharacterInfo charInfo in Characters)
charInfo.Write(_worldPacket);
@@ -69,6 +74,7 @@ namespace Game.Networking.Packets
public bool IsNewPlayerRestrictionSkipped; // allows client to skip new player restrictions
public bool IsNewPlayerRestricted; // forbids using level boost and class trials
public bool IsNewPlayer; // forbids hero classes and allied races
public bool IsTrialAccountRestricted;
public bool IsAlliedRacesCreationAllowed;
public int MaxCharacterLevel = 1;
@@ -77,6 +83,7 @@ namespace Game.Networking.Packets
public List<CharacterInfo> Characters = new(); // all characters on the list
public List<RaceUnlock> RaceUnlockData = new(); //
public List<UnlockedConditionalAppearance> UnlockedConditionalAppearances = new();
public List<RaceLimitDisableInfo> RaceLimitDisables = new();
public class CharacterInfo
{
@@ -147,11 +154,11 @@ namespace Game.Networking.Packets
var spec = Global.DB2Mgr.GetChrSpecializationByIndex(ClassId, fields.Read<byte>(21));
if (spec != null)
SpecID = (ushort)spec.Id;
SpecID = (short)spec.Id;
LastLoginVersion = fields.Read<uint>(22);
LastLoginVersion = fields.Read<int>(22);
for (byte slot = 0; slot < InventorySlots.BagEnd; ++slot)
for (byte slot = 0; slot < InventorySlots.ReagentBagEnd; ++slot)
{
VisualItems[slot].InvType = (byte)equipment.NextUInt32();
VisualItems[slot].DisplayId = equipment.NextUInt32();
@@ -190,9 +197,9 @@ namespace Game.Networking.Packets
visualItem.Write(data);
data.WriteInt64(LastPlayedTime);
data.WriteUInt16(SpecID);
data.WriteUInt32(Unknown703);
data.WriteUInt32(LastLoginVersion);
data.WriteInt16(SpecID);
data.WriteInt32(Unknown703);
data.WriteInt32(LastLoginVersion);
data.WriteUInt32(Flags4);
data.WriteInt32(MailSenders.Count);
data.WriteInt32(MailSenderTypes.Count);
@@ -244,16 +251,16 @@ namespace Game.Networking.Packets
public bool FirstLogin;
public byte unkWod61x;
public long LastPlayedTime;
public ushort SpecID;
public uint Unknown703;
public uint LastLoginVersion;
public short SpecID;
public int Unknown703;
public int LastLoginVersion;
public uint OverrideSelectScreenFileDataID;
public uint PetCreatureDisplayId;
public uint PetExperienceLevel;
public uint PetCreatureFamilyId;
public bool BoostInProgress; // @todo
public uint[] ProfessionIds = new uint[2]; // @todo
public VisualItemInfo[] VisualItems = new VisualItemInfo[InventorySlots.BagEnd];
public VisualItemInfo[] VisualItems = new VisualItemInfo[InventorySlots.ReagentBagEnd];
public List<string> MailSenders = new();
public List<uint> MailSenderTypes = new();
@@ -311,6 +318,24 @@ namespace Game.Networking.Packets
public int AchievementID;
public int Unused;
}
public struct RaceLimitDisableInfo
{
enum blah
{
Server,
Level
}
public int RaceID;
public int BlockReason;
public void Write(WorldPacket data)
{
data.WriteInt32(RaceID);
data.WriteInt32(BlockReason);
}
}
}
class CheckCharacterNameAvailability : ClientPacket
@@ -500,6 +525,7 @@ namespace Game.Networking.Packets
RaceOrFactionChangeInfo.Guid = _worldPacket.ReadPackedGuid();
RaceOrFactionChangeInfo.SexID = (Gender)_worldPacket.ReadUInt8();
RaceOrFactionChangeInfo.RaceID = (Race)_worldPacket.ReadUInt8();
RaceOrFactionChangeInfo.InitialRaceID = (Race)_worldPacket.ReadUInt8();
var customizationCount = _worldPacket.ReadUInt32();
RaceOrFactionChangeInfo.Name = _worldPacket.ReadString(nameLength);
@@ -851,6 +877,7 @@ namespace Game.Networking.Packets
{
var customizationCount = _worldPacket.ReadUInt32();
NewSex = _worldPacket.ReadUInt8();
CustomizedRace = _worldPacket.ReadInt32();
for (var i = 0; i < customizationCount; ++i)
{
@@ -866,6 +893,7 @@ namespace Game.Networking.Packets
public byte NewSex;
public Array<ChrCustomizationChoice> Customizations = new(50);
public int CustomizedRace;
}
public class BarberShopResult : ServerPacket
@@ -902,7 +930,6 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8((byte)Reason);
_worldPacket.WriteInt32(Amount);
_worldPacket.WriteFloat(GroupBonus);
_worldPacket.WriteUInt8(ReferAFriendBonusType);
}
public ObjectGuid Victim;
@@ -910,7 +937,6 @@ namespace Game.Networking.Packets
public PlayerLogXPReason Reason;
public int Amount;
public float GroupBonus;
public byte ReferAFriendBonusType; // 1 - 300% of normal XP; 2 - 150% of normal XP
}
class TitleEarned : ServerPacket
@@ -1105,6 +1131,7 @@ namespace Game.Networking.Packets
public class CharRaceOrFactionChangeInfo
{
public Race RaceID = Race.None;
public Race InitialRaceID = Race.None;
public Gender SexID = Gender.None;
public ObjectGuid Guid;
public bool FactionChange;
@@ -31,7 +31,7 @@ namespace Game.Networking.Packets
public override void Read()
{
Language = (Language)_worldPacket.ReadInt32();
uint len = _worldPacket.ReadBits<uint>(9);
uint len = _worldPacket.ReadBits<uint>(11);
Text = _worldPacket.ReadString(len);
}
@@ -47,7 +47,7 @@ namespace Game.Networking.Packets
{
Language = (Language)_worldPacket.ReadInt32();
uint targetLen = _worldPacket.ReadBits<uint>(9);
uint textLen = _worldPacket.ReadBits<uint>(9);
uint textLen = _worldPacket.ReadBits<uint>(11);
Target = _worldPacket.ReadString(targetLen);
Text = _worldPacket.ReadString(textLen);
}
@@ -66,7 +66,7 @@ namespace Game.Networking.Packets
Language = (Language)_worldPacket.ReadInt32();
ChannelGUID = _worldPacket.ReadPackedGuid();
uint targetLen = _worldPacket.ReadBits<uint>(9);
uint textLen = _worldPacket.ReadBits<uint>(9);
uint textLen = _worldPacket.ReadBits<uint>(11);
Target = _worldPacket.ReadString(targetLen);
Text = _worldPacket.ReadString(textLen);
}
@@ -112,7 +112,7 @@ namespace Game.Networking.Packets
public override void Read()
{
uint len = _worldPacket.ReadBits<uint>(9);
uint len = _worldPacket.ReadBits<uint>(11);
Text = _worldPacket.ReadString(len);
}
@@ -125,7 +125,7 @@ namespace Game.Networking.Packets
public override void Read()
{
uint len = _worldPacket.ReadBits<uint>(9);
uint len = _worldPacket.ReadBits<uint>(11);
Text = _worldPacket.ReadString(len);
}
@@ -138,7 +138,7 @@ namespace Game.Networking.Packets
public override void Read()
{
uint len = _worldPacket.ReadBits<uint>(9);
uint len = _worldPacket.ReadBits<uint>(11);
Text = _worldPacket.ReadString(len);
}
@@ -0,0 +1,88 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Game.Entities;
using System.Collections.Generic;
namespace Game.Networking.Packets
{
struct SpellReducedReagent
{
public int ItemID;
public int Quantity;
public void Write(WorldPacket data)
{
data.WriteInt32(ItemID);
data.WriteInt32(Quantity);
}
}
class CraftingData
{
public int CraftingQualityID;
public int field_4;
public int field_8;
public int Multicraft;
public int field_10;
public int field_14;
public int CritBonusSkill;
public float field_1C;
public ulong field_20;
public bool IsCrit;
public bool field_29;
public bool field_2A;
public bool BonusCraft;
public List<SpellReducedReagent> ResourcesReturned = new();
public uint OperationID;
public ObjectGuid ItemGUID;
public int Quantity;
public ItemInstance OldItem = new();
public ItemInstance NewItem = new();
public int EnchantID;
public void Write(WorldPacket data)
{
data.WriteInt32(CraftingQualityID);
data.WriteInt32(field_4);
data.WriteInt32(field_8);
data.WriteInt32(Multicraft);
data.WriteInt32(field_10);
data.WriteInt32(field_14);
data.WriteInt32(CritBonusSkill);
data.WriteFloat(field_1C);
data.WriteUInt64(field_20);
data.WriteInt32(ResourcesReturned.Count);
data.WriteUInt32(OperationID);
data.WritePackedGuid(ItemGUID);
data.WriteInt32(Quantity);
data.WriteInt32(EnchantID);
foreach (SpellReducedReagent spellReducedReagent in ResourcesReturned)
spellReducedReagent.Write(data);
data.WriteBit(IsCrit);
data.WriteBit(field_29);
data.WriteBit(field_2A);
data.WriteBit(BonusCraft);
data.FlushBits();
OldItem.Write(data);
NewItem.Write(data);
}
}
}
@@ -27,9 +27,11 @@ namespace Game.Networking.Packets
public override void Read()
{
Guid = _worldPacket.ReadPackedGuid();
IsSoftInteract = _worldPacket.HasBit();
}
public ObjectGuid Guid;
public bool IsSoftInteract;
}
public class GameObjReportUse : ClientPacket
@@ -39,9 +41,11 @@ namespace Game.Networking.Packets
public override void Read()
{
Guid = _worldPacket.ReadPackedGuid();
IsSoftInteract = _worldPacket.HasBit();
}
public ObjectGuid Guid;
public bool IsSoftInteract;
}
class GameObjectDespawn : ServerPacket
@@ -136,22 +140,6 @@ namespace Game.Networking.Packets
public bool PlayAsDespawn;
}
class GameObjectUILink : ServerPacket
{
public GameObjectUILink() : base(ServerOpcodes.GameObjectUiLink, ConnectionType.Instance) { }
public override void Write()
{
_worldPacket.WritePackedGuid(ObjectGUID);
_worldPacket.WriteInt32(UILink);
_worldPacket.WriteInt32(UIItemInteractionID);
}
public ObjectGuid ObjectGUID;
public int UILink;
public int UIItemInteractionID;
}
class GameObjectPlaySpellVisual : ServerPacket
{
public GameObjectPlaySpellVisual() : base(ServerOpcodes.GameObjectPlaySpellVisual) { }
@@ -181,4 +169,29 @@ namespace Game.Networking.Packets
public ObjectGuid ObjectGUID;
public byte State;
}
class GameObjectInteraction : ServerPacket
{
public ObjectGuid ObjectGUID;
public PlayerInteractionType InteractionType;
public GameObjectInteraction() : base(ServerOpcodes.GameObjectInteraction) { }
public override void Write()
{
_worldPacket.WritePackedGuid(ObjectGUID);
_worldPacket.WriteInt32((int)InteractionType);
}
}
class GameObjectCloseInteraction : ServerPacket
{
public PlayerInteractionType InteractionType;
public GameObjectCloseInteraction() : base(ServerOpcodes.GameObjectCloseInteraction) { }
public override void Write()
{
_worldPacket.WriteInt32((int)InteractionType);
}
}
}
@@ -316,22 +316,6 @@ namespace Game.Networking.Packets
public uint GarrPlotInstanceID;
}
class GarrisonOpenTalentNpc : ServerPacket
{
public GarrisonOpenTalentNpc() : base(ServerOpcodes.GarrisonOpenTalentNpc, ConnectionType.Instance) { }
public override void Write()
{
_worldPacket.WritePackedGuid(NpcGUID);
_worldPacket.WriteInt32(GarrTalentTreeID);
_worldPacket.WriteInt32(FriendshipFactionID);
}
public ObjectGuid NpcGUID;
public int GarrTalentTreeID;
public int FriendshipFactionID; // Always 0 except on The Deaths of Chromie Scenario
}
//Structs
public struct GarrisonPlotInfo
@@ -75,7 +75,9 @@ namespace Game.Networking.Packets
GuildData.Value.Write(_worldPacket);
if (AzeriteLevel.HasValue)
_worldPacket.WriteUInt32((uint)AzeriteLevel);
_worldPacket.WriteUInt32(AzeriteLevel.Value);
TalentTraits.Write(_worldPacket);
}
public PlayerModelDisplayInfo DisplayInfo;
@@ -83,7 +85,7 @@ namespace Game.Networking.Packets
public List<ushort> Talents = new();
public Array<ushort> PvpTalents = new(PlayerConst.MaxPvpTalentSlots, 0);
public InspectGuildData? GuildData;
public Array<PVPBracketData> Bracket = new(6, default);
public Array<PVPBracketData> Bracket = new(7, default);
public uint? AzeriteLevel;
public int ItemLevel;
public uint LifetimeHK;
@@ -91,6 +93,7 @@ namespace Game.Networking.Packets
public ushort TodayHK;
public ushort YesterdayHK;
public byte LifetimeMaxRank;
public TraitInspectInfo TalentTraits;
}
public class QueryInspectAchievements : ClientPacket
@@ -290,6 +293,7 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data)
{
data.WriteUInt8(Bracket);
data.WriteInt32(Unused3);
data.WriteInt32(Rating);
data.WriteInt32(Rank);
data.WriteInt32(WeeklyPlayed);
@@ -302,6 +306,10 @@ namespace Game.Networking.Packets
data.WriteInt32(WeeklyBestWinPvpTierID);
data.WriteInt32(Unused1);
data.WriteInt32(Unused2);
data.WriteInt32(RoundsSeasonPlayed);
data.WriteInt32(RoundsSeasonWon);
data.WriteInt32(RoundsWeeklyPlayed);
data.WriteInt32(RoundsWeeklyWon);
data.WriteBit(Disqualified);
data.FlushBits();
}
@@ -318,10 +326,29 @@ namespace Game.Networking.Packets
public int WeeklyBestWinPvpTierID;
public int Unused1;
public int Unused2;
public int Unused3;
public int RoundsSeasonPlayed;
public int RoundsSeasonWon;
public int RoundsWeeklyPlayed;
public int RoundsWeeklyWon;
public byte Bracket;
public bool Disqualified;
}
public struct TraitInspectInfo
{
public int Level;
public int ChrSpecializationID;
public TraitConfig Config;
public void Write(WorldPacket data)
{
data . WriteInt32(Level);
data . WriteInt32(ChrSpecializationID);
Config.Write(data);
}
}
public struct AzeriteEssenceData
{
public uint Index;
+70 -6
View File
@@ -20,6 +20,7 @@ using Framework.Dynamic;
using Game.Entities;
using System.Collections.Generic;
using System.Linq;
using System;
namespace Game.Networking.Packets
{
@@ -429,14 +430,26 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(BattlePetBreedQuality);
_worldPacket.WriteInt32(BattlePetLevel);
_worldPacket.WritePackedGuid(ItemGUID);
_worldPacket.WriteInt32(Toasts.Count);
foreach (UiEventToast uiEventToast in Toasts)
uiEventToast.Write(_worldPacket);
_worldPacket.WriteBit(Pushed);
_worldPacket.WriteBit(Created);
_worldPacket.WriteBits((uint)DisplayText, 3);
_worldPacket.WriteBit(IsBonusRoll);
_worldPacket.WriteBit(IsEncounterLoot);
_worldPacket.WriteBit(CraftingData != null);
_worldPacket.WriteBit(FirstCraftOperationID.HasValue);
_worldPacket.FlushBits();
Item.Write(_worldPacket);
Item.Write(_worldPacket);
if (FirstCraftOperationID.HasValue)
_worldPacket.WriteUInt32(FirstCraftOperationID.Value);
if (CraftingData != null)
CraftingData.Write(_worldPacket);
}
public ObjectGuid PlayerGUID;
@@ -444,7 +457,7 @@ namespace Game.Networking.Packets
public int SlotInBag;
public ItemInstance Item;
public int QuestLogItemID;// Item ID used for updating quest progress
// only set if different than real ID (similar to CreatureTemplate.KillCredit)
// only set if different than real ID (similar to CreatureTemplate.KillCredit)
public uint Quantity;
public uint QuantityInInventory;
public int DungeonEncounterID;
@@ -453,6 +466,9 @@ namespace Game.Networking.Packets
public uint BattlePetBreedQuality;
public int BattlePetLevel;
public ObjectGuid ItemGUID;
public List<UiEventToast> Toasts = new();
public CraftingData CraftingData;
public uint? FirstCraftOperationID;
public bool Pushed;
public DisplayType DisplayText;
public bool Created;
@@ -528,7 +544,7 @@ namespace Game.Networking.Packets
public EnchantmentLog() : base(ServerOpcodes.EnchantmentLog, ConnectionType.Instance) { }
public override void Write()
{
{
_worldPacket.WritePackedGuid(Owner);
_worldPacket.WritePackedGuid(Caster);
_worldPacket.WritePackedGuid(ItemGUID);
@@ -572,7 +588,7 @@ namespace Game.Networking.Packets
public uint SpellID;
public uint Cooldown;
}
class ItemEnchantTimeUpdate : ServerPacket
{
public ItemEnchantTimeUpdate() : base(ServerOpcodes.ItemEnchantTimeUpdate, ConnectionType.Instance) { }
@@ -741,7 +757,7 @@ namespace Game.Networking.Packets
}
public class ItemMod
{
{
public uint Value;
public ItemModifier Type;
@@ -858,7 +874,7 @@ namespace Game.Networking.Packets
public ItemInstance(Item item)
{
ItemID = item.GetEntry();
List<uint> bonusListIds = item.m_itemData.BonusListIDs;
List<uint> bonusListIds = item.GetBonusListIDs();
if (!bonusListIds.Empty())
{
ItemBonus = new();
@@ -984,8 +1000,44 @@ namespace Game.Networking.Packets
}
}
public class ItemBonusKey : IEquatable<ItemBonusKey>
{
public uint ItemID;
public List<uint> BonusListIDs = new();
public List<ItemMod> Modifications = new();
public void Write(WorldPacket data)
{
data.WriteUInt32(ItemID);
data.WriteInt32(BonusListIDs.Count);
data.WriteInt32(Modifications.Count);
if (!BonusListIDs.Empty())
foreach (var id in BonusListIDs)
data.WriteUInt32(id);
foreach (ItemMod modification in Modifications)
modification.Write(data);
}
public bool Equals(ItemBonusKey right)
{
if (ItemID != right.ItemID)
return false;
if (BonusListIDs != right.BonusListIDs)
return false;
if (Modifications != right.Modifications)
return false;
return true;
}
}
public class ItemEnchantData
{
public ItemEnchantData() { }
public ItemEnchantData(uint id, uint expiration, int charges, byte slot)
{
ID = id;
@@ -1093,4 +1145,16 @@ namespace Game.Networking.Packets
public ItemPurchaseRefundItem[] Items = new ItemPurchaseRefundItem[5];
public ItemPurchaseRefundCurrency[] Currencies = new ItemPurchaseRefundCurrency[5];
}
public struct UiEventToast
{
public int UiEventToastID;
public int Asset;
public void Write(WorldPacket data)
{
data.WriteInt32(UiEventToastID);
data.WriteInt32(Asset);
}
}
}
@@ -29,9 +29,11 @@ namespace Game.Networking.Packets
public override void Read()
{
Unit = _worldPacket.ReadPackedGuid();
IsSoftInteract = _worldPacket.HasBit();
}
public ObjectGuid Unit;
public bool IsSoftInteract;
}
public class LootResponse : ServerPacket
@@ -273,6 +275,9 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(MapID);
_worldPacket.WriteUInt32(RollTime);
_worldPacket.WriteUInt8((byte)ValidRolls);
foreach (var reason in LootRollIneligibleReason)
_worldPacket.WriteUInt32((uint)reason);
_worldPacket.WriteUInt8((byte)Method);
Item.Write(_worldPacket);
}
@@ -282,6 +287,7 @@ namespace Game.Networking.Packets
public uint RollTime;
public LootMethod Method;
public RollMask ValidRolls;
public Array<LootRollIneligibilityReason> LootRollIneligibleReason = new Array<LootRollIneligibilityReason>(4);
public LootItemData Item = new();
}
@@ -293,18 +293,6 @@ namespace Game.Networking.Packets
public float Delay = 0.0f;
}
class ShowMailbox : ServerPacket
{
public ShowMailbox() : base(ServerOpcodes.ShowMailbox) { }
public override void Write()
{
_worldPacket.WritePackedGuid(PostmasterGUID);
}
public ObjectGuid PostmasterGUID;
}
//Structs
public class MailAttachedItem
{
+26 -26
View File
@@ -58,21 +58,6 @@ namespace Game.Networking.Packets
uint AreaID;
}
public class BinderConfirm : ServerPacket
{
public BinderConfirm(ObjectGuid unit) : base(ServerOpcodes.BinderConfirm)
{
Unit = unit;
}
public override void Write()
{
_worldPacket.WritePackedGuid(Unit);
}
ObjectGuid Unit;
}
public class InvalidatePlayer : ServerPacket
{
public InvalidatePlayer() : base(ServerOpcodes.InvalidatePlayer) { }
@@ -124,11 +109,13 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(WeeklyQuantity.HasValue);
_worldPacket.WriteBit(TrackedQuantity.HasValue);
_worldPacket.WriteBit(MaxQuantity.HasValue);
_worldPacket.WriteBit(Unused901.HasValue);
_worldPacket.WriteBit(TotalEarned.HasValue);
_worldPacket.WriteBit(SuppressChatLog);
_worldPacket.WriteBit(QuantityChange.HasValue);
_worldPacket.WriteBit(QuantityGainSource.HasValue);
_worldPacket.WriteBit(QuantityLostSource.HasValue);
_worldPacket.WriteBit(QuantityGainSource.HasValue);
_worldPacket.WriteBit(FirstCraftOperationID.HasValue);
_worldPacket.WriteBit(LastSpendTime.HasValue);
_worldPacket.FlushBits();
if (WeeklyQuantity.HasValue)
@@ -140,29 +127,38 @@ namespace Game.Networking.Packets
if (MaxQuantity.HasValue)
_worldPacket.WriteInt32(MaxQuantity.Value);
if (Unused901.HasValue)
_worldPacket.WriteInt32(Unused901.Value);
if (TotalEarned.HasValue)
_worldPacket.WriteInt32(TotalEarned.Value);
if (QuantityChange.HasValue)
_worldPacket.WriteInt32(QuantityChange.Value);
if (QuantityLostSource.HasValue)
_worldPacket.WriteInt32(QuantityLostSource.Value);
if (QuantityGainSource.HasValue)
_worldPacket.WriteInt32(QuantityGainSource.Value);
if (QuantityLostSource.HasValue)
_worldPacket.WriteInt32(QuantityLostSource.Value);
if (FirstCraftOperationID.HasValue)
_worldPacket.WriteUInt32(FirstCraftOperationID.Value);
if (LastSpendTime.HasValue)
_worldPacket.WriteInt64(LastSpendTime.Value);
}
public uint Type;
public int Quantity;
public uint Flags;
public List<UiEventToast> Toasts = new();
public int? WeeklyQuantity;
public int? TrackedQuantity;
public int? MaxQuantity;
public int? Unused901;
public int? TotalEarned;
public int? QuantityChange;
public int? QuantityGainSource;
public int? QuantityLostSource;
public uint? FirstCraftOperationID;
public long? LastSpendTime;
public bool SuppressChatLog;
}
@@ -209,7 +205,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(data.MaxWeeklyQuantity.HasValue);
_worldPacket.WriteBit(data.TrackedQuantity.HasValue);
_worldPacket.WriteBit(data.MaxQuantity.HasValue);
_worldPacket.WriteBit(data.Unused901.HasValue);
_worldPacket.WriteBit(data.TotalEarned.HasValue);
_worldPacket.WriteBit(data.LastSpendTime.HasValue);
_worldPacket.WriteBits(data.Flags, 5);
_worldPacket.FlushBits();
@@ -221,8 +218,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(data.TrackedQuantity.Value);
if (data.MaxQuantity.HasValue)
_worldPacket.WriteInt32(data.MaxQuantity.Value);
if (data.Unused901.HasValue)
_worldPacket.WriteInt32(data.Unused901.Value);
if (data.TotalEarned.HasValue)
_worldPacket.WriteInt32(data.TotalEarned.Value);
if (data.LastSpendTime.HasValue)
_worldPacket.WriteInt64(data.LastSpendTime.Value);
}
}
@@ -236,7 +235,8 @@ namespace Game.Networking.Packets
public uint? MaxWeeklyQuantity; // Weekly Currency cap.
public uint? TrackedQuantity;
public int? MaxQuantity;
public int? Unused901;
public int? TotalEarned;
public long? LastSpendTime;
public byte Flags; // 0 = none,
}
}
@@ -106,6 +106,7 @@ namespace Game.Networking.Packets
data.ReadBit(); // HeightChangeFailed
data.ReadBit(); // RemoteTimeValid
bool hasInertia = data.HasBit();
bool hasAdvFlying = data.HasBit();
if (hasTransport)
ReadTransportInfo(data, ref movementInfo.transport);
@@ -113,13 +114,22 @@ namespace Game.Networking.Packets
if (hasInertia)
{
MovementInfo.Inertia inertia = new();
inertia.guid = data.ReadPackedGuid();
inertia.id = data.ReadInt32();
inertia.force = data.ReadPosition();
inertia.lifetime = data.ReadUInt32();
movementInfo.inertia = inertia;
}
if (hasAdvFlying)
{
MovementInfo.AdvFlying advFlying = new();
advFlying.forwardVelocity = data.ReadFloat();
advFlying.upVelocity = data.ReadFloat();
movementInfo.advFlying = advFlying;
}
if (hasFall)
{
movementInfo.jump.fallTime = data.ReadUInt32();
@@ -146,6 +156,7 @@ namespace Game.Networking.Packets
bool hasFallData = hasFallDirection || movementInfo.jump.fallTime != 0;
bool hasSpline = false; // todo 6.x send this infos
bool hasInertia = movementInfo.inertia.HasValue;
bool hasAdvFlying = movementInfo.advFlying.HasValue;
data.WritePackedGuid(movementInfo.Guid);
data.WriteUInt32((uint)movementInfo.GetMovementFlags());
@@ -176,6 +187,7 @@ namespace Game.Networking.Packets
data.WriteBit(false); // HeightChangeFailed
data.WriteBit(false); // RemoteTimeValid
data.WriteBit(hasInertia);
data.WriteBit(hasAdvFlying);
data.FlushBits();
if (hasTransportData)
@@ -183,11 +195,17 @@ namespace Game.Networking.Packets
if (hasInertia)
{
data.WritePackedGuid(movementInfo.inertia.Value.guid);
data.WriteInt32(movementInfo.inertia.Value.id);
data.WriteXYZ(movementInfo.inertia.Value.force);
data.WriteUInt32(movementInfo.inertia.Value.lifetime);
}
if (hasAdvFlying)
{
data.WriteFloat(movementInfo.advFlying.Value.forwardVelocity);
data.WriteFloat(movementInfo.advFlying.Value.upVelocity);
}
if (hasFallData)
{
data.WriteUInt32(movementInfo.jump.fallTime);
@@ -514,7 +532,7 @@ namespace Game.Networking.Packets
}
public ObjectGuid MoverGUID;
public uint SequenceIndex = 0; // Unit movement packet index, incremented each time
public uint SequenceIndex; // Unit movement packet index, incremented each time
public float Speed = 1.0f;
}
@@ -555,7 +573,7 @@ namespace Game.Networking.Packets
}
public ObjectGuid MoverGUID;
public uint SequenceIndex = 0; // Unit movement packet index, incremented each time
public uint SequenceIndex; // Unit movement packet index, incremented each time
}
public class TransferPending : ServerPacket
@@ -1167,6 +1185,12 @@ namespace Game.Networking.Packets
public float InitVertSpeed;
}
public class SpeedRange
{
public float Min;
public float Max;
}
public class MoveStateChange
{
public MoveStateChange(ServerOpcodes messageId, uint sequenceIndex)
@@ -1180,12 +1204,13 @@ namespace Game.Networking.Packets
data.WriteUInt16((ushort)MessageID);
data.WriteUInt32(SequenceIndex);
data.WriteBit(Speed.HasValue);
data.WriteBit(SpeedRange != null);
data.WriteBit(KnockBack.HasValue);
data.WriteBit(VehicleRecID.HasValue);
data.WriteBit(CollisionHeight.HasValue);
data.WriteBit(@MovementForce != null);
data.WriteBit(MovementForceGUID.HasValue);
data.WriteBit(MovementInertiaGUID.HasValue);
data.WriteBit(MovementInertiaID.HasValue);
data.WriteBit(MovementInertiaLifetimeMs.HasValue);
data.FlushBits();
@@ -1195,6 +1220,12 @@ namespace Game.Networking.Packets
if (Speed.HasValue)
data.WriteFloat(Speed.Value);
if (SpeedRange != null)
{
data.WriteFloat(SpeedRange.Min);
data.WriteFloat(SpeedRange.Max);
}
if (KnockBack.HasValue)
{
data.WriteFloat(KnockBack.Value.HorzSpeed);
@@ -1216,8 +1247,8 @@ namespace Game.Networking.Packets
if (MovementForceGUID.HasValue)
data.WritePackedGuid(MovementForceGUID.Value);
if (MovementInertiaGUID.HasValue)
data.WritePackedGuid(MovementInertiaGUID.Value);
if (MovementInertiaID.HasValue)
data.WriteInt32(MovementInertiaID.Value);
if (MovementInertiaLifetimeMs.HasValue)
data.WriteUInt32(MovementInertiaLifetimeMs.Value);
@@ -1226,12 +1257,13 @@ namespace Game.Networking.Packets
public ServerOpcodes MessageID;
public uint SequenceIndex;
public float? Speed;
public SpeedRange SpeedRange;
public KnockBackInfo? KnockBack;
public int? VehicleRecID;
public CollisionHeightInfo? CollisionHeight;
public MovementForce MovementForce;
public ObjectGuid? MovementForceGUID;
public ObjectGuid? MovementInertiaGUID;
public int? MovementInertiaID;
public uint? MovementInertiaLifetimeMs;
}
}
+88 -67
View File
@@ -43,6 +43,23 @@ namespace Game.Networking.Packets
public ObjectGuid Unit;
}
public class NPCInteractionOpenResult : ServerPacket
{
public NPCInteractionOpenResult() : base(ServerOpcodes.NpcInteractionOpenResult) { }
public override void Write()
{
_worldPacket.WritePackedGuid(Npc);
_worldPacket.WriteInt32((int)InteractionType);
_worldPacket.WriteBit(Success);
_worldPacket.FlushBits();
}
public ObjectGuid Npc;
public PlayerInteractionType InteractionType;
public bool Success = true;
}
public class GossipMessagePkt : ServerPacket
{
public GossipMessagePkt() : base(ServerOpcodes.GossipMessage) { }
@@ -52,33 +69,20 @@ namespace Game.Networking.Packets
_worldPacket.WritePackedGuid(GossipGUID);
_worldPacket.WriteUInt32(GossipID);
_worldPacket.WriteInt32(FriendshipFactionID);
_worldPacket.WriteInt32(TextID);
_worldPacket.WriteInt32(GossipOptions.Count);
_worldPacket.WriteInt32(GossipText.Count);
_worldPacket.WriteBit(TextID.HasValue);
_worldPacket.WriteBit(TextID2.HasValue);
_worldPacket.FlushBits();
foreach (ClientGossipOptions options in GossipOptions)
{
_worldPacket.WriteInt32(options.ClientOption);
_worldPacket.WriteUInt8((byte)options.OptionNPC);
_worldPacket.WriteUInt8(options.OptionFlags);
_worldPacket.WriteInt32(options.OptionCost);
_worldPacket.WriteUInt32(options.OptionLanguage);
options.Write(_worldPacket);
_worldPacket.WriteBits(options.Text.GetByteCount(), 12);
_worldPacket.WriteBits(options.Confirm.GetByteCount(), 12);
_worldPacket.WriteBits((byte)options.Status, 2);
_worldPacket.WriteBit(options.SpellID.HasValue);
_worldPacket.FlushBits();
if (TextID.HasValue)
_worldPacket.WriteInt32(TextID.Value);
options.Treasure.Write(_worldPacket);
_worldPacket.WriteString(options.Text);
_worldPacket.WriteString(options.Confirm);
if (options.SpellID.HasValue)
_worldPacket.WriteInt32(options.SpellID.Value);
}
if (TextID2.HasValue)
_worldPacket.WriteInt32(TextID2.Value);
foreach (ClientGossipText text in GossipText)
text.Write(_worldPacket);
@@ -88,7 +92,8 @@ namespace Game.Networking.Packets
public int FriendshipFactionID;
public ObjectGuid GossipGUID;
public List<ClientGossipText> GossipText = new();
public int TextID;
public int? TextID;
public int? TextID2;
public uint GossipID;
}
@@ -100,18 +105,38 @@ namespace Game.Networking.Packets
{
GossipUnit = _worldPacket.ReadPackedGuid();
GossipID = _worldPacket.ReadUInt32();
GossipIndex = _worldPacket.ReadUInt32();
GossipOptionID = _worldPacket.ReadInt32();
uint length = _worldPacket.ReadBits<uint>(8);
PromotionCode = _worldPacket.ReadString(length);
}
public ObjectGuid GossipUnit;
public uint GossipIndex;
public int GossipOptionID;
public uint GossipID;
public string PromotionCode;
}
class GossipOptionNPCInteraction : ServerPacket
{
public GossipOptionNPCInteraction() : base(ServerOpcodes.GossipOptionNpcInteraction) { }
public override void Write()
{
_worldPacket.WritePackedGuid(GossipGUID);
_worldPacket.WriteInt32(GossipNpcOptionID);
_worldPacket.WriteBit(FriendshipFactionID.HasValue);
_worldPacket.FlushBits();
if (FriendshipFactionID.HasValue)
_worldPacket.WriteInt32(FriendshipFactionID.Value);
}
public ObjectGuid GossipGUID;
public int GossipNpcOptionID;
public int? FriendshipFactionID;
}
public class GossipComplete : ServerPacket
{
public bool SuppressSound;
@@ -181,30 +206,6 @@ namespace Game.Networking.Packets
public string Greeting;
}
public class ShowBank : ServerPacket
{
public ShowBank() : base(ServerOpcodes.ShowBank, ConnectionType.Instance) { }
public override void Write()
{
_worldPacket.WritePackedGuid(Guid);
}
public ObjectGuid Guid;
}
public class PlayerTabardVendorActivate : ServerPacket
{
public PlayerTabardVendorActivate() : base(ServerOpcodes.PlayerTabardVendorActivate) { }
public override void Write()
{
_worldPacket.WritePackedGuid(Vendor);
}
public ObjectGuid Vendor;
}
class GossipPOI : ServerPacket
{
public GossipPOI() : base(ServerOpcodes.GossipPoi) { }
@@ -243,18 +244,6 @@ namespace Game.Networking.Packets
public ObjectGuid Healer;
}
public class SpiritHealerConfirm : ServerPacket
{
public SpiritHealerConfirm() : base(ServerOpcodes.SpiritHealerConfirm) { }
public override void Write()
{
_worldPacket.WritePackedGuid(Unit);
}
public ObjectGuid Unit;
}
class TrainerBuySpell : ClientPacket
{
public TrainerBuySpell(WorldPacket packet) : base(packet) { }
@@ -344,16 +333,47 @@ namespace Game.Networking.Packets
public class ClientGossipOptions
{
public int ClientOption;
public int GossipOptionID;
public GossipOptionNpc OptionNPC;
public byte OptionFlags;
public int OptionCost;
public uint OptionLanguage;
public GossipOptionFlags Flags;
public int OrderIndex;
public GossipOptionStatus Status;
public string Text;
public string Confirm;
public string Text = "";
public string Confirm = "";
public TreasureLootList Treasure = new();
public int? SpellID;
public int? OverrideIconID;
public void Write(WorldPacket data)
{
data.WriteInt32(GossipOptionID);
data.WriteUInt8((byte)OptionNPC);
data.WriteInt8((sbyte)OptionFlags);
data.WriteInt32(OptionCost);
data.WriteUInt32(OptionLanguage);
data.WriteInt32((int)Flags);
data.WriteInt32(OrderIndex);
data.WriteBits(Text.GetByteCount(), 12);
data.WriteBits(Confirm.GetByteCount(), 12);
data.WriteBits((byte)Status, 2);
data.WriteBit(SpellID.HasValue);
data.WriteBit(OverrideIconID.HasValue);
data.FlushBits();
Treasure.Write(data);
data.WriteString(Text);
data.WriteString(Confirm);
if (SpellID.HasValue)
data.WriteInt32(SpellID.Value);
if (OverrideIconID.HasValue)
data.WriteInt32(OverrideIconID.Value);
}
}
public class ClientGossipText
@@ -386,19 +406,20 @@ namespace Game.Networking.Packets
{
public void Write(WorldPacket data)
{
data.WriteInt32(MuID);
data.WriteInt32(Type);
data.WriteInt32(Quantity);
data.WriteUInt64(Price);
data.WriteInt32(MuID);
data.WriteInt32(Durability);
data.WriteInt32(StackCount);
data.WriteInt32(Quantity);
data.WriteInt32(ExtendedCostID);
data.WriteInt32(PlayerConditionFailed);
Item.Write(data);
data.WriteBits(Type, 3);
data.WriteBit(Locked);
data.WriteBit(DoNotFilterOnVendor);
data.WriteBit(Refundable);
data.FlushBits();
Item.Write(data);
}
public int MuID;
+66 -3
View File
@@ -197,6 +197,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(Info.Expansion);
_worldPacket.WriteInt32(Info.ManagedWorldStateID);
_worldPacket.WriteInt32(Info.QuestSessionBonus);
_worldPacket.WriteInt32(Info.QuestGiverCreatureID);
_worldPacket.WriteInt32(Info.ConditionalQuestDescription.Count);
_worldPacket.WriteInt32(Info.ConditionalQuestCompletionLog.Count);
foreach (QuestCompleteDisplaySpell rewardDisplaySpell in Info.RewardDisplaySpell)
rewardDisplaySpell.Write(_worldPacket);
@@ -243,6 +247,12 @@ namespace Game.Networking.Packets
_worldPacket.WriteString(Info.PortraitTurnInText);
_worldPacket.WriteString(Info.PortraitTurnInName);
_worldPacket.WriteString(Info.QuestCompletionLog);
foreach (ConditionalQuestText conditionalQuestText in Info.ConditionalQuestDescription)
conditionalQuestText.Write(_worldPacket);
foreach (ConditionalQuestText conditionalQuestText in Info.ConditionalQuestCompletionLog)
conditionalQuestText.Write(_worldPacket);
}
}
@@ -315,6 +325,8 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(PortraitGiverMount);
_worldPacket.WriteInt32(PortraitGiverModelSceneID);
_worldPacket.WriteUInt32(PortraitTurnIn);
_worldPacket.WriteUInt32(QuestGiverCreatureID);
_worldPacket.WriteInt32(ConditionalRewardText.Count);
_worldPacket.WriteBits(QuestTitle.GetByteCount(), 9);
_worldPacket.WriteBits(RewardText.GetByteCount(), 12);
@@ -322,6 +334,10 @@ namespace Game.Networking.Packets
_worldPacket.WriteBits(PortraitGiverName.GetByteCount(), 8);
_worldPacket.WriteBits(PortraitTurnInText.GetByteCount(), 10);
_worldPacket.WriteBits(PortraitTurnInName.GetByteCount(), 8);
_worldPacket.FlushBits();
foreach (ConditionalQuestText conditionalQuestText in ConditionalRewardText)
conditionalQuestText.Write(_worldPacket);
_worldPacket.WriteString(QuestTitle);
_worldPacket.WriteString(RewardText);
@@ -335,12 +351,14 @@ namespace Game.Networking.Packets
public uint PortraitGiver;
public uint PortraitGiverMount;
public int PortraitGiverModelSceneID;
public uint QuestGiverCreatureID;
public string QuestTitle = "";
public string RewardText = "";
public string PortraitGiverText = "";
public string PortraitGiverName = "";
public string PortraitTurnInText = "";
public string PortraitTurnInName = "";
public List<ConditionalQuestText> ConditionalRewardText = new();
public QuestGiverOfferReward QuestData;
public uint QuestPackageID;
}
@@ -437,12 +455,15 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(PortraitTurnIn);
_worldPacket.WriteUInt32(QuestFlags[0]); // Flags
_worldPacket.WriteUInt32(QuestFlags[1]); // FlagsEx
_worldPacket.WriteUInt32(QuestFlags[2]); // FlagsEx
_worldPacket.WriteUInt32(SuggestedPartyMembers);
_worldPacket.WriteInt32(LearnSpells.Count);
_worldPacket.WriteInt32(DescEmotes.Count);
_worldPacket.WriteInt32(Objectives.Count);
_worldPacket.WriteInt32(QuestStartItemID);
_worldPacket.WriteInt32(QuestSessionBonus);
_worldPacket.WriteInt32(QuestGiverCreatureID);
_worldPacket.WriteInt32(ConditionalDescriptionText.Count);
foreach (uint spell in LearnSpells)
_worldPacket.WriteUInt32(spell);
@@ -483,13 +504,16 @@ namespace Game.Networking.Packets
_worldPacket.WriteString(PortraitGiverName);
_worldPacket.WriteString(PortraitTurnInText);
_worldPacket.WriteString(PortraitTurnInName);
foreach (ConditionalQuestText conditionalQuestText in ConditionalDescriptionText)
conditionalQuestText.Write(_worldPacket);
}
public ObjectGuid QuestGiverGUID;
public ObjectGuid InformUnit;
public uint QuestID;
public int QuestPackageID;
public uint[] QuestFlags = new uint[2];
public uint[] QuestFlags = new uint[3];
public uint SuggestedPartyMembers;
public QuestRewards Rewards = new();
public List<QuestObjectiveSimple> Objectives = new();
@@ -501,6 +525,7 @@ namespace Game.Networking.Packets
public int PortraitGiverModelSceneID;
public int QuestStartItemID;
public int QuestSessionBonus;
public int QuestGiverCreatureID;
public string PortraitGiverText = "";
public string PortraitGiverName = "";
public string PortraitTurnInText = "";
@@ -508,6 +533,7 @@ namespace Game.Networking.Packets
public string QuestTitle = "";
public string LogDescription = "";
public string DescriptionText = "";
public List<ConditionalQuestText> ConditionalDescriptionText = new();
public bool DisplayPopup;
public bool StartCheat;
public bool AutoLaunched;
@@ -526,6 +552,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(CompEmoteType);
_worldPacket.WriteUInt32(QuestFlags[0]);
_worldPacket.WriteUInt32(QuestFlags[1]);
_worldPacket.WriteUInt32(QuestFlags[2]);
_worldPacket.WriteUInt32(SuggestPartyMembers);
_worldPacket.WriteInt32(MoneyToGet);
_worldPacket.WriteInt32(Collect.Count);
@@ -547,8 +574,15 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(AutoLaunched);
_worldPacket.FlushBits();
_worldPacket.WriteUInt32(QuestGiverCreatureID);
_worldPacket.WriteInt32(ConditionalCompletionText.Count);
_worldPacket.WriteBits(QuestTitle.GetByteCount(), 9);
_worldPacket.WriteBits(CompletionText.GetByteCount(), 12);
_worldPacket.FlushBits();
foreach (ConditionalQuestText conditionalQuestText in ConditionalCompletionText)
conditionalQuestText.Write(_worldPacket);
_worldPacket.WriteString(QuestTitle);
_worldPacket.WriteString(CompletionText);
@@ -565,9 +599,10 @@ namespace Game.Networking.Packets
public List<QuestObjectiveCollect> Collect = new();
public List<QuestCurrency> Currency = new();
public int StatusFlags;
public uint[] QuestFlags = new uint[2];
public uint[] QuestFlags = new uint[3];
public string QuestTitle = "";
public string CompletionText = "";
public List<ConditionalQuestText> ConditionalCompletionText = new();
}
public class QuestGiverRequestReward : ClientPacket
@@ -937,6 +972,30 @@ namespace Game.Networking.Packets
}
}
public class ConditionalQuestText
{
public int PlayerConditionID;
public int QuestGiverCreatureID;
public string Text = "";
public ConditionalQuestText(int playerConditionID, int questGiverCreatureID, string text)
{
PlayerConditionID = playerConditionID;
QuestGiverCreatureID = questGiverCreatureID;
Text = text;
}
public void Write(WorldPacket data)
{
data.WriteInt32(PlayerConditionID);
data.WriteInt32(QuestGiverCreatureID);
data.WriteBits(Text.GetByteCount(), 12);
data.FlushBits();
data.WriteString(Text);
}
}
public class QuestInfo
{
public QuestInfo()
@@ -1008,7 +1067,10 @@ namespace Game.Networking.Packets
public int Expansion;
public int ManagedWorldStateID;
public int QuestSessionBonus;
public int QuestGiverCreatureID; // used to select ConditionalQuestText
public List<QuestObjective> Objectives = new();
public List<ConditionalQuestText> ConditionalQuestDescription = new();
public List<ConditionalQuestText> ConditionalQuestCompletionLog = new();
public uint[] RewardItems = new uint[SharedConst.QuestRewardItemCount];
public uint[] RewardAmount = new uint[SharedConst.QuestRewardItemCount];
public int[] ItemDrop = new int[SharedConst.QuestItemDropCount];
@@ -1144,6 +1206,7 @@ namespace Game.Networking.Packets
data.WriteUInt32(QuestID);
data.WriteUInt32(QuestFlags[0]); // Flags
data.WriteUInt32(QuestFlags[1]); // FlagsEx
data.WriteUInt32(QuestFlags[2]); // FlagsEx2
data.WriteUInt32(SuggestedPartyMembers);
data.WriteInt32(Emotes.Count);
@@ -1167,7 +1230,7 @@ namespace Game.Networking.Packets
public uint SuggestedPartyMembers = 0;
public QuestRewards Rewards = new();
public List<QuestDescEmote> Emotes = new();
public uint[] QuestFlags = new uint[2]; // Flags and FlagsEx
public uint[] QuestFlags = new uint[3]; // Flags and FlagsEx
}
public struct QuestObjectiveSimple
@@ -22,7 +22,7 @@ namespace Game.Networking.Packets
{
public class InitializeFactions : ServerPacket
{
const ushort FactionCount = 400;
const ushort FactionCount = 443;
public InitializeFactions() : base(ServerOpcodes.InitializeFactions, ConnectionType.Instance) { }
@@ -30,7 +30,7 @@ namespace Game.Networking.Packets
{
for (ushort i = 0; i < FactionCount; ++i)
{
_worldPacket.WriteUInt8((byte)((ushort)FactionFlags[i] & 0xFF));
_worldPacket.WriteUInt16((ushort)((ushort)FactionFlags[i] & 0xFF));
_worldPacket.WriteInt32(FactionStandings[i]);
}
@@ -72,7 +72,6 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteFloat(ReferAFriendBonus);
_worldPacket.WriteFloat(BonusFromAchievementSystem);
_worldPacket.WriteInt32(Faction.Count);
@@ -83,7 +82,6 @@ namespace Game.Networking.Packets
_worldPacket.FlushBits();
}
public float ReferAFriendBonus;
public float BonusFromAchievementSystem;
public List<FactionStandingData> Faction = new();
public bool ShowVisual;
+60 -36
View File
@@ -305,23 +305,13 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt32(SpellID.Count);
_worldPacket.WriteInt32(Superceded.Count);
_worldPacket.WriteInt32(FavoriteSpellID.Count);
_worldPacket.WriteInt32(ClientLearnedSpellData.Count);
foreach (var spellId in SpellID)
_worldPacket.WriteUInt32(spellId);
foreach (var spellId in Superceded)
_worldPacket.WriteUInt32(spellId);
foreach (var spellId in FavoriteSpellID)
_worldPacket.WriteInt32(spellId);
foreach (LearnedSpellInfo spell in ClientLearnedSpellData)
spell.Write(_worldPacket);
}
public List<uint> SpellID = new();
public List<uint> Superceded = new();
public List<int> FavoriteSpellID = new();
public List<LearnedSpellInfo> ClientLearnedSpellData = new();
}
public class LearnedSpells : ServerPacket
@@ -330,22 +320,16 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WriteInt32(SpellID.Count);
_worldPacket.WriteInt32(FavoriteSpellID.Count);
_worldPacket.WriteInt32(ClientLearnedSpellData.Count);
_worldPacket.WriteUInt32(SpecializationID);
foreach (uint spell in SpellID)
_worldPacket.WriteUInt32(spell);
foreach (int spell in FavoriteSpellID)
_worldPacket.WriteInt32(spell);
_worldPacket.WriteBit(SuppressMessaging);
_worldPacket.FlushBits();
foreach (LearnedSpellInfo spell in ClientLearnedSpellData)
spell.Write(_worldPacket);
}
public List<uint> SpellID = new();
public List<int> FavoriteSpellID = new();
public List<LearnedSpellInfo> ClientLearnedSpellData = new();
public uint SpecializationID;
public bool SuppressMessaging;
}
@@ -998,10 +982,12 @@ namespace Game.Networking.Packets
{
SpellClickUnitGuid = _worldPacket.ReadPackedGuid();
TryAutoDismount = _worldPacket.HasBit();
IsSoftInteract = _worldPacket.HasBit();
}
public ObjectGuid SpellClickUnitGuid;
public bool TryAutoDismount;
public bool IsSoftInteract;
}
class ResyncRunes : ServerPacket
@@ -1520,7 +1506,7 @@ namespace Game.Networking.Packets
{
public void Read(WorldPacket data)
{
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(26);
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(28);
if (data.HasBit())
SrcLocation = new();
@@ -1552,7 +1538,7 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data)
{
data.WriteBits((uint)Flags, 26);
data.WriteBits((uint)Flags, 28);
data.WriteBit(SrcLocation != null);
data.WriteBit(DstLocation != null);
data.WriteBit(Orientation.HasValue);
@@ -1607,15 +1593,20 @@ namespace Game.Networking.Packets
public uint Quantity;
}
public struct SpellOptionalReagent
public struct SpellCraftingReagent
{
public int ItemID;
public int Slot;
public int DataSlotIndex;
public int Quantity;
public byte? Unknown_1000;
public void Read(WorldPacket data)
{
ItemID = data.ReadInt32();
Slot = data.ReadInt32();
DataSlotIndex = data.ReadInt32();
Quantity = data.ReadInt32();
if (data.HasBit())
Unknown_1000 = data.ReadUInt8();
}
}
@@ -1641,8 +1632,9 @@ namespace Game.Networking.Packets
public MissileTrajectoryRequest MissileTrajectory;
public MovementInfo MoveUpdate;
public List<SpellWeight> Weight = new();
public Array<SpellOptionalReagent> OptionalReagents = new(3);
public Array<SpellCraftingReagent> OptionalReagents = new(3);
public Array<SpellExtraCurrencyCost> OptionalCurrencies = new(5 /*MAX_ITEM_EXT_COST_CURRENCIES*/);
public ulong? CraftingOrderID;
public ObjectGuid CraftingNPC;
public uint[] Misc = new uint[2];
@@ -1658,21 +1650,25 @@ namespace Game.Networking.Packets
MissileTrajectory.Read(data);
CraftingNPC = data.ReadPackedGuid();
var optionalReagents = data.ReadUInt32();
var optionalCurrencies = data.ReadUInt32();
for (var i = 0; i < optionalReagents; ++i)
OptionalReagents[i].Read(data);
var optionalReagents = data.ReadUInt32();
for (var i = 0; i < optionalCurrencies; ++i)
OptionalCurrencies[i].Read(data);
SendCastFlags = data.ReadBits<uint>(5);
bool hasMoveUpdate = data.HasBit();
bool hasCraftingOrderID = data.HasBit();
var weightCount = data.ReadBits<uint>(2);
Target.Read(data);
if (hasCraftingOrderID)
CraftingOrderID = data.ReadUInt64();
for (var i = 0; i < optionalReagents; ++i)
OptionalReagents[i].Read(data);
if (hasMoveUpdate)
MoveUpdate = MovementExtensions.ReadMovementInfo(data);
@@ -1884,6 +1880,34 @@ namespace Game.Networking.Packets
public SpellHealPrediction Predict;
}
public struct LearnedSpellInfo
{
public uint SpellID;
public bool IsFavorite;
public int? field_8;
public int? Superceded;
public int? TraitDefinitionID;
public void Write(WorldPacket data)
{
data.WriteUInt32(SpellID);
data.WriteBit(IsFavorite);
data.WriteBit(field_8.HasValue);
data.WriteBit(Superceded.HasValue);
data.WriteBit(TraitDefinitionID.HasValue);
data.FlushBits();
if (field_8.HasValue)
data.WriteInt32(field_8.Value);
if (Superceded.HasValue)
data.WriteInt32(Superceded.Value);
if (TraitDefinitionID.HasValue)
data.WriteInt32(TraitDefinitionID.Value);
}
}
public struct SpellModifierData
{
public float ModifierValue;
@@ -58,6 +58,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt16(MaxPlayerNameQueriesPerPacket);
_worldPacket.WriteInt16(PlayerNameQueryTelemetryInterval);
_worldPacket.WriteUInt32((uint)PlayerNameQueryInterval.TotalSeconds);
foreach (GameRuleValuePair gameRuleValue in GameRuleValues)
gameRuleValue.Write(_worldPacket);
@@ -70,6 +71,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(BpayStoreDisabledByParentalControls);
_worldPacket.WriteBit(ItemRestorationButtonEnabled);
_worldPacket.WriteBit(BrowserEnabled);
_worldPacket.WriteBit(SessionAlert.HasValue);
_worldPacket.WriteBit(RAFSystem.Enabled);
_worldPacket.WriteBit(RAFSystem.RecruitingEnabled);
@@ -78,6 +80,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(CommerceSystemEnabled);
_worldPacket.WriteBit(TutorialsEnabled);
_worldPacket.WriteBit(TwitterEnabled);
_worldPacket.WriteBit(Unk67);
_worldPacket.WriteBit(WillKickFromWorld);
_worldPacket.WriteBit(KioskModeEnabled);
@@ -86,6 +89,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(WarModeFeatureEnabled);
_worldPacket.WriteBit(ClubsEnabled);
_worldPacket.WriteBit(ClubsBattleNetClubTypeAllowed);
_worldPacket.WriteBit(ClubsCharacterClubTypeAllowed);
_worldPacket.WriteBit(ClubsPresenceUpdateEnabled);
_worldPacket.WriteBit(VoiceChatDisabledByParentalControl);
@@ -94,10 +98,14 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(IsMuted);
_worldPacket.WriteBit(ClubFinderEnabled);
_worldPacket.WriteBit(Unknown901CheckoutRelated);
_worldPacket.WriteBit(TextToSpeechFeatureEnabled);
_worldPacket.WriteBit(ChatDisabledByDefault);
_worldPacket.WriteBit(ChatDisabledByPlayer);
_worldPacket.WriteBit(LFGListCustomRequiresAuthenticator);
_worldPacket.WriteBit(AddonsDisabled);
_worldPacket.WriteBit(Unused1000);
_worldPacket.FlushBits();
{
@@ -164,6 +172,7 @@ namespace Game.Networking.Packets
public int ActiveSeason; // Currently active Classic season
public short MaxPlayerNameQueriesPerPacket = 50;
public short PlayerNameQueryTelemetryInterval = 600;
public TimeSpan PlayerNameQueryInterval = TimeSpan.FromSeconds(10);
public bool ItemRestorationButtonEnabled;
public bool CharUndeleteEnabled; // Implemented
public bool BpayStoreDisabledByParentalControls;
@@ -192,6 +201,8 @@ namespace Game.Networking.Packets
public bool ChatDisabledByDefault;
public bool ChatDisabledByPlayer;
public bool LFGListCustomRequiresAuthenticator;
public bool AddonsDisabled;
public bool Unused1000;
public SocialQueueConfig QuickJoinConfig;
public SquelchInfo Squelch;
@@ -264,6 +275,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(Unk14);
_worldPacket.WriteBit(WillKickFromWorld);
_worldPacket.WriteBit(IsExpansionPreorderInStore);
_worldPacket.WriteBit(KioskModeEnabled);
_worldPacket.WriteBit(CompetitiveModeEnabled);
_worldPacket.WriteBit(TrialBoostEnabled);
@@ -272,9 +284,12 @@ namespace Game.Networking.Packets
_worldPacket.WriteBit(LiveRegionCharacterCopyEnabled);
_worldPacket.WriteBit(LiveRegionAccountCopyEnabled);
_worldPacket.WriteBit(LiveRegionKeyBindingsCopyEnabled);
_worldPacket.WriteBit(Unknown901CheckoutRelated);
_worldPacket.WriteBit(EuropaTicketSystemStatus.HasValue);
_worldPacket.WriteBit(LaunchETA.HasValue);
_worldPacket.WriteBit(AddonsDisabled);
_worldPacket.WriteBit(Unused1000);
_worldPacket.FlushBits();
if (EuropaTicketSystemStatus.HasValue)
@@ -294,6 +309,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(GameRuleValues.Count);
_worldPacket.WriteInt16(MaxPlayerNameQueriesPerPacket);
_worldPacket.WriteInt16(PlayerNameQueryTelemetryInterval);
_worldPacket.WriteUInt32((uint)PlayerNameQueryInterval.TotalSeconds);
if (LaunchETA.HasValue)
_worldPacket.WriteInt32(LaunchETA.Value);
@@ -320,8 +336,10 @@ namespace Game.Networking.Packets
public bool LiveRegionCharacterListEnabled; // NYI
public bool LiveRegionCharacterCopyEnabled; // NYI
public bool LiveRegionAccountCopyEnabled; // NYI
public bool LiveRegionKeyBindingsCopyEnabled = false;
public bool Unknown901CheckoutRelated = false; // NYI
public bool LiveRegionKeyBindingsCopyEnabled;
public bool Unknown901CheckoutRelated; // NYI
public bool AddonsDisabled;
public bool Unused1000;
public EuropaTicketConfig? EuropaTicketSystemStatus;
public List<int> LiveRegionCharacterCopySourceRegions = new();
public uint TokenPollTimeSeconds; // NYI
@@ -337,6 +355,7 @@ namespace Game.Networking.Packets
public List<GameRuleValuePair> GameRuleValues = new();
public short MaxPlayerNameQueriesPerPacket = 50;
public short PlayerNameQueryTelemetryInterval = 600;
public TimeSpan PlayerNameQueryInterval = TimeSpan.FromSeconds(10);
public int? LaunchETA;
}
@@ -368,12 +387,18 @@ namespace Game.Networking.Packets
{
_worldPacket.WriteBits(ServerTimeTZ.GetByteCount(), 7);
_worldPacket.WriteBits(GameTimeTZ.GetByteCount(), 7);
_worldPacket.WriteBits(ServerRegionalTZ.GetByteCount(), 7);
_worldPacket.FlushBits();
_worldPacket.WriteString(ServerTimeTZ);
_worldPacket.WriteString(GameTimeTZ);
_worldPacket.WriteString(ServerRegionalTZ);
}
public string ServerTimeTZ;
public string GameTimeTZ;
public string ServerRegionalTZ;
}
public struct SavedThrottleObjectState
@@ -0,0 +1,84 @@
/*
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.Entities;
using System.Collections.Generic;
using System;
namespace Game.Networking.Packets
{
public struct TraitEntry
{
public int TraitNodeID;
public int TraitNodeEntryID;
public int Rank;
public int GrantedRanks;
public void Write(WorldPacket data)
{
data.WriteInt32(TraitNodeID);
data.WriteInt32(TraitNodeEntryID);
data.WriteInt32(Rank);
data.WriteInt32(GrantedRanks);
}
}
public class TraitConfig
{
public int ID;
public TraitConfigType Type;
public int ChrSpecializationID = 0;
public TraitCombatConfigFlags CombatConfigFlags;
public int LocalIdentifier; // Local to specialization
public int SkillLineID;
public int TraitSystemID;
public List<TraitEntry> Entries = new();
public string Name = "";
public void Write(WorldPacket data)
{
data.WriteInt32(ID);
data.WriteInt32((int)Type);
data.WriteInt32(Entries.Count);
switch (Type)
{
case TraitConfigType.Combat:
data.WriteInt32(ChrSpecializationID);
data.WriteInt32((int)CombatConfigFlags);
data.WriteInt32(LocalIdentifier);
break;
case TraitConfigType.Profession:
data.WriteInt32(SkillLineID);
break;
case TraitConfigType.Generic:
data.WriteInt32(TraitSystemID);
break;
default:
break;
}
foreach (TraitEntry traitEntry in Entries)
traitEntry.Write(data);
data.WriteBits(Name.GetByteCount(), 9);
data.FlushBits();
data.WriteString(Name);
}
}
}
@@ -69,21 +69,6 @@ namespace Game.Networking.Packets
public List<uint> NewAppearances = new();
}
class TransmogrifyNPC : ServerPacket
{
public TransmogrifyNPC(ObjectGuid guid) : base(ServerOpcodes.TransmogrifyNpc, ConnectionType.Instance)
{
Guid = guid;
}
public override void Write()
{
_worldPacket.WritePackedGuid(Guid);
}
ObjectGuid Guid;
}
struct TransmogrifyItem
{
public void Read(WorldPacket data)