Skip to content

Commit

Permalink
Spell: Make phase auras stackable
Browse files Browse the repository at this point in the history
This will definitely cause issues but it is correct vs all evidence
  • Loading branch information
killerwife committed Jun 23, 2024
1 parent 1198fd1 commit 8816bec
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9500,15 +9500,14 @@ void Aura::HandlePhase(bool apply, bool Real)

Unit* target = GetTarget();

// always non stackable
if (apply)
{
Unit::AuraList const& phases = target->GetAurasByType(SPELL_AURA_PHASE);
if (!phases.empty())
target->RemoveAurasDueToSpell(phases.front()->GetId(), GetHolder());
}

target->SetPhaseMask(apply ? GetMiscValue() : uint32(PHASEMASK_NORMAL), true);
// 57673 and 56678 - specifically stack
uint32 newPhase = 0;
Unit::AuraList const& phases = target->GetAurasByType(SPELL_AURA_PHASE);
if (!phases.empty())
for (auto itr = phases.begin(); itr != phases.end(); ++itr)
newPhase |= (*itr)->GetMiscValue();

target->SetPhaseMask(newPhase ? newPhase : uint32(PHASEMASK_NORMAL), true);
// no-phase is also phase state so same code for apply and remove
if (target->GetTypeId() == TYPEID_PLAYER)
{
Expand Down

0 comments on commit 8816bec

Please sign in to comment.