Core/Spells: implement DoT clipping

* Core/Spells: Implementation of DoT clipping.
* Core/Utilities: Backport "EnumFlags v3.0" from master.
* Core/Spells: Switch AURA_REMOVE_MODE to a flag set.
This commit is contained in:
Warpten authored and GitHub committed 2020-06-04 18:16:03 +02:00
1 parent 6498452dd1
commit 0af44ccc01
72 files changed
+597 -499

No files matched your search

@@ -2540,7 +2540,7 @@ class spell_terrastra_harden_skin : public AuraScript
void OnAuraRemoveHandler(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
if (Unit* target = GetTarget())
target->CastCustomSpell(SPELL_SHATTER, SPELLVALUE_BASE_POINT0, _absorbedDamage, nullptr, true, nullptr, aurEff);
}
@@ -1274,8 +1274,7 @@ class spell_valiona_blackout: public SpellScriptLoader
void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL
|| GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell | AuraRemoveFlags::Expired))
if (Unit* target = GetTarget())
target->CastSpell(target, SPELL_BLACKOUT_DAMAGE, true);
}
@@ -797,7 +797,7 @@ struct boss_nefarians_end : public BossAI
if (Creature* onyxia = instance->GetCreature(DATA_ONYXIA))
if (Aura* charge = onyxia->GetAura(SPELL_ELECTRICAL_CHARGE_ONYXIA))
charge->ModStackAmount(17, AURA_REMOVE_BY_DEFAULT, false);
charge->ModStackAmount(17, AuraRemoveFlags::ByDefault | AuraRemoveFlags::DontResetPeriodicTimer);
break;
case EVENT_DOMINION:
DoCastAOE(SPELL_DOMINION_DUMMY);
@@ -1402,7 +1402,7 @@ class spell_nefarians_end_electrical_charge : public AuraScript
if (Creature* onyxia = instance->GetCreature(DATA_ONYXIA))
{
if (Aura* charge = onyxia->GetAura(SPELL_ELECTRICAL_CHARGE_ONYXIA))
charge->ModStackAmount(1, AURA_REMOVE_BY_DEFAULT, false);
charge->ModStackAmount(1, AuraRemoveFlags::Expired | AuraRemoveFlags::DontResetPeriodicTimer);
}
}
break;
@@ -2064,7 +2064,7 @@ class spell_nefarians_end_explosive_cinders : public AuraScript
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
GetTarget()->CastSpell(GetTarget(), SPELL_EXPLOSIVE_CINDERS_EXPLOSION, true);
}
@@ -1287,7 +1287,7 @@ class spell_omnotron_recharging : public AuraScript
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Creature* golem = GetTarget()->ToCreature())
if (golem->IsAIEnabled)
golem->AI()->DoAction(ACTION_ACTIVATE_GOLEM);
@@ -1495,7 +1495,7 @@ class spell_omnotron_barrier : public AuraScript
void HandleAbsorbRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_BACKDRAFT, true);
}
@@ -335,7 +335,7 @@ class spell_cookie_satiated : public SpellScriptLoader
{
if (Unit* caster = GetCaster())
if (Aura* nauseatedAura = caster->GetAura(GetSpellInfo()->Effects[effIndex].BasePoints))
nauseatedAura->ModStackAmount(-1, AURA_REMOVE_BY_DEFAULT, false);
nauseatedAura->ModStackAmount(-1, AuraRemoveFlags::ByDefault | AuraRemoveFlags::DontResetPeriodicTimer);
}
void Register() override
@@ -553,7 +553,7 @@ class spell_erudax_twilight_corruption: public SpellScriptLoader
void OnAuraRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
{
if (Unit* caster = GetCaster())
if (Creature* creature = caster->ToCreature())
@@ -63,7 +63,7 @@ class spell_sfk_shield_of_bones : public AuraScript
void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_SHIELD_OF_BONES_TRIGGERED, true);
}
@@ -647,7 +647,7 @@ class spell_dark_fiend_skin : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
return;
if (Creature* target = GetTarget()->ToCreature())
@@ -473,7 +473,7 @@ class spell_countdown_p2 : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
GetTarget()->CastSpell((Unit*)nullptr, SPELL_COUNTDOWN_4, true);
GetTarget()->ToPlayer()->RemoveAurasDueToSpell(SPELL_COUNTDOWN_5);
}
@@ -742,7 +742,7 @@ class spell_baleroc_tormented : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
{
if (GetTarget()->GetMap()->IsHeroic())
GetTarget()->CastSpell(GetTarget(), SPELL_TORMENTED_40, true);
@@ -388,7 +388,7 @@ class spell_anhuur_reverberating_hymn : public AuraScript
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Creature * anhuur = GetCaster()->ToCreature())
if (anhuur->IsAIEnabled)
anhuur->AI()->DoAction(ACTION_HYMN_EXPIRED);
@@ -1078,7 +1078,7 @@ class spell_conclave_of_wind_winds_pre_effect_warning : public AuraScript
void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Unit* caster = GetCaster())
if (Creature* conclave = caster->ToCreature())
if (conclave->IsAIEnabled)
@@ -296,7 +296,7 @@ class spell_ozruk_paralyze_stun : public AuraScript
void OnAuraRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Unit* target = GetUnitOwner())
target->CastSpell(target, SPELL_PARALYZE_DAMAGE, true);
}
@@ -1058,7 +1058,7 @@ class spell_hadronox_leeching_poison : public SpellScriptLoader
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
return;
if (GetTarget()->IsGuardian())
@@ -1009,7 +1009,7 @@ class spell_gatewatcher_web_wrap : public SpellScriptLoader
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
if (Unit* target = GetTarget())
@@ -1416,7 +1416,7 @@ class spell_halion_meteor_strike_marker : public SpellScriptLoader
if (!GetCaster())
return;
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Creature* creCaster = GetCaster()->ToCreature())
creCaster->AI()->DoAction(ACTION_METEOR_STRIKE_AOE);
}
@@ -1452,11 +1452,11 @@ class spell_halion_combustion_consumption : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
return;
if (GetTarget()->HasAura(_markSpell))
GetTarget()->RemoveAurasDueToSpell(_markSpell, ObjectGuid::Empty, 0, AURA_REMOVE_BY_EXPIRE);
GetTarget()->RemoveAurasDueToSpell(_markSpell, ObjectGuid::Empty, 0, AuraRemoveFlags::Expired);
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1554,12 +1554,12 @@ class spell_halion_marks : public SpellScriptLoader
if (Unit* dispelledUnit = GetUnitOwner())
if (dispelledUnit->HasAura(_removeSpellId))
dispelledUnit->RemoveAurasDueToSpell(_removeSpellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_EXPIRE);
dispelledUnit->RemoveAurasDueToSpell(_removeSpellId, ObjectGuid::Empty, 0, AuraRemoveFlags::Expired);
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
// Stacks marker
@@ -1655,7 +1655,7 @@ class spell_halion_twilight_realm_handlers : public SpellScriptLoader
if (!target)
return;
target->RemoveAurasDueToSpell(_beforeHitSpellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL);
target->RemoveAurasDueToSpell(_beforeHitSpellId, ObjectGuid::Empty, 0, AuraRemoveFlags::ByEnemySpell);
if (InstanceScript* instance = target->GetInstanceScript())
instance->SendEncounterUnit(ENCOUNTER_FRAME_UNK7);
}
@@ -144,7 +144,7 @@ class spell_marwyn_shared_suffering : public SpellScriptLoader
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
return;
if (Unit* caster = GetCaster())
@@ -246,7 +246,7 @@ class spell_trash_npc_glacial_strike : public SpellScriptLoader
{
if (GetTarget()->IsFullHealth())
{
GetTarget()->RemoveAura(GetId(), ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL);
GetTarget()->RemoveAura(GetId(), ObjectGuid::Empty, 0, AuraRemoveFlags::ByEnemySpell);
PreventDefaultAction();
}
}
@@ -502,7 +502,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader
return;
uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_FRENZIED_BLOODTHIRST, GetCaster());
GetCaster()->RemoveAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL);
GetCaster()->RemoveAura(spellId, ObjectGuid::Empty, 0, AuraRemoveFlags::ByEnemySpell);
GetCaster()->CastSpell(GetCaster(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, TRIGGERED_FULL_MASK);
// Shadowmourne questline
@@ -561,7 +561,7 @@ class spell_blood_queen_frenzied_bloodthirst : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (InstanceScript* instance = target->GetInstanceScript())
if (Creature* bloodQueen = ObjectAccessor::GetCreature(*target, instance->GetGuidData(DATA_BLOOD_QUEEN_LANA_THEL)))
{
@@ -1826,7 +1826,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
if (GetTarget()->movespline->Finalized())
Remove(AURA_REMOVE_BY_EXPIRE);
Remove(AuraRemoveFlags::Expired);
}
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
@@ -1078,7 +1078,7 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader
uint32 adhesiveId = sSpellMgr->GetSpellIdForDifficulty(SPELL_VOLATILE_OOZE_ADHESIVE, GetCaster());
if (GetHitUnit()->HasAura(adhesiveId))
{
GetHitUnit()->RemoveAurasDueToSpell(adhesiveId, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL);
GetHitUnit()->RemoveAurasDueToSpell(adhesiveId, GetCaster()->GetGUID(), 0, AuraRemoveFlags::ByEnemySpell);
GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true);
}
}
@@ -1241,7 +1241,7 @@ class spell_sindragosa_instability : public SpellScriptLoader
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
GetTarget()->CastCustomSpell(SPELL_BACKLASH, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff, GetCasterGUID());
}
@@ -1676,7 +1676,7 @@ class npc_strangulate_vehicle : public CreatureScript
else
{
summoner->CastSpell(summoner, SPELL_HARVEST_SOULS_TELEPORT, true);
summoner->RemoveAurasDueToSpell(HARVEST_SOUL, ObjectGuid::Empty, 0, AURA_REMOVE_BY_EXPIRE);
summoner->RemoveAurasDueToSpell(HARVEST_SOUL, ObjectGuid::Empty, 0, AuraRemoveFlags::Expired);
}
}
}
@@ -2064,7 +2064,7 @@ class spell_the_lich_king_infest : public SpellScriptLoader
if (GetUnitOwner()->HealthAbovePct(90))
{
PreventDefaultAction();
Remove(AURA_REMOVE_BY_ENEMY_SPELL);
Remove(AuraRemoveFlags::ByEnemySpell);
}
}
@@ -2106,15 +2106,8 @@ class spell_the_lich_king_necrotic_plague : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
switch (GetTargetApplication()->GetRemoveMode())
{
case AURA_REMOVE_BY_ENEMY_SPELL:
case AURA_REMOVE_BY_EXPIRE:
case AURA_REMOVE_BY_DEATH:
break;
default:
return;
}
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell | AuraRemoveFlags::Expired | AuraRemoveFlags::ByDeath))
return;
CustomSpellValues values;
//values.AddSpellMod(SPELLVALUE_AURA_STACK, 2);
@@ -2169,7 +2162,7 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
void AddMissingStack()
{
if (GetHitAura() && !_hadAura && GetSpellValue()->EffectBasePoints[EFFECT_1] != AURA_REMOVE_BY_ENEMY_SPELL)
if (GetHitAura() && !_hadAura && GetSpellValue()->EffectBasePoints[EFFECT_1] != static_cast<uint32>(AuraRemoveFlags::ByEnemySpell))
GetHitAura()->ModStackAmount(1);
}
@@ -2204,20 +2197,15 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
_lastAmount = aurEff->GetAmount();
switch (GetTargetApplication()->GetRemoveMode())
{
case AURA_REMOVE_BY_EXPIRE:
case AURA_REMOVE_BY_DEATH:
break;
default:
return;
}
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired | AuraRemoveFlags::ByDeath))
{
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
}
}
void OnDispel(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
@@ -2233,12 +2221,12 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader
CustomSpellValues values;
values.AddSpellMod(SPELLVALUE_AURA_STACK, GetStackAmount());
values.AddSpellMod(SPELLVALUE_BASE_POINT1, AURA_REMOVE_BY_ENEMY_SPELL); // add as marker (spell has no effect 1)
values.AddSpellMod(SPELLVALUE_BASE_POINT1, static_cast<uint32>(AuraRemoveFlags::ByEnemySpell)); // add as marker (spell has no effect 1)
GetTarget()->CastCustomSpell(SPELL_NECROTIC_PLAGUE_JUMP, values, nullptr, TRIGGERED_FULL_MASK, nullptr, nullptr, GetCasterGUID());
if (Unit* caster = GetCaster())
caster->CastSpell(caster, SPELL_PLAGUE_SIPHON, true);
Remove(AURA_REMOVE_BY_ENEMY_SPELL);
Remove(AuraRemoveFlags::ByEnemySpell);
}
void Register() override
@@ -2274,7 +2262,7 @@ class spell_the_lich_king_shadow_trap_visual : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
GetTarget()->CastSpell(GetTarget(), SPELL_SHADOW_TRAP_AURA, TRIGGERED_NONE);
}
@@ -2844,7 +2832,7 @@ class spell_the_lich_king_harvest_soul : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// m_originalCaster to allow stacking from different casters, meh
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
GetTarget()->CastSpell((Unit*)nullptr, SPELL_HARVESTED_SOUL, true, nullptr, nullptr, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
}
@@ -3040,7 +3028,7 @@ class spell_the_lich_king_in_frostmourne_room : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// m_originalCaster to allow stacking from different casters, meh
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
GetTarget()->CastSpell((Unit*)nullptr, SPELL_HARVESTED_SOUL, true, nullptr, nullptr, GetTarget()->GetInstanceScript()->GetGuidData(DATA_THE_LICH_KING));
}
@@ -156,8 +156,8 @@ class spell_grobbulus_mutating_injection : public SpellScriptLoader
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell)
&& !GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
if (Unit* caster = GetCaster())
@@ -178,7 +178,7 @@ class spell_loatheb_deathbloom : public SpellScriptLoader
void AfterRemove(AuraEffect const* eff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
GetTarget()->CastSpell(nullptr, SPELL_DEATHBLOOM_FINAL_DAMAGE, true, nullptr, eff, GetCasterGUID());
@@ -527,7 +527,7 @@ class spell_oculus_shock_lance : public SpellScriptLoader
if (AuraEffect const* shockCharges = target->GetAuraEffect(SPELL_AMBER_SHOCK_CHARGE, EFFECT_0, GetCaster()->GetGUID()))
{
damage += shockCharges->GetAmount();
shockCharges->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL);
shockCharges->GetBase()->Remove(AuraRemoveFlags::ByEnemySpell);
}
}
@@ -1072,7 +1072,7 @@ class spell_algalon_phase_punch : public SpellScriptLoader
GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 2]);
GetTarget()->CastSpell(GetTarget(), PhasePunchAlphaId[GetStackAmount() - 1], TRIGGERED_FULL_MASK);
if (GetStackAmount() == 5)
Remove(AURA_REMOVE_BY_DEFAULT);
Remove(AuraRemoveFlags::ByDefault);
}
void OnRemove(AuraEffect const*, AuraEffectHandleModes)
@@ -664,7 +664,7 @@ class spell_shield_of_runes : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
caster->CastSpell(caster, SPELL_SHIELD_OF_RUNES_BUFF, false);
}
@@ -532,7 +532,7 @@ class spell_ulduar_stone_grip_absorb : public SpellScriptLoader
//! What we do here is remove all harmful aura's related and teleport to safe spot.
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
return;
if (!GetOwner()->ToCreature())
@@ -2121,7 +2121,7 @@ class spell_iron_ring_guard_impale : public SpellScriptLoader
{
if (GetTarget()->HealthAbovePct(GetSpellInfo()->Effects[EFFECT_1].CalcValue()))
{
Remove(AURA_REMOVE_BY_ENEMY_SPELL);
Remove(AuraRemoveFlags::ByEnemySpell);
PreventDefaultAction();
}
}
@@ -1979,7 +1979,7 @@ class SanityReduction : public SpellScript
{
if (Unit* target = GetHitUnit())
if (Aura* sanity = target->GetAura(SPELL_SANITY))
sanity->ModStackAmount(-int32(_stacks), AURA_REMOVE_BY_ENEMY_SPELL);
sanity->ModStackAmount(-int32(_stacks), AuraRemoveFlags::ByEnemySpell);
}
protected:
@@ -2077,15 +2077,8 @@ class spell_yogg_saron_malady_of_the_mind : public SpellScriptLoader // 63830
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
switch (GetTargetApplication()->GetRemoveMode())
{
case AURA_REMOVE_BY_ENEMY_SPELL:
case AURA_REMOVE_BY_EXPIRE:
case AURA_REMOVE_BY_DEATH:
break;
default:
return;
}
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell | AuraRemoveFlags::Expired | AuraRemoveFlags::ByDeath))
return;
GetTarget()->CastSpell(GetTarget(), SPELL_MALADY_OF_THE_MIND_JUMP);
}
@@ -2153,7 +2146,7 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802
if (SaraAI* ai = CAST_AI(SaraAI, caster->GetAI()))
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
ai->RemoveLinkFrom(GetTarget()->GetGUID());
else
{
@@ -2772,7 +2765,7 @@ class spell_yogg_saron_induce_madness : public SpellScriptLoader // 64059
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_TELEPORT_BACK_TO_MAIN_ROOM);
target->RemoveAurasDueToSpell(SPELL_SANITY, ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL);
target->RemoveAurasDueToSpell(SPELL_SANITY, ObjectGuid::Empty, 0, AuraRemoveFlags::ByEnemySpell);
target->RemoveAurasDueToSpell(uint32(GetEffectValue()));
}
}
@@ -2841,7 +2834,7 @@ class spell_yogg_saron_sanity : public SpellScriptLoader // 63050
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
return;
if (InstanceScript* instance = GetTarget()->GetInstanceScript())
@@ -346,7 +346,7 @@ class spell_frost_tomb : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
if (Unit* caster = GetCaster())
if (caster->IsAlive())
if (Creature* creature = caster->ToCreature())
@@ -183,7 +183,7 @@ class boss_ichoron : public CreatureScript
BossAI::SummonedCreatureDespawn(summon);
if (summons.empty())
me->RemoveAurasDueToSpell(SPELL_DRAINED, ObjectGuid::Empty, 0, AURA_REMOVE_BY_EXPIRE);
me->RemoveAurasDueToSpell(SPELL_DRAINED, ObjectGuid::Empty, 0, AuraRemoveFlags::Expired);
}
void UpdateAI(uint32 diff) override
@@ -323,7 +323,7 @@ class spell_ichoron_drained : public SpellScriptLoader
GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_31);
GetTarget()->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (GetTarget()->IsAIEnabled)
GetTarget()->GetAI()->DoAction(ACTION_DRAINED);
}
@@ -396,7 +396,7 @@ class spell_ichoron_protective_bubble : public SpellScriptLoader
void HandleShatter(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
//if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
//if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
if (GetAura()->GetCharges() <= 1)
if (GetTarget()->IsAIEnabled)
GetTarget()->GetAI()->DoAction(ACTION_PROTECTIVE_BUBBLE_SHATTERED);
@@ -445,7 +445,7 @@ class spell_ichoron_splatter : public SpellScriptLoader
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (Aura* aura = GetTarget()->GetAura(SPELL_SHRINK))
aura->ModStackAmount(10);
}
@@ -714,7 +714,7 @@ public:
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE || !GetCaster())
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired) || !GetCaster())
return;
Creature* owner = GetOwner()->ToCreature();
@@ -1126,7 +1126,7 @@ class spell_grip : public SpellScriptLoader
// while we could do ModStackAmount(-stacksToRemove), this is how it's done in sniffs :)
for (uint32 i = 0; i < stacksToRemove; ++i)
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);
ModStackAmount(-1, AuraRemoveFlags::Expired);
if (GetStackAmount() < 15 && !_warning)
{
@@ -1139,7 +1139,7 @@ class spell_grip : public SpellScriptLoader
void HandleDrop(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
GetTarget()->GetAI()->DoAction(ACTION_GRIP_LOST);
@@ -1177,7 +1177,7 @@ class spell_grab_on : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Aura* grip = GetCaster()->GetAura(SPELL_GRIP, GetCaster()->GetGUID()))
grip->ModStackAmount(GetEffectValue(), AURA_REMOVE_BY_DEFAULT/*, false*/);
grip->ModStackAmount(GetEffectValue(), AuraRemoveFlags::ByDefault);
}
void Register() override
@@ -1208,7 +1208,7 @@ class spell_loosen_grip : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Aura* grip = GetCaster()->GetAura(SPELL_GRIP))
grip->ModStackAmount(-StacksLost, AURA_REMOVE_BY_EXPIRE);
grip->ModStackAmount(-StacksLost, AuraRemoveFlags::Expired);
}
void Register() override
@@ -882,7 +882,7 @@ class spell_fetch_ingredient_aura : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (target->HasAura(SPELL_ALCHEMIST_APPRENTICE_INVISBUFF))
if (Creature* finklestein = GetClosestCreatureWithEntry(target, NPC_FINKLESTEIN, 100.0f))
{
@@ -917,8 +917,7 @@ class spell_illidari_dampen_magic : public SpellScriptLoader
{
if (Creature* target = GetTarget()->ToCreature())
{
AuraRemoveMode mode = GetTargetApplication()->GetRemoveMode();
if (mode == AURA_REMOVE_BY_ENEMY_SPELL || mode == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell | AuraRemoveFlags::Expired))
target->AI()->DoAction(ACTION_REFRESH_DAMPEN);
}
}
@@ -414,7 +414,7 @@ class spell_teron_gorefiend_shadow_of_death : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_SUMMON_SPIRIT, true);
@@ -520,7 +520,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// Final heal only on duration end
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
Unit* target = GetUnitOwner();
+1 -1
View File
@@ -667,7 +667,7 @@ class spell_dru_lifebloom : public AuraScript
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
// Final heal only on duration end
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
// final heal
+7 -7
View File
@@ -717,11 +717,11 @@ class spell_gen_break_shield: public SpellScriptLoader
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
aura->ModStackAmount(-1, AuraRemoveFlags::ByEnemySpell);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
defend->ModStackAmount(-1, AuraRemoveFlags::ByEnemySpell);
break;
}
}
@@ -2088,7 +2088,7 @@ class spell_gen_lifebloom : public SpellScriptLoader
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
// Final heal only on duration end
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasAllFlags(AuraRemoveFlags::Expired | AuraRemoveFlags::ByEnemySpell))
return;
// final heal
@@ -2215,11 +2215,11 @@ class spell_gen_mounted_charge: public SpellScriptLoader
SpellInfo const* auraInfo = aura->GetSpellInfo();
if (auraInfo && auraInfo->SpellIconID == 2007 && aura->HasEffectType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN))
{
aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
aura->ModStackAmount(-1, AuraRemoveFlags::ByEnemySpell);
// Remove dummys from rider (Necessary for updating visual shields)
if (Unit* rider = target->GetCharmer())
if (Aura* defend = rider->GetAura(aura->GetId()))
defend->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
defend->ModStackAmount(-1, AuraRemoveFlags::ByEnemySpell);
break;
}
}
@@ -2622,7 +2622,7 @@ class spell_gen_paralytic_poison : public SpellScriptLoader
void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
GetTarget()->CastSpell((Unit*)nullptr, SPELL_PARALYSIS, true, nullptr, aurEff);
@@ -3505,7 +3505,7 @@ class spell_gen_turkey_marker : public SpellScriptLoader
// pop stack if it expired for us
if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);
ModStackAmount(-1, AuraRemoveFlags::Expired);
}
void Register() override
+1 -1
View File
@@ -1131,7 +1131,7 @@ class spell_brewfest_giddyup : public SpellScriptLoader
break;
}
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDefault))
{
target->RemoveAura(SPELL_RAM_TROT);
target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
+1 -1
View File
@@ -557,7 +557,7 @@ class spell_hun_misdirection : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT || !GetTarget()->HasAura(SPELL_HUNTER_MISDIRECTION_PROC))
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDefault) || !GetTarget()->HasAura(SPELL_HUNTER_MISDIRECTION_PROC))
GetTarget()->ResetRedirectThreat();
}
+1 -1
View File
@@ -4711,7 +4711,7 @@ class spell_item_egg_shell : public AuraScript
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_CANCEL)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByCancel))
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Id == SPELL_EGG_SHELL_NORMAL ? SPELL_EGG_SHELL_PERIODIC_NORMAL : SPELL_EGG_SHELL_PERIODIC_HEROIC, true, nullptr, aurEff);
}
+4 -5
View File
@@ -787,8 +787,7 @@ class spell_mage_living_bomb : public AuraScript
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
if (Unit* caster = GetCaster())
@@ -821,7 +820,7 @@ class spell_mage_ice_barrier : public SpellScriptLoader
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
return;
if (GetTarget()->HasAura(SPELL_MAGE_SHATTERED_BARRIER_R1))
@@ -984,7 +983,7 @@ class spell_mage_mana_shield : public SpellScriptLoader
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByEnemySpell))
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_KNOCKBACK, true);
}
@@ -1380,7 +1379,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
if (GetCaster())
GetCaster()->CastSpell(GetTarget(), SPELL_MAGE_RING_OF_FROST_DUMMY, true);
}
+1 -1
View File
@@ -2544,7 +2544,7 @@ class spell_q10929_fumping : SpellScriptLoader
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
return;
if (Unit* caster = GetCaster())
+2 -2
View File
@@ -941,7 +941,7 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT)
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDefault))
GetTarget()->ResetRedirectThreat();
}
@@ -958,7 +958,7 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
Unit* target = GetTarget();
target->CastSpell(_redirectTarget, SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST, true);
target->CastSpell(target, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC, true);
Remove(AURA_REMOVE_BY_DEFAULT); // maybe handle by proc charges
Remove(AuraRemoveFlags::ByDefault); // maybe handle by proc charges
}
void Register() override
+4 -5
View File
@@ -304,8 +304,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader
if (!GetCaster())
return;
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
if (removeMode != AURA_REMOVE_BY_DEATH || !IsExpired())
if (!GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath) || !IsExpired())
return;
if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget()))
@@ -1065,7 +1064,7 @@ class spell_warl_seed_of_corruption : public AuraScript
Unit* target = GetTarget();
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
{
if (_affectedBySoulburn)
{
@@ -1643,7 +1642,7 @@ class spell_warl_drain_soul : public SpellScriptLoader
void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
if (Unit* caster = GetCaster())
if (GetOwner() && caster->ToPlayer() && caster->ToPlayer()->isHonorOrXPTarget(GetOwner()->ToUnit()))
caster->CastSpell(caster, SPELL_WARLOCK_SOUL_SHARD_ENERGIZE, true);
@@ -1839,7 +1838,7 @@ class spell_warl_shadowburn : public AuraScript
if (!caster || !caster->IsPlayer())
return;
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
if (GetTargetApplication()->GetRemoveMode().HasFlag(AuraRemoveFlags::ByDeath))
if (caster->ToPlayer()->isHonorOrXPTarget(GetTarget()))
caster->CastCustomSpell(SPELL_WARLOCK_SOUL_SHARD, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), caster, true, nullptr, aurEff);
}
+1 -1
View File
@@ -484,7 +484,7 @@ class spell_warr_shattering_throw : public SpellScript
// remove shields, will still display immune to damage part
if (Unit* target = GetHitUnit())
target->RemoveAurasWithMechanic(1 << MECHANIC_IMMUNE_SHIELD, AURA_REMOVE_BY_ENEMY_SPELL);
target->RemoveAurasWithMechanic(1 << MECHANIC_IMMUNE_SHIELD, AuraRemoveFlags::ByEnemySpell);
}
void Register() override