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

+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);
}