mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Packets: fixed SMSG_AURA_UPDATE, SMSG_SPELL_START, SMSG_SPELL_GO packet structures
This commit is contained in:
@@ -187,7 +187,7 @@ ByteBuffer& operator<<(ByteBuffer& data, ContentTuningParams const& contentTunin
|
||||
ByteBuffer& operator>>(ByteBuffer& data, SpellCastVisual& visual)
|
||||
{
|
||||
data >> visual.SpellXSpellVisualID;
|
||||
data >> visual.ScriptVisualID;
|
||||
//data >> visual.ScriptVisualID;
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ ByteBuffer& operator>>(ByteBuffer& data, SpellCastVisual& visual)
|
||||
ByteBuffer& operator<<(ByteBuffer& data, SpellCastVisual const& visual)
|
||||
{
|
||||
data << int32(visual.SpellXSpellVisualID);
|
||||
data << int32(visual.ScriptVisualID);
|
||||
//data << int32(visual.ScriptVisualID);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -331,12 +331,6 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellMissStatus const& spellMissStatus)
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, SpellHitStatus const& spellHitStatus)
|
||||
{
|
||||
data << uint8(spellHitStatus.Reason);
|
||||
return data;
|
||||
}
|
||||
|
||||
ByteBuffer& operator<<(ByteBuffer& data, SpellPowerData const& spellPowerData)
|
||||
{
|
||||
data << int32(spellPowerData.Cost);
|
||||
@@ -389,19 +383,23 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
|
||||
data << uint32(spellCastData.CastFlagsEx);
|
||||
data << uint32(spellCastData.CastTime);
|
||||
data << spellCastData.MissileTrajectory;
|
||||
data << int32(spellCastData.AmmoDisplayID);
|
||||
data << uint8(spellCastData.DestLocSpellCastIndex);
|
||||
data << spellCastData.Immunities;
|
||||
data << spellCastData.Predict;
|
||||
|
||||
data.WriteBits(spellCastData.HitTargets.size(), 16);
|
||||
data.WriteBits(spellCastData.MissTargets.size(), 16);
|
||||
data.WriteBits(spellCastData.HitStatus.size(), 16);
|
||||
data.WriteBits(spellCastData.MissStatus.size(), 16);
|
||||
data.WriteBits(spellCastData.RemainingPower.size(), 9);
|
||||
data.WriteBit(spellCastData.RemainingRunes.has_value());
|
||||
data.WriteBits(spellCastData.TargetPoints.size(), 16);
|
||||
data.WriteBit(spellCastData.AmmoDisplayID.has_value());
|
||||
data.WriteBit(spellCastData.AmmoInventoryType.has_value());
|
||||
data.FlushBits();
|
||||
|
||||
for (SpellMissStatus const& missStatus : spellCastData.MissStatus)
|
||||
data << missStatus;
|
||||
|
||||
data << spellCastData.Target;
|
||||
|
||||
for (ObjectGuid const& hitTarget : spellCastData.HitTargets)
|
||||
@@ -410,12 +408,6 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
|
||||
for (ObjectGuid const& missTarget : spellCastData.MissTargets)
|
||||
data << missTarget;
|
||||
|
||||
for (SpellHitStatus const& hitStatus : spellCastData.HitStatus)
|
||||
data << hitStatus;
|
||||
|
||||
for (SpellMissStatus const& missStatus : spellCastData.MissStatus)
|
||||
data << missStatus;
|
||||
|
||||
for (SpellPowerData const& power : spellCastData.RemainingPower)
|
||||
data << power;
|
||||
|
||||
@@ -425,6 +417,12 @@ ByteBuffer& operator<<(ByteBuffer& data, SpellCastData const& spellCastData)
|
||||
for (TargetLocation const& targetLoc : spellCastData.TargetPoints)
|
||||
data << targetLoc;
|
||||
|
||||
if (spellCastData.AmmoDisplayID.has_value())
|
||||
data << int32(*spellCastData.AmmoDisplayID);
|
||||
|
||||
if (spellCastData.AmmoInventoryType.has_value())
|
||||
data << int32(*spellCastData.AmmoInventoryType);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@@ -300,14 +300,6 @@ namespace WorldPackets
|
||||
ObjectGuid ServerCastID;
|
||||
};
|
||||
|
||||
struct SpellHitStatus
|
||||
{
|
||||
SpellHitStatus() { }
|
||||
SpellHitStatus(uint8 reason) : Reason(reason) { }
|
||||
|
||||
uint8 Reason = 0;
|
||||
};
|
||||
|
||||
struct SpellMissStatus
|
||||
{
|
||||
SpellMissStatus() { }
|
||||
@@ -362,13 +354,13 @@ namespace WorldPackets
|
||||
uint32 CastTime = 0;
|
||||
std::vector<ObjectGuid> HitTargets;
|
||||
std::vector<ObjectGuid> MissTargets;
|
||||
std::vector<SpellHitStatus> HitStatus;
|
||||
std::vector<SpellMissStatus> MissStatus;
|
||||
SpellTargetData Target;
|
||||
std::vector<SpellPowerData> RemainingPower;
|
||||
Optional<RuneData> RemainingRunes;
|
||||
MissileTrajectoryResult MissileTrajectory;
|
||||
int32 AmmoDisplayID;
|
||||
Optional<int32> AmmoDisplayID;
|
||||
Optional<int32> AmmoInventoryType;
|
||||
uint8 DestLocSpellCastIndex = 0;
|
||||
std::vector<TargetLocation> TargetPoints;
|
||||
CreatureImmunities Immunities;
|
||||
|
||||
@@ -4871,7 +4871,6 @@ void Spell::UpdateSpellCastDataTargets(WorldPackets::Spells::SpellCastData& data
|
||||
if (targetInfo.MissCondition == SPELL_MISS_NONE || (targetInfo.MissCondition == SPELL_MISS_BLOCK && !m_spellInfo->HasAttribute(SPELL_ATTR3_COMPLETELY_BLOCKED))) // Add only hits and partial blocked
|
||||
{
|
||||
data.HitTargets.push_back(targetInfo.TargetGUID);
|
||||
data.HitStatus.emplace_back(SPELL_MISS_NONE);
|
||||
|
||||
m_channelTargetEffectMask |= targetInfo.EffectMask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user