Core/PacketIO: Updated packet structures to 9.2.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/9f30afe3528441571f89cb2e1775c756774fa0cd)
This commit is contained in:
@@ -31,12 +31,13 @@ namespace Framework.Constants
|
||||
PerCharacterTtsCache = 9,
|
||||
GlobalFlaggedCache = 10,
|
||||
PerCharacterFlaggedCache = 11,
|
||||
PerCharacterClickBindingsCache = 12,
|
||||
|
||||
Max = 12,
|
||||
Max = 13,
|
||||
|
||||
AllAccountDataCacheMask = 0xFFF,
|
||||
AllAccountDataCacheMask = 0x1FFF,
|
||||
GlobalCacheMask = 0x515,
|
||||
PerCharacterCacheMask = 0xAEA
|
||||
PerCharacterCacheMask = 0x1AEA
|
||||
}
|
||||
|
||||
public enum TutorialAction
|
||||
|
||||
@@ -40,7 +40,8 @@ namespace Framework.Constants
|
||||
Unk = 2,
|
||||
Polygon = 3,
|
||||
Cylinder = 4,
|
||||
Max = 5
|
||||
Disk = 5,
|
||||
Max
|
||||
}
|
||||
|
||||
public enum AreaTriggerActionTypes
|
||||
|
||||
@@ -93,4 +93,11 @@ namespace Framework.Constants
|
||||
InterpolatedTurning = 0x40000,
|
||||
InterpolatedPitching = 0x80000
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum MovementFlags3
|
||||
{
|
||||
None = 0x00,
|
||||
DisableInertia = 0x01,
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -213,7 +213,7 @@ namespace Framework.Constants
|
||||
/// <summary>
|
||||
/// AreaTrigger Const
|
||||
/// </summary>
|
||||
public const int MaxAreatriggerEntityData = 6;
|
||||
public const int MaxAreatriggerEntityData = 8;
|
||||
public const int MaxAreatriggerScale = 7;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -19,6 +19,7 @@ using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Maps;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Game.DungeonFinding
|
||||
@@ -84,12 +85,14 @@ namespace Game.DungeonFinding
|
||||
return;
|
||||
}
|
||||
|
||||
for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next())
|
||||
QueryPlayerNameResponse response = new();
|
||||
foreach (MemberSlot memberSlot in group.GetMemberSlots())
|
||||
{
|
||||
Player member = refe.GetSource();
|
||||
if (member)
|
||||
player.GetSession().SendNameQuery(member.GetGUID());
|
||||
player.GetSession().BuildNameQueryData(memberSlot.guid, out NameCacheLookupResult nameCacheLookupResult);
|
||||
response.Players.Add(nameCacheLookupResult);
|
||||
}
|
||||
|
||||
player.SendPacket(response);
|
||||
|
||||
if (Global.LFGMgr.SelectedRandomLfgDungeon(player.GetGUID()))
|
||||
player.CastSpell(player, SharedConst.LFGSpellLuckOfTheDraw, true);
|
||||
|
||||
@@ -370,6 +370,9 @@ namespace Game.Entities
|
||||
case AreaTriggerTypes.Cylinder:
|
||||
SearchUnitInCylinder(targetList);
|
||||
break;
|
||||
case AreaTriggerTypes.Disk:
|
||||
SearchUnitInDisk(targetList);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -452,6 +455,18 @@ namespace Game.Entities
|
||||
targetList.RemoveAll(unit => unit.GetPositionZ() < minZ || unit.GetPositionZ() > maxZ);
|
||||
}
|
||||
|
||||
void SearchUnitInDisk(List<Unit> targetList)
|
||||
{
|
||||
SearchUnits(targetList, GetMaxSearchRadius(), false);
|
||||
|
||||
float innerRadius = _shape.DiskDatas.InnerRadius;
|
||||
float height = _shape.DiskDatas.Height;
|
||||
float minZ = GetPositionZ() - height;
|
||||
float maxZ = GetPositionZ() + height;
|
||||
|
||||
targetList.RemoveAll(unit => unit.IsInDist2d(this, innerRadius) || unit.GetPositionZ() < minZ || unit.GetPositionZ() > maxZ);
|
||||
}
|
||||
|
||||
void HandleUnitEnterExit(List<Unit> newTargetList)
|
||||
{
|
||||
List<ObjectGuid> exitUnits = _insideUnits;
|
||||
|
||||
@@ -44,6 +44,9 @@ namespace Game.Entities
|
||||
[FieldOffset(0)]
|
||||
public cylinderdatas CylinderDatas;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public diskDatas DiskDatas;
|
||||
|
||||
public struct defaultdatas
|
||||
{
|
||||
public fixed float Data[SharedConst.MaxAreatriggerEntityData];
|
||||
@@ -80,6 +83,18 @@ namespace Game.Entities
|
||||
public float LocationZOffset;
|
||||
public float LocationZOffsetTarget;
|
||||
}
|
||||
// AREATRIGGER_TYPE_DISK
|
||||
public struct diskDatas
|
||||
{
|
||||
public float InnerRadius;
|
||||
public float InnerRadiusTarget;
|
||||
public float OuterRadius;
|
||||
public float OuterRadiusTarget;
|
||||
public float Height;
|
||||
public float HeightTarget;
|
||||
public float LocationZOffset;
|
||||
public float LocationZOffsetTarget;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -183,7 +198,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public class AreaTriggerShapeInfo : AreaTriggerData
|
||||
{
|
||||
{
|
||||
public AreaTriggerTypes TriggerType;
|
||||
|
||||
public AreaTriggerShapeInfo()
|
||||
@@ -200,7 +215,9 @@ namespace Game.Entities
|
||||
case AreaTriggerTypes.Box:
|
||||
return MathF.Sqrt(BoxDatas.Extents[0] * BoxDatas.Extents[0] / 4 + BoxDatas.Extents[1] * BoxDatas.Extents[1] / 4);
|
||||
case AreaTriggerTypes.Cylinder:
|
||||
return CylinderDatas.Radius;
|
||||
return Math.Max(CylinderDatas.Radius, CylinderDatas.RadiusTarget);
|
||||
case AreaTriggerTypes.Disk:
|
||||
return Math.Max(DiskDatas.OuterRadius, DiskDatas.OuterRadiusTarget);
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
@@ -210,6 +227,7 @@ namespace Game.Entities
|
||||
public bool IsBox() { return TriggerType == AreaTriggerTypes.Box; }
|
||||
public bool IsPolygon() { return TriggerType == AreaTriggerTypes.Polygon; }
|
||||
public bool IsCylinder() { return TriggerType == AreaTriggerTypes.Cylinder; }
|
||||
public bool IsDisk() { return TriggerType == AreaTriggerTypes.Disk; }
|
||||
}
|
||||
|
||||
public class AreaTriggerOrbitInfo
|
||||
|
||||
@@ -260,6 +260,7 @@ namespace Game.Misc
|
||||
opt.OptionNPC = item.MenuItemIcon;
|
||||
opt.OptionFlags = (byte)(item.IsCoded ? 1 : 0); // makes pop up box password
|
||||
opt.OptionCost = (int)item.BoxMoney; // money required to open menu, 2.0.3
|
||||
opt.OptionLanguage = item.Language;
|
||||
opt.Text = item.Message; // text for gossip item
|
||||
opt.Confirm = item.BoxMessage; // accept text (related to money) pop up box, 2.0.3
|
||||
opt.Status = GossipOptionStatus.Available;
|
||||
@@ -701,6 +702,7 @@ namespace Game.Misc
|
||||
public uint OptionType;
|
||||
public string BoxMessage;
|
||||
public uint BoxMoney;
|
||||
public uint Language;
|
||||
}
|
||||
|
||||
public class GossipMenuItemData
|
||||
@@ -734,6 +736,7 @@ namespace Game.Misc
|
||||
public uint OptionBroadcastTextId;
|
||||
public GossipOption OptionType;
|
||||
public NPCFlags OptionNpcFlag;
|
||||
public uint Language;
|
||||
public uint ActionMenuId;
|
||||
public uint ActionPoiId;
|
||||
public bool BoxCoded;
|
||||
|
||||
@@ -1219,24 +1219,23 @@ namespace Game.Entities
|
||||
public UpdateField<int> LookAtControllerID = new(96, 115);
|
||||
public UpdateField<int> TaxiNodesID = new(96, 116);
|
||||
public UpdateField<ObjectGuid> GuildGUID = new(96, 117);
|
||||
public UpdateField<ObjectGuid> SkinningOwnerGUID = new(96, 118);
|
||||
public UpdateField<uint> SilencedSchoolMask = new(96, 119);
|
||||
public UpdateField<ObjectGuid> NameplateAttachToGUID = new(96, 120); // When set, nameplate of this unit will instead appear on that object
|
||||
public UpdateFieldArray<uint> NpcFlags = new(2, 121, 122);
|
||||
public UpdateFieldArray<int> Power = new(7, 124, 125);
|
||||
public UpdateFieldArray<uint> MaxPower = new(7, 124, 132);
|
||||
public UpdateFieldArray<float> PowerRegenFlatModifier = new(7, 124, 139);
|
||||
public UpdateFieldArray<float> PowerRegenInterruptedFlatModifier = new(7, 124, 146);
|
||||
public UpdateFieldArray<VisibleItem> VirtualItems = new(3, 153, 154);
|
||||
public UpdateFieldArray<uint> AttackRoundBaseTime = new(2, 157, 158);
|
||||
public UpdateFieldArray<int> Stats = new(4, 160, 161);
|
||||
public UpdateFieldArray<int> StatPosBuff = new(4, 160, 165);
|
||||
public UpdateFieldArray<int> StatNegBuff = new(4, 160, 169);
|
||||
public UpdateFieldArray<int> Resistances = new(7, 173, 174);
|
||||
public UpdateFieldArray<int> BonusResistanceMods = new(7, 173, 181);
|
||||
public UpdateFieldArray<int> ManaCostModifier = new(7, 173, 188);
|
||||
public UpdateField<uint> SilencedSchoolMask = new(96, 118);
|
||||
public UpdateField<ObjectGuid> NameplateAttachToGUID = new(96, 119); // When set, nameplate of this unit will instead appear on that object
|
||||
public UpdateFieldArray<uint> NpcFlags = new(2, 120, 121);
|
||||
public UpdateFieldArray<int> Power = new(7, 123, 124);
|
||||
public UpdateFieldArray<uint> MaxPower = new(7, 123, 131);
|
||||
public UpdateFieldArray<float> PowerRegenFlatModifier = new(7, 123, 138);
|
||||
public UpdateFieldArray<float> PowerRegenInterruptedFlatModifier = new(7, 123, 145);
|
||||
public UpdateFieldArray<VisibleItem> VirtualItems = new(3, 152, 153);
|
||||
public UpdateFieldArray<uint> AttackRoundBaseTime = new(2, 156, 157);
|
||||
public UpdateFieldArray<int> Stats = new(4, 159, 160);
|
||||
public UpdateFieldArray<int> StatPosBuff = new(4, 159, 164);
|
||||
public UpdateFieldArray<int> StatNegBuff = new(4, 159, 168);
|
||||
public UpdateFieldArray<int> Resistances = new(7, 172, 173);
|
||||
public UpdateFieldArray<int> BonusResistanceMods = new(7, 172, 180);
|
||||
public UpdateFieldArray<int> ManaCostModifier = new(7, 172, 187);
|
||||
|
||||
public UnitData() : base(0, TypeId.Unit, 195) { }
|
||||
public UnitData() : base(0, TypeId.Unit, 194) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Unit owner, Player receiver)
|
||||
{
|
||||
@@ -1415,7 +1414,6 @@ namespace Game.Entities
|
||||
data.WriteInt32(PassiveSpells.Size());
|
||||
data.WriteInt32(WorldEffects.Size());
|
||||
data.WriteInt32(ChannelObjects.Size());
|
||||
data.WritePackedGuid(SkinningOwnerGUID);
|
||||
data.WriteUInt32(SilencedSchoolMask);
|
||||
data.WritePackedGuid(NameplateAttachToGUID);
|
||||
|
||||
@@ -1431,7 +1429,7 @@ namespace Game.Entities
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Unit owner, Player receiver)
|
||||
{
|
||||
UpdateMask allowedMaskForTarget = new(195, new uint[] { 0xFFFFDFFFu, 0xE1FF7FFFu, 0x001EFFFFu, 0xFFFFFF81u, 0xFE0007FFu, 0x00000000u, 0x00000000u });
|
||||
UpdateMask allowedMaskForTarget = new(195, new uint[] { 0xFFFFDFFFu, 0xE1FF7FFFu, 0x001EFFFFu, 0xFFFFFF81u, 0x7F0003FFu, 0x00000000u, 0x00000000u });
|
||||
AppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
|
||||
WriteUpdate(data, _changesMask & allowedMaskForTarget, false, owner, receiver);
|
||||
}
|
||||
@@ -1439,16 +1437,16 @@ namespace Game.Entities
|
||||
public void AppendAllowedFieldsMaskForFlag(UpdateMask allowedMaskForTarget, UpdateFieldFlag fieldVisibilityFlags)
|
||||
{
|
||||
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Owner))
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00002000u, 0x1E008000u, 0xFFE10000u, 0x1000007Eu, 0x01FFF800u, 0xFFFFFFFFu, 0x00000007u }));
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00002000u, 0x1E008000u, 0xFFE10000u, 0x0800007Eu, 0x80FFFC00u, 0xFFFFFFFFu, 0x00000003u }));
|
||||
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.UnitAll))
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00000000u, 0x00000000u, 0x00000000u, 0x10000000u, 0x01FFF800u, 0x00000000u, 0x00000000u }));
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00000000u, 0x00000000u, 0x00000000u, 0x08000000u, 0x00FFFC00u, 0x00000000u, 0x00000000u }));
|
||||
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.Empath))
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00000000u, 0x1E000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x001FE000u, 0x00000000u }));
|
||||
allowedMaskForTarget.OR(new UpdateMask(195, new uint[] { 0x00000000u, 0x1E000000u, 0x00000000u, 0x00000000u, 0x00000000u, 0x000FF000u, 0x00000000u }));
|
||||
}
|
||||
|
||||
public void FilterDisallowedFieldsMaskForFlag(UpdateMask changesMask, UpdateFieldFlag fieldVisibilityFlags)
|
||||
{
|
||||
UpdateMask allowedMaskForTarget = new(195, new[] { 0xFFFFDFFFu, 0xE1FF7FFFu, 0x001EFFFFu, 0xFFFFFF81u, 0xFE0007FFu, 0x00000000u, 0x00000000u });
|
||||
UpdateMask allowedMaskForTarget = new(195, new[] { 0xFFFFDFFFu, 0xE1FF7FFFu, 0x001EFFFFu, 0xFFFFFF81u, 0x7F0003FFu, 0x00000000u, 0x00000000u });
|
||||
AppendAllowedFieldsMaskForFlag(allowedMaskForTarget, fieldVisibilityFlags);
|
||||
changesMask.AND(allowedMaskForTarget);
|
||||
}
|
||||
@@ -1979,101 +1977,97 @@ namespace Game.Entities
|
||||
data.WritePackedGuid(GuildGUID);
|
||||
}
|
||||
if (changesMask[118])
|
||||
{
|
||||
data.WritePackedGuid(SkinningOwnerGUID);
|
||||
}
|
||||
if (changesMask[119])
|
||||
{
|
||||
data.WriteUInt32(SilencedSchoolMask);
|
||||
}
|
||||
if (changesMask[120])
|
||||
if (changesMask[119])
|
||||
{
|
||||
data.WritePackedGuid(NameplateAttachToGUID);
|
||||
}
|
||||
}
|
||||
if (changesMask[121])
|
||||
if (changesMask[120])
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (changesMask[122 + i])
|
||||
if (changesMask[121 + i])
|
||||
{
|
||||
data.WriteUInt32(GetViewerDependentNpcFlags(this, i, owner, receiver));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[124])
|
||||
if (changesMask[123])
|
||||
{
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
if (changesMask[125 + i])
|
||||
if (changesMask[124 + i])
|
||||
{
|
||||
data.WriteInt32(Power[i]);
|
||||
}
|
||||
if (changesMask[132 + i])
|
||||
if (changesMask[131 + i])
|
||||
{
|
||||
data.WriteUInt32(MaxPower[i]);
|
||||
}
|
||||
if (changesMask[139 + i])
|
||||
if (changesMask[138 + i])
|
||||
{
|
||||
data.WriteFloat(PowerRegenFlatModifier[i]);
|
||||
}
|
||||
if (changesMask[146 + i])
|
||||
if (changesMask[145 + i])
|
||||
{
|
||||
data.WriteFloat(PowerRegenInterruptedFlatModifier[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[153])
|
||||
if (changesMask[152])
|
||||
{
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (changesMask[154 + i])
|
||||
if (changesMask[153 + i])
|
||||
{
|
||||
VirtualItems[i].WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[157])
|
||||
if (changesMask[156])
|
||||
{
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (changesMask[158 + i])
|
||||
if (changesMask[157 + i])
|
||||
{
|
||||
data.WriteUInt32(AttackRoundBaseTime[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[160])
|
||||
if (changesMask[159])
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (changesMask[161 + i])
|
||||
if (changesMask[160 + i])
|
||||
{
|
||||
data.WriteInt32(Stats[i]);
|
||||
}
|
||||
if (changesMask[165 + i])
|
||||
if (changesMask[164 + i])
|
||||
{
|
||||
data.WriteInt32(StatPosBuff[i]);
|
||||
}
|
||||
if (changesMask[169 + i])
|
||||
if (changesMask[168 + i])
|
||||
{
|
||||
data.WriteInt32(StatNegBuff[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changesMask[173])
|
||||
if (changesMask[172])
|
||||
{
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
if (changesMask[174 + i])
|
||||
if (changesMask[173 + i])
|
||||
{
|
||||
data.WriteInt32(Resistances[i]);
|
||||
}
|
||||
if (changesMask[181 + i])
|
||||
if (changesMask[180 + i])
|
||||
{
|
||||
data.WriteInt32(BonusResistanceMods[i]);
|
||||
}
|
||||
if (changesMask[188 + i])
|
||||
if (changesMask[187 + i])
|
||||
{
|
||||
data.WriteInt32(ManaCostModifier[i]);
|
||||
}
|
||||
@@ -2197,7 +2191,6 @@ namespace Game.Entities
|
||||
ClearChangesMask(LookAtControllerID);
|
||||
ClearChangesMask(TaxiNodesID);
|
||||
ClearChangesMask(GuildGUID);
|
||||
ClearChangesMask(SkinningOwnerGUID);
|
||||
ClearChangesMask(SilencedSchoolMask);
|
||||
ClearChangesMask(NameplateAttachToGUID);
|
||||
ClearChangesMask(NpcFlags);
|
||||
@@ -5140,22 +5133,22 @@ namespace Game.Entities
|
||||
public class DynamicObjectData : BaseUpdateData<DynamicObject>
|
||||
{
|
||||
public UpdateField<ObjectGuid> Caster = new(0, 1);
|
||||
public UpdateField<SpellCastVisualField> SpellVisual = new(0, 2);
|
||||
public UpdateField<uint> SpellID = new(0, 3);
|
||||
public UpdateField<float> Radius = new(0, 4);
|
||||
public UpdateField<uint> CastTime = new(0, 5);
|
||||
public UpdateField<byte> Type = new(0, 6);
|
||||
public UpdateField<byte> Type = new(0, 2);
|
||||
public UpdateField<SpellCastVisualField> SpellVisual = new(0, 3);
|
||||
public UpdateField<uint> SpellID = new(0, 4);
|
||||
public UpdateField<float> Radius = new(0, 5);
|
||||
public UpdateField<uint> CastTime = new(0, 6);
|
||||
|
||||
public DynamicObjectData() : base(0, TypeId.DynamicObject, 7) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, DynamicObject owner, Player receiver)
|
||||
{
|
||||
data.WritePackedGuid(Caster);
|
||||
data.WriteUInt8(Type);
|
||||
((SpellCastVisualField)SpellVisual).WriteCreate(data, owner, receiver);
|
||||
data.WriteUInt32(SpellID);
|
||||
data.WriteFloat(Radius);
|
||||
data.WriteUInt32(CastTime);
|
||||
data.WriteUInt8(Type);
|
||||
}
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, DynamicObject owner, Player receiver)
|
||||
@@ -5176,23 +5169,23 @@ namespace Game.Entities
|
||||
}
|
||||
if (_changesMask[2])
|
||||
{
|
||||
((SpellCastVisualField)SpellVisual).WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
data.WriteUInt8(Type);
|
||||
}
|
||||
if (_changesMask[3])
|
||||
{
|
||||
data.WriteUInt32(SpellID);
|
||||
((SpellCastVisualField)SpellVisual).WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
if (_changesMask[4])
|
||||
{
|
||||
data.WriteFloat(Radius);
|
||||
data.WriteUInt32(SpellID);
|
||||
}
|
||||
if (_changesMask[5])
|
||||
{
|
||||
data.WriteUInt32(CastTime);
|
||||
data.WriteFloat(Radius);
|
||||
}
|
||||
if (_changesMask[6])
|
||||
{
|
||||
data.WriteUInt8(Type);
|
||||
data.WriteUInt32(CastTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5200,11 +5193,11 @@ namespace Game.Entities
|
||||
public override void ClearChangesMask()
|
||||
{
|
||||
ClearChangesMask(Caster);
|
||||
ClearChangesMask(Type);
|
||||
ClearChangesMask(SpellVisual);
|
||||
ClearChangesMask(SpellID);
|
||||
ClearChangesMask(Radius);
|
||||
ClearChangesMask(CastTime);
|
||||
ClearChangesMask(Type);
|
||||
_changesMask.ResetAll();
|
||||
}
|
||||
}
|
||||
@@ -5511,10 +5504,12 @@ namespace Game.Entities
|
||||
public UpdateField<float> BoundsRadius2D = new(0, 11);
|
||||
public UpdateField<uint> DecalPropertiesID = new(0, 12);
|
||||
public UpdateField<ObjectGuid> CreatingEffectGUID = new(0, 13);
|
||||
public UpdateField<ObjectGuid> Field_80 = new(0, 14);
|
||||
public UpdateField<VisualAnim> VisualAnim = new(0, 15);
|
||||
public UpdateField<uint> Field_80 = new(0, 14);
|
||||
public UpdateField<uint> Field_84 = new(0, 15);
|
||||
public UpdateField<ObjectGuid> Field_88 = new(0, 16);
|
||||
public UpdateField<VisualAnim> VisualAnim = new(0, 17);
|
||||
|
||||
public AreaTriggerFieldData() : base(0, TypeId.AreaTrigger, 16) { }
|
||||
public AreaTriggerFieldData() : base(0, TypeId.AreaTrigger, 18) { }
|
||||
|
||||
public void WriteCreate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, AreaTrigger owner, Player receiver)
|
||||
{
|
||||
@@ -5532,7 +5527,11 @@ namespace Game.Entities
|
||||
data.WriteFloat(BoundsRadius2D);
|
||||
data.WriteUInt32(DecalPropertiesID);
|
||||
data.WritePackedGuid(CreatingEffectGUID);
|
||||
data.WriteUInt32(Field_80);
|
||||
data.WriteUInt32(Field_84);
|
||||
data.WritePackedGuid(Field_88);
|
||||
((ScaleCurve)ExtraScaleCurve).WriteCreate(data, owner, receiver);
|
||||
((VisualAnim)VisualAnim).WriteCreate(data, owner, receiver);
|
||||
}
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, AreaTrigger owner, Player receiver)
|
||||
@@ -5542,7 +5541,7 @@ namespace Game.Entities
|
||||
|
||||
public void WriteUpdate(WorldPacket data, UpdateMask changesMask, bool ignoreNestedChangesMask, AreaTrigger owner, Player receiver)
|
||||
{
|
||||
data.WriteBits(_changesMask.GetBlock(0), 14);
|
||||
data.WriteBits(_changesMask.GetBlock(0), 18);
|
||||
|
||||
data.FlushBits();
|
||||
if (_changesMask[0])
|
||||
@@ -5595,10 +5594,26 @@ namespace Game.Entities
|
||||
{
|
||||
data.WritePackedGuid(CreatingEffectGUID);
|
||||
}
|
||||
if (changesMask[14])
|
||||
{
|
||||
data.WriteUInt32(Field_80);
|
||||
}
|
||||
if (changesMask[15])
|
||||
{
|
||||
data.WriteUInt32(Field_84);
|
||||
}
|
||||
if (changesMask[16])
|
||||
{
|
||||
data.WritePackedGuid(Field_88);
|
||||
}
|
||||
if (_changesMask[2])
|
||||
{
|
||||
((ScaleCurve)ExtraScaleCurve).WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
if (changesMask[17])
|
||||
{
|
||||
((VisualAnim)VisualAnim).WriteUpdate(data, ignoreNestedChangesMask, owner, receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5617,6 +5632,10 @@ namespace Game.Entities
|
||||
ClearChangesMask(BoundsRadius2D);
|
||||
ClearChangesMask(DecalPropertiesID);
|
||||
ClearChangesMask(CreatingEffectGUID);
|
||||
ClearChangesMask(Field_80);
|
||||
ClearChangesMask(Field_84);
|
||||
ClearChangesMask(Field_88);
|
||||
ClearChangesMask(VisualAnim);
|
||||
_changesMask.ResetAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,9 +281,14 @@ namespace Game.Entities
|
||||
bool HasFallDirection = unit.HasUnitMovementFlag(MovementFlag.Falling);
|
||||
bool HasFall = HasFallDirection || unit.m_movementInfo.jump.fallTime != 0;
|
||||
bool HasSpline = unit.IsSplineEnabled();
|
||||
bool HasInertia = unit.m_movementInfo.inertia.HasValue;
|
||||
|
||||
data.WritePackedGuid(GetGUID()); // MoverGUID
|
||||
|
||||
data.WriteUInt32((uint)unit.GetUnitMovementFlags());
|
||||
data.WriteUInt32((uint)unit.GetUnitMovementFlags2());
|
||||
data.WriteUInt32((uint)unit.GetExtraUnitMovementFlags2());
|
||||
|
||||
data.WriteUInt32(unit.m_movementInfo.Time); // MoveTime
|
||||
data.WriteFloat(unit.GetPositionX());
|
||||
data.WriteFloat(unit.GetPositionY());
|
||||
@@ -299,17 +304,23 @@ namespace Game.Entities
|
||||
//for (public uint i = 0; i < RemoveForcesIDs.Count; ++i)
|
||||
// *data << ObjectGuid(RemoveForcesIDs);
|
||||
|
||||
data.WriteBits((uint)unit.GetUnitMovementFlags(), 30);
|
||||
data.WriteBits((uint)unit.GetUnitMovementFlags2(), 18);
|
||||
data.WriteBit(!unit.m_movementInfo.transport.guid.IsEmpty()); // HasTransport
|
||||
data.WriteBit(HasFall); // HasFall
|
||||
data.WriteBit(HasSpline); // HasSpline - marks that the unit uses spline movement
|
||||
data.WriteBit(false); // HeightChangeFailed
|
||||
data.WriteBit(false); // RemoteTimeValid
|
||||
data.WriteBit(HasInertia); // HasInertia
|
||||
|
||||
if (!unit.m_movementInfo.transport.guid.IsEmpty())
|
||||
MovementExtensions.WriteTransportInfo(data, unit.m_movementInfo.transport);
|
||||
|
||||
if (HasInertia)
|
||||
{
|
||||
data.WritePackedGuid(unit.m_movementInfo.inertia.Value.guid);
|
||||
data.WriteXYZ(unit.m_movementInfo.inertia.Value.force);
|
||||
data.WriteUInt32(unit.m_movementInfo.inertia.Value.lifetime);
|
||||
}
|
||||
|
||||
if (HasFall)
|
||||
{
|
||||
data.WriteUInt32(unit.m_movementInfo.jump.fallTime); // Time
|
||||
@@ -440,6 +451,7 @@ namespace Game.Entities
|
||||
bool hasAreaTriggerBox = shape.IsBox();
|
||||
bool hasAreaTriggerPolygon = createProperties != null && shape.IsPolygon();
|
||||
bool hasAreaTriggerCylinder = shape.IsCylinder();
|
||||
bool hasDisk = shape.IsDisk();
|
||||
bool hasAreaTriggerSpline = areaTrigger.HasSplines();
|
||||
bool hasOrbit = areaTrigger.HasOrbit();
|
||||
bool hasMovementScript = false;
|
||||
@@ -459,6 +471,7 @@ namespace Game.Entities
|
||||
data.WriteBit(hasAreaTriggerBox);
|
||||
data.WriteBit(hasAreaTriggerPolygon);
|
||||
data.WriteBit(hasAreaTriggerCylinder);
|
||||
data.WriteBit(hasDisk);
|
||||
data.WriteBit(hasAreaTriggerSpline);
|
||||
data.WriteBit(hasOrbit);
|
||||
data.WriteBit(hasMovementScript);
|
||||
@@ -532,6 +545,18 @@ namespace Game.Entities
|
||||
data.WriteFloat(shape.CylinderDatas.LocationZOffsetTarget);
|
||||
}
|
||||
|
||||
if (hasDisk)
|
||||
{
|
||||
data.WriteFloat(shape.DiskDatas.InnerRadius);
|
||||
data.WriteFloat(shape.DiskDatas.InnerRadiusTarget);
|
||||
data.WriteFloat(shape.DiskDatas.OuterRadius);
|
||||
data.WriteFloat(shape.DiskDatas.OuterRadiusTarget);
|
||||
data.WriteFloat(shape.DiskDatas.Height);
|
||||
data.WriteFloat(shape.DiskDatas.HeightTarget);
|
||||
data.WriteFloat(shape.DiskDatas.LocationZOffset);
|
||||
data.WriteFloat(shape.DiskDatas.LocationZOffsetTarget);
|
||||
}
|
||||
|
||||
//if (hasMovementScript)
|
||||
// *data << *areaTrigger.GetMovementScript(); // AreaTriggerMovementScriptInfo
|
||||
|
||||
@@ -3667,10 +3692,12 @@ namespace Game.Entities
|
||||
public ObjectGuid Guid { get; set; }
|
||||
MovementFlag flags;
|
||||
MovementFlag2 flags2;
|
||||
MovementFlags3 flags3;
|
||||
public Position Pos { get; set; }
|
||||
public uint Time { get; set; }
|
||||
public TransportInfo transport;
|
||||
public float Pitch { get; set; }
|
||||
public Inertia? inertia;
|
||||
public JumpInfo jump;
|
||||
public float SplineElevation { get; set; }
|
||||
|
||||
@@ -3699,6 +3726,12 @@ namespace Game.Entities
|
||||
public void RemoveMovementFlag2(MovementFlag2 f) { flags2 &= ~f; }
|
||||
public bool HasMovementFlag2(MovementFlag2 f) { return (flags2 & f) != 0; }
|
||||
|
||||
public MovementFlags3 GetExtraMovementFlags2() { return flags3; }
|
||||
public void SetExtraMovementFlags2(MovementFlags3 flag) { flags3 = flag; }
|
||||
public void AddExtraMovementFlag2(MovementFlags3 flag) { flags3 |= flag; }
|
||||
public void RemoveExtraMovementFlag2(MovementFlags3 flag) { flags3 &= ~flag; }
|
||||
public bool HasExtraMovementFlag2(MovementFlags3 flag) { return (flags3 & flag) != 0; }
|
||||
|
||||
public void SetFallTime(uint time) { jump.fallTime = time; }
|
||||
|
||||
public void ResetTransport()
|
||||
@@ -3730,6 +3763,12 @@ namespace Game.Entities
|
||||
public uint prevTime;
|
||||
public uint vehicleId;
|
||||
}
|
||||
public struct Inertia
|
||||
{
|
||||
public ObjectGuid guid;
|
||||
public Position force;
|
||||
public uint lifetime;
|
||||
}
|
||||
public struct JumpInfo
|
||||
{
|
||||
public void Reset()
|
||||
|
||||
@@ -299,9 +299,11 @@ namespace Game.Entities
|
||||
{
|
||||
var activePetIndex = Array.FindIndex(petStable.ActivePets, pet => pet?.PetNumber == petnumber);
|
||||
|
||||
Cypher.Assert(petStable.CurrentPetIndex == 0);
|
||||
Cypher.Assert(activePetIndex != -1);
|
||||
|
||||
// Check that we either have no pet (unsummoned by player) or it matches temporarily unsummoned pet by server (for example on flying mount)
|
||||
Cypher.Assert(petStable.CurrentPetIndex == 0 || petStable.CurrentPetIndex == activePetIndex);
|
||||
|
||||
petStable.SetCurrentActivePetIndex((uint)activePetIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -1714,6 +1714,12 @@ namespace Game.Entities
|
||||
m_movementInfo.SetMovementFlags2(f);
|
||||
}
|
||||
|
||||
public void AddExtraUnitMovementFlag2(MovementFlags3 f) { m_movementInfo.AddExtraMovementFlag2(f); }
|
||||
public void RemoveExtraUnitMovementFlag2(MovementFlags3 f) { m_movementInfo.RemoveExtraMovementFlag2(f); }
|
||||
public bool HasExtraUnitMovementFlag2(MovementFlags3 f) { return m_movementInfo.HasExtraMovementFlag2(f); }
|
||||
public MovementFlags3 GetExtraUnitMovementFlags2() { return m_movementInfo.GetExtraMovementFlags2(); }
|
||||
public void SetExtraUnitMovementFlags2(MovementFlags3 f) { m_movementInfo.SetExtraMovementFlags2(f); }
|
||||
|
||||
//Spline
|
||||
public bool IsSplineEnabled()
|
||||
{
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace Game.Entities
|
||||
_spellHistory.Update();
|
||||
}
|
||||
|
||||
public void HandleEmoteCommand(Emote emoteId, Player target = null, uint[] spellVisualKitIds = null)
|
||||
public void HandleEmoteCommand(Emote emoteId, Player target = null, uint[] spellVisualKitIds = null, int sequenceVariation = 0)
|
||||
{
|
||||
EmoteMessage packet = new();
|
||||
packet.Guid = GetGUID();
|
||||
@@ -253,6 +253,8 @@ namespace Game.Entities
|
||||
if (emotesEntry.AnimId == (uint)Anim.MountSpecial || emotesEntry.AnimId == (uint)Anim.MountSelfSpecial)
|
||||
packet.SpellVisualKitIDs.AddRange(spellVisualKitIds);
|
||||
|
||||
packet.SequenceVariation = sequenceVariation;
|
||||
|
||||
if (target != null)
|
||||
target.SendPacket(packet);
|
||||
else
|
||||
|
||||
@@ -596,15 +596,10 @@ namespace Game
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
|
||||
gossipMenuItemsStorage.Clear();
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
SQLResult result = DB.World.Query("SELECT o.MenuId, o.OptionIndex, o.OptionIcon, o.OptionText, o.OptionBroadcastTextId, o.OptionType, o.OptionNpcFlag, " +
|
||||
// 7 8 9 10 11 12
|
||||
"oa.ActionMenuId, oa.ActionPoiId, ob.BoxCoded, ob.BoxMoney, ob.BoxText, ob.BoxBroadcastTextId " +
|
||||
"FROM gossip_menu_option o " +
|
||||
"LEFT JOIN gossip_menu_option_action oa ON o.MenuId = oa.MenuId AND o.OptionIndex = oa.OptionIndex " +
|
||||
"LEFT JOIN gossip_menu_option_box ob ON o.MenuId = ob.MenuId AND o.OptionIndex = ob.OptionIndex " +
|
||||
"ORDER BY o.MenuId, o.OptionIndex");
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
SQLResult result = DB.World.Query("SELECT MenuID, OptionID, OptionIcon, OptionText, OptionBroadcastTextID, OptionType, OptionNpcFlag, Language, ActionMenuID, ActionPoiID, BoxCoded, BoxMoney, BoxText, BoxBroadcastTextID " +
|
||||
"FROM gossip_menu_option ORDER BY MenuID, OptionID");
|
||||
|
||||
if (result.IsEmpty())
|
||||
{
|
||||
@@ -623,12 +618,13 @@ namespace Game
|
||||
gMenuItem.OptionBroadcastTextId = result.Read<uint>(4);
|
||||
gMenuItem.OptionType = (GossipOption)result.Read<uint>(5);
|
||||
gMenuItem.OptionNpcFlag = (NPCFlags)result.Read<ulong>(6);
|
||||
gMenuItem.ActionMenuId = result.Read<uint>(7);
|
||||
gMenuItem.ActionPoiId = result.Read<uint>(8);
|
||||
gMenuItem.BoxCoded = result.Read<bool>(9);
|
||||
gMenuItem.BoxMoney = result.Read<uint>(10);
|
||||
gMenuItem.BoxText = result.Read<string>(11);
|
||||
gMenuItem.BoxBroadcastTextId = result.Read<uint>(12);
|
||||
gMenuItem.Language = result.Read<uint>(7);
|
||||
gMenuItem.ActionMenuId = result.Read<uint>(8);
|
||||
gMenuItem.ActionPoiId = result.Read<uint>(9);
|
||||
gMenuItem.BoxCoded = result.Read<bool>(10);
|
||||
gMenuItem.BoxMoney = result.Read<uint>(11);
|
||||
gMenuItem.BoxText = result.Read<string>(12);
|
||||
gMenuItem.BoxBroadcastTextId = result.Read<uint>(13);
|
||||
|
||||
if (gMenuItem.OptionIcon >= GossipOptionIcon.Max)
|
||||
{
|
||||
@@ -648,6 +644,12 @@ namespace Game
|
||||
if (gMenuItem.OptionType >= GossipOption.Max)
|
||||
Log.outError(LogFilter.Sql, $"Table gossip_menu_option for MenuId {gMenuItem.MenuId}, OptionIndex {gMenuItem.OptionId} has unknown option id {gMenuItem.OptionType}. Option will not be used");
|
||||
|
||||
if (gMenuItem.Language != 0 && !CliDB.LanguagesStorage.ContainsKey(gMenuItem.Language))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `gossip_menu_option` for menu {gMenuItem.MenuId}, id {gMenuItem.OptionId} use non-existing Language {gMenuItem.Language}, ignoring");
|
||||
gMenuItem.Language = 0;
|
||||
}
|
||||
|
||||
if (gMenuItem.ActionPoiId != 0 && GetPointOfInterest(gMenuItem.ActionPoiId) == null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table gossip_menu_option for MenuId {gMenuItem.MenuId}, OptionIndex {gMenuItem.OptionId} use non-existing actionpoiid {gMenuItem.ActionPoiId}, ignoring");
|
||||
@@ -9550,7 +9552,7 @@ namespace Game
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
_playerChoices.Clear();
|
||||
|
||||
SQLResult choiceResult = DB.World.Query("SELECT ChoiceId, UiTextureKitId, SoundKitId, Question, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
SQLResult choiceResult = DB.World.Query("SELECT ChoiceId, UiTextureKitId, SoundKitId, CloseSoundKitId, Duration, Question, PendingChoiceText, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
if (choiceResult.IsEmpty())
|
||||
{
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 player choices. DB table `playerchoice` is empty.");
|
||||
@@ -9571,9 +9573,12 @@ namespace Game
|
||||
choice.ChoiceId = choiceResult.Read<int>(0);
|
||||
choice.UiTextureKitId = choiceResult.Read<int>(1);
|
||||
choice.SoundKitId = choiceResult.Read<uint>(2);
|
||||
choice.Question = choiceResult.Read<string>(3);
|
||||
choice.HideWarboardHeader = choiceResult.Read<bool>(4);
|
||||
choice.KeepOpenAfterChoice = choiceResult.Read<bool>(5);
|
||||
choice.CloseSoundKitId = choiceResult.Read<uint>(3);
|
||||
choice.Duration = choiceResult.Read<long>(4);
|
||||
choice.Question = choiceResult.Read<string>(5);
|
||||
choice.PendingChoiceText = choiceResult.Read<string>(6);
|
||||
choice.HideWarboardHeader = choiceResult.Read<bool>(7);
|
||||
choice.KeepOpenAfterChoice = choiceResult.Read<bool>(8);
|
||||
|
||||
_playerChoices[choice.ChoiceId] = choice;
|
||||
|
||||
@@ -9887,8 +9892,10 @@ namespace Game
|
||||
|
||||
PlayerChoiceResponseMawPower mawPower = new();
|
||||
mawPower.TypeArtFileID = mawPowersResult.Read<int>(2);
|
||||
mawPower.Rarity = mawPowersResult.Read<int>(3);
|
||||
mawPower.RarityColor = mawPowersResult.Read<uint>(4);
|
||||
if (!mawPowersResult.IsNull(3))
|
||||
mawPower.Rarity = mawPowersResult.Read<int>(3);
|
||||
if (!mawPowersResult.IsNull(4))
|
||||
mawPower.RarityColor = mawPowersResult.Read<uint>(4);
|
||||
mawPower.SpellID = mawPowersResult.Read<int>(5);
|
||||
mawPower.MaxStacks = mawPowersResult.Read<int>(6);
|
||||
response.MawPower = mawPower;
|
||||
@@ -11805,8 +11812,8 @@ namespace Game
|
||||
public struct PlayerChoiceResponseMawPower
|
||||
{
|
||||
public int TypeArtFileID;
|
||||
public int Rarity;
|
||||
public uint RarityColor;
|
||||
public int? Rarity;
|
||||
public uint? RarityColor;
|
||||
public int SpellID;
|
||||
public int MaxStacks;
|
||||
}
|
||||
@@ -11843,7 +11850,10 @@ namespace Game
|
||||
public int ChoiceId;
|
||||
public int UiTextureKitId;
|
||||
public uint SoundKitId;
|
||||
public uint CloseSoundKitId;
|
||||
public long Duration;
|
||||
public string Question;
|
||||
public string PendingChoiceText;
|
||||
public List<PlayerChoiceResponse> Responses = new();
|
||||
public bool HideWarboardHeader;
|
||||
public bool KeepOpenAfterChoice;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace Game.Guilds
|
||||
{
|
||||
SQLTransaction trans = new();
|
||||
|
||||
m_achievementSys.SaveToDB(trans);
|
||||
GetAchievementMgr().SaveToDB(trans);
|
||||
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
}
|
||||
@@ -252,11 +252,10 @@ namespace Game.Guilds
|
||||
session.SendPacket(roster);
|
||||
}
|
||||
|
||||
public void SendQueryResponse(WorldSession session, ObjectGuid playerGuid)
|
||||
public void SendQueryResponse(WorldSession session)
|
||||
{
|
||||
QueryGuildInfoResponse response = new();
|
||||
response.GuildGUID = GetGUID();
|
||||
response.PlayerGuid = playerGuid;
|
||||
response.HasGuildInfo = true;
|
||||
|
||||
response.Info.GuildGuid = GetGUID();
|
||||
@@ -395,7 +394,7 @@ namespace Game.Guilds
|
||||
|
||||
SendSaveEmblemResult(session, GuildEmblemError.Success); // "Guild Emblem saved."
|
||||
|
||||
SendQueryResponse(session, ObjectGuid.Empty);
|
||||
SendQueryResponse(session);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1145,7 +1144,7 @@ namespace Game.Guilds
|
||||
foreach (var entry in CliDB.GuildPerkSpellsStorage.Values)
|
||||
player.LearnSpell(entry.SpellID, true);
|
||||
|
||||
m_achievementSys.SendAllData(player);
|
||||
GetAchievementMgr().SendAllData(player);
|
||||
|
||||
// tells the client to request bank withdrawal limit
|
||||
player.SendPacket(new GuildMemberDailyReset());
|
||||
@@ -2412,12 +2411,12 @@ namespace Game.Guilds
|
||||
|
||||
bool HasAchieved(uint achievementId)
|
||||
{
|
||||
return m_achievementSys.HasAchieved(achievementId);
|
||||
return GetAchievementMgr().HasAchieved(achievementId);
|
||||
}
|
||||
|
||||
public void UpdateCriteria(CriteriaType type, ulong miscValue1, ulong miscValue2, ulong miscValue3, WorldObject refe, Player player)
|
||||
{
|
||||
m_achievementSys.UpdateCriteria(type, miscValue1, miscValue2, miscValue3, refe, player);
|
||||
GetAchievementMgr().UpdateCriteria(type, miscValue1, miscValue2, miscValue3, refe, player);
|
||||
}
|
||||
|
||||
public void HandleNewsSetSticky(WorldSession session, uint newsId, bool sticky)
|
||||
|
||||
@@ -763,10 +763,10 @@ namespace Game
|
||||
// Send PVPSeason
|
||||
{
|
||||
SeasonInfo seasonInfo = new();
|
||||
seasonInfo.PreviousSeason = (WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId) - (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress) ? 1 : 0));
|
||||
seasonInfo.MythicPlusMilestoneSeasonID = (WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId) - (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress) ? 1 : 0));
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress))
|
||||
seasonInfo.CurrentSeason = WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId);
|
||||
seasonInfo.PreviousArenaSeason = WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId);
|
||||
|
||||
SendPacket(seasonInfo);
|
||||
}
|
||||
|
||||
@@ -584,7 +584,7 @@ namespace Game
|
||||
// Only allow text-emotes for "dead" entities (feign death included)
|
||||
if (GetPlayer().HasUnitState(UnitState.Died))
|
||||
break;
|
||||
GetPlayer().HandleEmoteCommand(emote, null, packet.SpellVisualKitIDs);
|
||||
GetPlayer().HandleEmoteCommand(emote, null, packet.SpellVisualKitIDs, packet.SequenceVariation);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,16 +31,12 @@ namespace Game
|
||||
Guild guild = Global.GuildMgr.GetGuildByGuid(query.GuildGuid);
|
||||
if (guild)
|
||||
{
|
||||
if (guild.IsMember(query.PlayerGuid))
|
||||
{
|
||||
guild.SendQueryResponse(this, query.PlayerGuid);
|
||||
return;
|
||||
}
|
||||
guild.SendQueryResponse(this);
|
||||
return;
|
||||
}
|
||||
|
||||
QueryGuildInfoResponse response = new();
|
||||
response.GuildGUID = query.GuildGuid;
|
||||
response.PlayerGuid = query.PlayerGuid;
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -440,6 +440,7 @@ namespace Game
|
||||
SpecialMountAnim specialMountAnim = new();
|
||||
specialMountAnim.UnitGUID = _player.GetGUID();
|
||||
specialMountAnim.SpellVisualKitIDs.AddRange(mountSpecial.SpellVisualKitIDs);
|
||||
specialMountAnim.SequenceVariation = mountSpecial.SequenceVariation;
|
||||
GetPlayer().SendMessageToSet(specialMountAnim, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,24 +33,31 @@ namespace Game
|
||||
[WorldPacketHandler(ClientOpcodes.QueryPlayerName, Processing = PacketProcessing.Inplace)]
|
||||
void HandleNameQueryRequest(QueryPlayerName queryPlayerName)
|
||||
{
|
||||
SendNameQuery(queryPlayerName.Player);
|
||||
}
|
||||
|
||||
public void SendNameQuery(ObjectGuid guid)
|
||||
{
|
||||
Player player = Global.ObjAccessor.FindPlayer(guid);
|
||||
|
||||
QueryPlayerNameResponse response = new();
|
||||
response.Player = guid;
|
||||
|
||||
if (response.Data.Initialize(guid, player))
|
||||
response.Result = ResponseCodes.Success;
|
||||
else
|
||||
response.Result = ResponseCodes.Failure; // name unknown
|
||||
foreach (ObjectGuid guid in queryPlayerName.Players)
|
||||
{
|
||||
BuildNameQueryData(guid, out NameCacheLookupResult nameCacheLookupResult);
|
||||
response.Players.Add(nameCacheLookupResult);
|
||||
}
|
||||
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
public void BuildNameQueryData(ObjectGuid guid, out NameCacheLookupResult lookupData)
|
||||
{
|
||||
lookupData = new();
|
||||
|
||||
Player player = Global.ObjAccessor.FindPlayer(guid);
|
||||
|
||||
lookupData.Player = guid;
|
||||
|
||||
lookupData.Data = new();
|
||||
if (lookupData.Data.Initialize(guid, player))
|
||||
lookupData.Result = (byte)ResponseCodes.Success;
|
||||
else
|
||||
lookupData.Result = (byte)ResponseCodes.Failure; // name unknown
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.QueryTime, Processing = PacketProcessing.Inplace)]
|
||||
void HandleQueryTime(QueryTime packet)
|
||||
{
|
||||
|
||||
@@ -30,18 +30,20 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(MythicPlusSeasonID);
|
||||
_worldPacket.WriteInt32(CurrentSeason);
|
||||
_worldPacket.WriteInt32(PreviousSeason);
|
||||
_worldPacket.WriteInt32(MythicPlusDisplaySeasonID);
|
||||
_worldPacket.WriteInt32(MythicPlusMilestoneSeasonID);
|
||||
_worldPacket.WriteInt32(CurrentArenaSeason);
|
||||
_worldPacket.WriteInt32(PreviousArenaSeason);
|
||||
_worldPacket.WriteInt32(ConquestWeeklyProgressCurrencyID);
|
||||
_worldPacket.WriteInt32(PvpSeasonID);
|
||||
_worldPacket.WriteBit(WeeklyRewardChestsEnabled);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public int MythicPlusSeasonID;
|
||||
public int PreviousSeason;
|
||||
public int CurrentSeason;
|
||||
public int MythicPlusDisplaySeasonID;
|
||||
public int MythicPlusMilestoneSeasonID;
|
||||
public int PreviousArenaSeason;
|
||||
public int CurrentArenaSeason;
|
||||
public int PvpSeasonID;
|
||||
public int ConquestWeeklyProgressCurrencyID;
|
||||
public bool WeeklyRewardChestsEnabled;
|
||||
@@ -159,6 +161,7 @@ namespace Game.Networking.Packets
|
||||
Hdr.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32(AverageWaitTime);
|
||||
_worldPacket.WriteUInt32(WaitTime);
|
||||
_worldPacket.WriteInt32(Unused920);
|
||||
_worldPacket.WriteBit(AsGroup);
|
||||
_worldPacket.WriteBit(EligibleForMatchmaking);
|
||||
_worldPacket.WriteBit(SuspendedQueue);
|
||||
@@ -171,6 +174,7 @@ namespace Game.Networking.Packets
|
||||
public bool SuspendedQueue;
|
||||
public bool EligibleForMatchmaking;
|
||||
public uint WaitTime;
|
||||
public int Unused920;
|
||||
}
|
||||
|
||||
public class BattlefieldStatusFailed : ServerPacket
|
||||
@@ -503,6 +507,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt8(Winner);
|
||||
_worldPacket.WriteInt32(Duration);
|
||||
_worldPacket.WriteBit(LogData != null);
|
||||
_worldPacket.WriteBits(SoloShuffleStatus, 2);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
if (LogData != null)
|
||||
@@ -512,6 +517,7 @@ namespace Game.Networking.Packets
|
||||
public byte Winner;
|
||||
public int Duration;
|
||||
public PVPMatchStatistics LogData;
|
||||
public uint SoloShuffleStatus;
|
||||
}
|
||||
|
||||
//Structs
|
||||
@@ -631,6 +637,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteInt32(PlayerClass);
|
||||
data.WriteInt32(CreatureID);
|
||||
data.WriteInt32(HonorLevel);
|
||||
data.WriteInt32(Role);
|
||||
|
||||
foreach (var pvpStat in Stats)
|
||||
pvpStat.Write(data);
|
||||
@@ -678,6 +685,7 @@ namespace Game.Networking.Packets
|
||||
public int PlayerClass;
|
||||
public int CreatureID;
|
||||
public int HonorLevel;
|
||||
public int Role;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
|
||||
@@ -281,7 +281,8 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(Guid);
|
||||
_worldPacket.WriteUInt32(EmoteID);
|
||||
_worldPacket.WriteInt32(SpellVisualKitIDs.Count);
|
||||
|
||||
_worldPacket.WriteInt32(SequenceVariation);
|
||||
|
||||
foreach (var id in SpellVisualKitIDs)
|
||||
_worldPacket.WriteUInt32(id);
|
||||
}
|
||||
@@ -289,6 +290,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid Guid;
|
||||
public uint EmoteID;
|
||||
public List<uint> SpellVisualKitIDs = new();
|
||||
public int SequenceVariation;
|
||||
}
|
||||
|
||||
public class CTextEmote : ClientPacket
|
||||
@@ -302,6 +304,7 @@ namespace Game.Networking.Packets
|
||||
SoundIndex = _worldPacket.ReadInt32();
|
||||
|
||||
SpellVisualKitIDs = new uint[_worldPacket.ReadUInt32()];
|
||||
SequenceVariation = _worldPacket.ReadInt32();
|
||||
for (var i = 0; i < SpellVisualKitIDs.Length; ++i)
|
||||
SpellVisualKitIDs[i] = _worldPacket.ReadUInt32();
|
||||
}
|
||||
@@ -310,6 +313,7 @@ namespace Game.Networking.Packets
|
||||
public int EmoteID;
|
||||
public int SoundIndex;
|
||||
public uint[] SpellVisualKitIDs;
|
||||
public int SequenceVariation;
|
||||
}
|
||||
|
||||
public class STextEmote : ServerPacket
|
||||
|
||||
@@ -144,10 +144,12 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(ObjectGUID);
|
||||
_worldPacket.WriteInt32(UILink);
|
||||
_worldPacket.WriteInt32(UIItemInteractionID);
|
||||
}
|
||||
|
||||
public ObjectGuid ObjectGUID;
|
||||
public int UILink;
|
||||
public int UIItemInteractionID;
|
||||
}
|
||||
|
||||
class GameObjectPlaySpellVisual : ServerPacket
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(GuildGUID);
|
||||
_worldPacket.WritePackedGuid(PlayerGuid);
|
||||
_worldPacket.WriteBit(HasGuildInfo);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
@@ -76,7 +75,6 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public ObjectGuid GuildGUID;
|
||||
public ObjectGuid PlayerGuid;
|
||||
public GuildInfo Info = new();
|
||||
public bool HasGuildInfo;
|
||||
|
||||
|
||||
@@ -1181,11 +1181,13 @@ namespace Game.Networking.Packets
|
||||
public override void Read()
|
||||
{
|
||||
SpellVisualKitIDs = new int[_worldPacket.ReadUInt32()];
|
||||
SequenceVariation = _worldPacket.ReadInt32();
|
||||
for (var i = 0; i < SpellVisualKitIDs.Length; ++i)
|
||||
SpellVisualKitIDs[i] = _worldPacket.ReadInt32();
|
||||
}
|
||||
|
||||
public int[] SpellVisualKitIDs;
|
||||
public int SequenceVariation;
|
||||
}
|
||||
|
||||
class SpecialMountAnim : ServerPacket
|
||||
@@ -1196,12 +1198,14 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(UnitGUID);
|
||||
_worldPacket.WriteInt32(SpellVisualKitIDs.Count);
|
||||
_worldPacket.WriteInt32(SequenceVariation);
|
||||
foreach (var id in SpellVisualKitIDs)
|
||||
_worldPacket.WriteInt32(id);
|
||||
}
|
||||
|
||||
public ObjectGuid UnitGUID;
|
||||
public List<int> SpellVisualKitIDs = new();
|
||||
public int SequenceVariation;
|
||||
}
|
||||
|
||||
class CrossedInebriationThreshold : ServerPacket
|
||||
|
||||
@@ -75,6 +75,9 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
var movementInfo = new MovementInfo();
|
||||
movementInfo.Guid = data.ReadPackedGuid();
|
||||
movementInfo.SetMovementFlags((MovementFlag)data.ReadUInt32());
|
||||
movementInfo.SetMovementFlags2((MovementFlag2)data.ReadUInt32());
|
||||
movementInfo.SetExtraMovementFlags2((MovementFlags3)data.ReadUInt32());
|
||||
movementInfo.Time = data.ReadUInt32();
|
||||
float x = data.ReadFloat();
|
||||
float y = data.ReadFloat();
|
||||
@@ -96,19 +99,27 @@ namespace Game.Networking.Packets
|
||||
|
||||
// ResetBitReader
|
||||
|
||||
movementInfo.SetMovementFlags((MovementFlag)data.ReadBits<uint>(30));
|
||||
movementInfo.SetMovementFlags2((MovementFlag2)data.ReadBits<uint>(18));
|
||||
|
||||
bool hasTransport = data.HasBit();
|
||||
bool hasFall = data.HasBit();
|
||||
bool hasSpline = data.HasBit(); // todo 6.x read this infos
|
||||
|
||||
data.ReadBit(); // HeightChangeFailed
|
||||
data.ReadBit(); // RemoteTimeValid
|
||||
bool hasInertia = data.HasBit();
|
||||
|
||||
if (hasTransport)
|
||||
ReadTransportInfo(data, ref movementInfo.transport);
|
||||
|
||||
if (hasInertia)
|
||||
{
|
||||
MovementInfo.Inertia inertia = new();
|
||||
inertia.guid = data.ReadPackedGuid();
|
||||
inertia.force = data.ReadPosition();
|
||||
inertia.lifetime = data.ReadUInt32();
|
||||
|
||||
movementInfo.inertia = inertia;
|
||||
}
|
||||
|
||||
if (hasFall)
|
||||
{
|
||||
movementInfo.jump.fallTime = data.ReadUInt32();
|
||||
@@ -134,8 +145,12 @@ namespace Game.Networking.Packets
|
||||
bool hasFallDirection = movementInfo.HasMovementFlag(MovementFlag.Falling | MovementFlag.FallingFar);
|
||||
bool hasFallData = hasFallDirection || movementInfo.jump.fallTime != 0;
|
||||
bool hasSpline = false; // todo 6.x send this infos
|
||||
bool hasInertia = movementInfo.inertia.HasValue;
|
||||
|
||||
data.WritePackedGuid(movementInfo.Guid);
|
||||
data.WriteUInt32((uint)movementInfo.GetMovementFlags());
|
||||
data.WriteUInt32((uint)movementInfo.GetMovementFlags2());
|
||||
data.WriteUInt32((uint)movementInfo.GetExtraMovementFlags2());
|
||||
data.WriteUInt32(movementInfo.Time);
|
||||
data.WriteFloat(movementInfo.Pos.GetPositionX());
|
||||
data.WriteFloat(movementInfo.Pos.GetPositionY());
|
||||
@@ -147,27 +162,32 @@ namespace Game.Networking.Packets
|
||||
uint removeMovementForcesCount = 0;
|
||||
data.WriteUInt32(removeMovementForcesCount);
|
||||
|
||||
uint int168 = 0;
|
||||
data.WriteUInt32(int168);
|
||||
uint moveIndex = 0;
|
||||
data.WriteUInt32(moveIndex);
|
||||
|
||||
/*for (public uint i = 0; i < removeMovementForcesCount; ++i)
|
||||
{
|
||||
_worldPacket << ObjectGuid;
|
||||
}*/
|
||||
|
||||
data.WriteBits((uint)movementInfo.GetMovementFlags(), 30);
|
||||
data.WriteBits((uint)movementInfo.GetMovementFlags2(), 18);
|
||||
|
||||
data.WriteBit(hasTransportData);
|
||||
data.WriteBit(hasFallData);
|
||||
data.WriteBit(hasSpline);
|
||||
data.WriteBit(false); // HeightChangeFailed
|
||||
data.WriteBit(false); // RemoteTimeValid
|
||||
data.WriteBit(hasInertia);
|
||||
data.FlushBits();
|
||||
|
||||
if (hasTransportData)
|
||||
WriteTransportInfo(data, movementInfo.transport);
|
||||
|
||||
if (hasInertia)
|
||||
{
|
||||
data.WritePackedGuid(movementInfo.inertia.Value.guid);
|
||||
data.WriteXYZ(movementInfo.inertia.Value.force);
|
||||
data.WriteUInt32(movementInfo.inertia.Value.lifetime);
|
||||
}
|
||||
|
||||
if (hasFallData)
|
||||
{
|
||||
data.WriteUInt32(movementInfo.jump.fallTime);
|
||||
@@ -1168,13 +1188,13 @@ namespace Game.Networking.Packets
|
||||
data.WriteBit(CollisionHeight.HasValue);
|
||||
data.WriteBit(@MovementForce != null);
|
||||
data.WriteBit(MovementForceGUID.HasValue);
|
||||
data.WriteBit(MovementInertiaGUID.HasValue);
|
||||
data.WriteBit(MovementInertiaLifetimeMs.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
if (@MovementForce != null)
|
||||
@MovementForce.Write(data);
|
||||
|
||||
|
||||
|
||||
if (Speed.HasValue)
|
||||
data.WriteFloat(Speed.Value);
|
||||
|
||||
@@ -1198,6 +1218,12 @@ namespace Game.Networking.Packets
|
||||
|
||||
if (MovementForceGUID.HasValue)
|
||||
data.WritePackedGuid(MovementForceGUID.Value);
|
||||
|
||||
if (MovementInertiaGUID.HasValue)
|
||||
data.WritePackedGuid(MovementInertiaGUID.Value);
|
||||
|
||||
if (MovementInertiaLifetimeMs.HasValue)
|
||||
data.WriteUInt32(MovementInertiaLifetimeMs.Value);
|
||||
}
|
||||
|
||||
public ServerOpcodes MessageID;
|
||||
@@ -1208,6 +1234,8 @@ namespace Game.Networking.Packets
|
||||
public CollisionHeightInfo? CollisionHeight;
|
||||
public MovementForce MovementForce;
|
||||
public ObjectGuid? MovementForceGUID;
|
||||
public ObjectGuid? MovementInertiaGUID;
|
||||
public uint? MovementInertiaLifetimeMs;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,13 @@ namespace Game.Networking.Packets
|
||||
public class DungeonScoreSummary
|
||||
{
|
||||
public float CurrentSeasonScore;
|
||||
public float LifetimeBestSeasonScore;
|
||||
public List<DungeonScoreMapSummary> Runs = new();
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteFloat(CurrentSeasonScore);
|
||||
data.WriteFloat(LifetimeBestSeasonScore);
|
||||
data.WriteInt32(Runs.Count);
|
||||
foreach (var dungeonScoreMapSummary in Runs)
|
||||
dungeonScoreMapSummary.Write(data);
|
||||
@@ -61,7 +63,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid GuildGUID;
|
||||
public uint NativeRealmAddress;
|
||||
public uint VirtualRealmAddress;
|
||||
public short ChrSpecializationID;
|
||||
public int ChrSpecializationID;
|
||||
public short RaceID;
|
||||
public int ItemLevel;
|
||||
public int CovenantID;
|
||||
@@ -75,7 +77,7 @@ namespace Game.Networking.Packets
|
||||
data.WritePackedGuid(GuildGUID);
|
||||
data.WriteUInt32(NativeRealmAddress);
|
||||
data.WriteUInt32(VirtualRealmAddress);
|
||||
data.WriteInt16(ChrSpecializationID);
|
||||
data.WriteInt32(ChrSpecializationID);
|
||||
data.WriteInt16(RaceID);
|
||||
data.WriteInt32(ItemLevel);
|
||||
data.WriteInt32(CovenantID);
|
||||
@@ -157,7 +159,13 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
data.WriteInt32(Season);
|
||||
data.WriteInt32(Maps.Count);
|
||||
data.WriteUInt32(0);
|
||||
data.WriteFloat(SeasonScore);
|
||||
data.WriteFloat(0);
|
||||
|
||||
foreach (var map in Maps)
|
||||
map.Write(data);
|
||||
|
||||
foreach (var map in Maps)
|
||||
map.Write(data);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt8(options.OptionNPC);
|
||||
_worldPacket.WriteUInt8(options.OptionFlags);
|
||||
_worldPacket.WriteInt32(options.OptionCost);
|
||||
_worldPacket.WriteUInt32(options.OptionLanguage);
|
||||
|
||||
_worldPacket.WriteBits(options.Text.GetByteCount(), 12);
|
||||
_worldPacket.WriteBits(options.Confirm.GetByteCount(), 12);
|
||||
@@ -113,9 +114,15 @@ namespace Game.Networking.Packets
|
||||
|
||||
public class GossipComplete : ServerPacket
|
||||
{
|
||||
public bool SuppressSound;
|
||||
|
||||
public GossipComplete() : base(ServerOpcodes.GossipComplete) { }
|
||||
|
||||
public override void Write() { }
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteBit(SuppressSound);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
public class VendorInventory : ServerPacket
|
||||
@@ -341,6 +348,7 @@ namespace Game.Networking.Packets
|
||||
public byte OptionNPC;
|
||||
public byte OptionFlags;
|
||||
public int OptionCost;
|
||||
public uint OptionLanguage;
|
||||
public GossipOptionStatus Status;
|
||||
public string Text;
|
||||
public string Confirm;
|
||||
|
||||
@@ -33,31 +33,26 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
Player = _worldPacket.ReadPackedGuid();
|
||||
Players = new ObjectGuid[_worldPacket.ReadInt32()];
|
||||
for (var i = 0; i < Players.Length; ++i)
|
||||
Players[i] = _worldPacket.ReadPackedGuid();
|
||||
}
|
||||
|
||||
public ObjectGuid Player;
|
||||
public ObjectGuid[] Players;
|
||||
}
|
||||
|
||||
public class QueryPlayerNameResponse : ServerPacket
|
||||
{
|
||||
public QueryPlayerNameResponse() : base(ServerOpcodes.QueryPlayerNameResponse)
|
||||
{
|
||||
Data = new PlayerGuidLookupData();
|
||||
}
|
||||
public List<NameCacheLookupResult> Players = new();
|
||||
|
||||
public QueryPlayerNameResponse() : base(ServerOpcodes.QueryPlayerNameResponse) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt8((sbyte)Result);
|
||||
_worldPacket.WritePackedGuid(Player);
|
||||
|
||||
if (Result == ResponseCodes.Success)
|
||||
Data.Write(_worldPacket);
|
||||
_worldPacket.WriteInt32(Players.Count);
|
||||
foreach (NameCacheLookupResult lookupResult in Players)
|
||||
lookupResult.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public ObjectGuid Player;
|
||||
public ResponseCodes Result; // 0 - full packet, != 0 - only guid
|
||||
public PlayerGuidLookupData Data;
|
||||
}
|
||||
|
||||
public class QueryCreature : ClientPacket
|
||||
@@ -685,6 +680,46 @@ namespace Game.Networking.Packets
|
||||
public DeclinedName DeclinedNames = new();
|
||||
}
|
||||
|
||||
public struct NameCacheUnused920
|
||||
{
|
||||
public uint Unused1;
|
||||
public ObjectGuid Unused2;
|
||||
public string Unused3 = "";
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(Unused1);
|
||||
data.WritePackedGuid(Unused2);
|
||||
data.WriteBits(Unused3.GetByteCount(), 7);
|
||||
data.FlushBits();
|
||||
|
||||
data.WriteString(Unused3);
|
||||
}
|
||||
}
|
||||
|
||||
public struct NameCacheLookupResult
|
||||
{
|
||||
public ObjectGuid Player;
|
||||
public byte Result = 0; // 0 - full packet, != 0 - only guid
|
||||
public PlayerGuidLookupData Data;
|
||||
public NameCacheUnused920? Unused920;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt8(Result);
|
||||
data.WritePackedGuid(Player);
|
||||
data.WriteBit(Data != null);
|
||||
data.WriteBit(Unused920.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
if (Data != null)
|
||||
Data.Write(data);
|
||||
|
||||
if (Unused920.HasValue)
|
||||
Unused920.Value.Write(data);
|
||||
}
|
||||
}
|
||||
|
||||
public class CreatureXDisplay
|
||||
{
|
||||
public CreatureXDisplay(uint creatureDisplayID, float displayScale, float probability)
|
||||
|
||||
@@ -850,8 +850,11 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(SenderGUID);
|
||||
_worldPacket.WriteInt32(UiTextureKitID);
|
||||
_worldPacket.WriteUInt32(SoundKitID);
|
||||
_worldPacket.WriteUInt32(CloseUISoundKitID);
|
||||
_worldPacket.WriteUInt8(NumRerolls);
|
||||
_worldPacket.WriteInt64(Duration);
|
||||
_worldPacket.WriteBits(Question.GetByteCount(), 8);
|
||||
_worldPacket.WriteBits(PendingChoiceText.GetByteCount(), 8);
|
||||
_worldPacket.WriteBit(CloseChoiceFrame);
|
||||
_worldPacket.WriteBit(HideWarboardHeader);
|
||||
_worldPacket.WriteBit(KeepOpenAfterChoice);
|
||||
@@ -861,14 +864,18 @@ namespace Game.Networking.Packets
|
||||
response.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteString(Question);
|
||||
_worldPacket.WriteString(PendingChoiceText);
|
||||
}
|
||||
|
||||
public ObjectGuid SenderGUID;
|
||||
public int ChoiceID;
|
||||
public int UiTextureKitID;
|
||||
public uint SoundKitID;
|
||||
public uint CloseUISoundKitID;
|
||||
public byte NumRerolls;
|
||||
public long Duration;
|
||||
public string Question;
|
||||
public string PendingChoiceText;
|
||||
public List<PlayerChoiceResponse> Responses = new();
|
||||
public bool CloseChoiceFrame;
|
||||
public bool HideWarboardHeader;
|
||||
@@ -1278,8 +1285,8 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
public int Unused901_1;
|
||||
public int TypeArtFileID;
|
||||
public int Rarity;
|
||||
public uint RarityColor;
|
||||
public int? Rarity;
|
||||
public uint? RarityColor;
|
||||
public int Unused901_2;
|
||||
public int SpellID;
|
||||
public int MaxStacks;
|
||||
@@ -1288,11 +1295,18 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
data.WriteInt32(Unused901_1);
|
||||
data.WriteInt32(TypeArtFileID);
|
||||
data.WriteInt32(Rarity);
|
||||
data.WriteUInt32(RarityColor);
|
||||
data.WriteInt32(Unused901_2);
|
||||
data.WriteInt32(SpellID);
|
||||
data.WriteInt32(MaxStacks);
|
||||
data.WriteBit(Rarity.HasValue);
|
||||
data.WriteBit(RarityColor.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
if (Rarity.HasValue)
|
||||
data.WriteInt32(Rarity.Value);
|
||||
|
||||
if (RarityColor.HasValue)
|
||||
data.WriteUInt32(RarityColor.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,14 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteUInt32(ClubsPresenceUpdateTimer);
|
||||
_worldPacket.WriteUInt32(HiddenUIClubsPresenceUpdateTimer);
|
||||
|
||||
_worldPacket.WriteInt32(GameRuleUnknown1);
|
||||
_worldPacket.WriteInt32(GameRuleValues.Count);
|
||||
|
||||
_worldPacket.WriteInt16(MaxPlayerNameQueriesPerPacket);
|
||||
|
||||
foreach (GameRuleValuePair gameRuleValue in GameRuleValues)
|
||||
gameRuleValue.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(VoiceEnabled);
|
||||
_worldPacket.WriteBit(EuropaTicketSystemStatus.HasValue);
|
||||
_worldPacket.WriteBit(ScrollOfResurrectionEnabled);
|
||||
@@ -152,6 +160,8 @@ namespace Game.Networking.Packets
|
||||
public uint ClubsPresenceUpdateTimer;
|
||||
public uint HiddenUIClubsPresenceUpdateTimer; // Timer for updating club presence when communities ui frame is hidden
|
||||
public uint KioskSessionMinutes;
|
||||
public int GameRuleUnknown1;
|
||||
public short MaxPlayerNameQueriesPerPacket = 50;
|
||||
public bool ItemRestorationButtonEnabled;
|
||||
public bool CharUndeleteEnabled; // Implemented
|
||||
public bool BpayStoreDisabledByParentalControls;
|
||||
@@ -184,6 +194,7 @@ namespace Game.Networking.Packets
|
||||
public SocialQueueConfig QuickJoinConfig;
|
||||
public SquelchInfo Squelch;
|
||||
public RafSystemFeatureInfo RAFSystem;
|
||||
public List<GameRuleValuePair> GameRuleValues = new();
|
||||
|
||||
public struct SessionAlertConfig
|
||||
{
|
||||
@@ -276,10 +287,15 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(ActiveClassTrialBoostType);
|
||||
_worldPacket.WriteInt32(MinimumExpansionLevel);
|
||||
_worldPacket.WriteInt32(MaximumExpansionLevel);
|
||||
_worldPacket.WriteInt32(GameRuleUnknown1);
|
||||
_worldPacket.WriteInt32(GameRuleValues.Count);
|
||||
_worldPacket.WriteInt16(MaxPlayerNameQueriesPerPacket);
|
||||
|
||||
foreach (var sourceRegion in LiveRegionCharacterCopySourceRegions)
|
||||
_worldPacket.WriteInt32(sourceRegion);
|
||||
|
||||
foreach (GameRuleValuePair gameRuleValue in GameRuleValues)
|
||||
gameRuleValue.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public bool BpayStoreAvailable; // NYI
|
||||
@@ -310,6 +326,9 @@ namespace Game.Networking.Packets
|
||||
public int MinimumExpansionLevel;
|
||||
public int MaximumExpansionLevel;
|
||||
public uint KioskSessionMinutes;
|
||||
public int GameRuleUnknown1;
|
||||
public List<GameRuleValuePair> GameRuleValues = new();
|
||||
public short MaxPlayerNameQueriesPerPacket = 50;
|
||||
}
|
||||
|
||||
public class MOTD : ServerPacket
|
||||
@@ -383,4 +402,16 @@ namespace Game.Networking.Packets
|
||||
ThrottleState.Write(data);
|
||||
}
|
||||
}
|
||||
|
||||
public struct GameRuleValuePair
|
||||
{
|
||||
public int Rule;
|
||||
public int Value;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(Rule);
|
||||
data.WriteInt32(Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user