Core: Updated to 10.0.2
Port From (https://github.com/TrinityCore/TrinityCore/commit/e98e1283ea0034baf6be9aa2ffb386eb5582801b)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user