Core/Spells: handle SpellXSpellVisualID update field

This commit is contained in:
Ovahlord
2024-01-28 23:58:24 +01:00
parent a857a38924
commit b2da790116
2 changed files with 12 additions and 0 deletions

View File

@@ -1494,6 +1494,16 @@ class TC_GAME_API Unit : public WorldObject
.ModifyValue(&UF::UnitData::ChannelData)
.ModifyValue(&UF::UnitChannel::SpellID), channelSpellId);
}
uint32 GetChannelSpellXSpellVisualId() const { return m_unitData->ChannelData->SpellXSpellVisualID; }
void SetChannelSpellXSpellVisualId(uint32 channelSpellXSpellVisualId)
{
SetUpdateFieldValue(m_values
.ModifyValue(&Unit::m_unitData)
.ModifyValue(&UF::UnitData::ChannelData)
.ModifyValue(&UF::UnitChannel::SpellXSpellVisualID), channelSpellXSpellVisualId);
}
void AddChannelObject(ObjectGuid guid) { AddDynamicUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::ChannelObjects)) = guid; }
void SetChannelObject(uint32 slot, ObjectGuid guid) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::ChannelObjects, slot), guid); }
void RemoveChannelObject(ObjectGuid guid)

View File

@@ -5189,6 +5189,7 @@ void Spell::SendChannelUpdate(uint32 time)
{
unitCaster->ClearChannelObjects();
unitCaster->SetChannelSpellId(0);
unitCaster->SetChannelSpellXSpellVisualId(0);
}
WorldPackets::Spells::SpellChannelUpdate spellChannelUpdate;
@@ -5250,6 +5251,7 @@ void Spell::SendChannelStart(uint32 duration)
creatureCaster->SetSpellFocus(this, ObjectAccessor::GetWorldObject(*creatureCaster, unitCaster->m_unitData->ChannelObjects[0]));
unitCaster->SetChannelSpellId(m_spellInfo->Id);
unitCaster->SetChannelSpellXSpellVisualId(m_SpellVisual.SpellXSpellVisualID);
WorldPackets::Spells::SpellChannelStart spellChannelStart;
spellChannelStart.CasterGUID = unitCaster->GetGUID();