Core/PacketIO: Implemented CMSG_UPDATE_AREA_TRIGGER_VISUAL

This commit is contained in:
Shauren
2025-06-05 12:31:33 +02:00
parent 8d3b81d499
commit b88f4b7f4f
7 changed files with 61 additions and 13 deletions

View File

@@ -16,6 +16,8 @@
*/
#include "WorldSession.h"
#include "AreaTrigger.h"
#include "AreaTriggerPackets.h"
#include "CollectionMgr.h"
#include "Common.h"
#include "DatabaseEnv.h"
@@ -607,6 +609,22 @@ void WorldSession::HandleUpdateAuraVisual(WorldPackets::Spells::UpdateAuraVisual
_player->SetChannelVisual({ .SpellXSpellVisualID = spellXspellVisualId });
}
void WorldSession::HandleUpdateAreaTriggerVisual(WorldPackets::AreaTrigger::UpdateAreaTriggerVisual const& updateAreaTriggerVisual)
{
AreaTrigger* target = ObjectAccessor::GetAreaTrigger(*_player, updateAreaTriggerVisual.TargetGUID);
if (!target)
return;
if (target->GetCasterGuid() != _player->GetGUID())
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(target->m_areaTriggerData->SpellForVisuals, _player->GetMap()->GetDifficultyID());
if (!spellInfo)
return;
target->SetSpellVisual({ .SpellXSpellVisualID = _player->GetCastSpellXSpellVisualId(spellInfo) });
}
void WorldSession::HandleKeyboundOverride(WorldPackets::Spells::KeyboundOverride& keyboundOverride)
{
Player* player = GetPlayer();