Core/Auras: removed caster dependency from core

- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling
This commit is contained in:
ariel- authored and Ovahlord committed 2022-09-12 09:15:04 +02:00
1 parent d448ea4370
commit 1d3fbff332
56 files changed
+531 -437

No files matched your search

@@ -1265,6 +1265,8 @@ class spell_dru_rejuvenation : public AuraScript
{
if (AuraEffect* naturesBountyAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_DRUID, SPELL_ICON_ID_NATURES_BOUNTY, EFFECT_0))
{
/*
* @todo: rework
// a bit cheaty here but as long as we don't have a unit internal aura count...
naturesBountyAurEff->SetBonusAmount(naturesBountyAurEff->GetBonusAmount() + 1);
if (naturesBountyAurEff->GetBonusAmount() >= 3)
@@ -1272,6 +1274,7 @@ class spell_dru_rejuvenation : public AuraScript
int32 bp0 = -naturesBountyAurEff->GetSpellInfo()->Effects[EFFECT_1].BasePoints;
caster->CastSpell(caster, SPELL_DRUID_NATURES_BOUNTY, CastSpellExtraArgs(true).AddSpellBP0(bp0));
}
*/
}
}
}
@@ -1294,9 +1297,12 @@ class spell_dru_rejuvenation : public AuraScript
{
if (AuraEffect* naturesBountyAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_DRUID, SPELL_ICON_ID_NATURES_BOUNTY, EFFECT_0))
{
/*
* @todo: rework
naturesBountyAurEff->SetBonusAmount(naturesBountyAurEff->GetBonusAmount() > 0 ? naturesBountyAurEff->GetBonusAmount() - 1 : 0);
if (naturesBountyAurEff->GetBonusAmount() < 3 && caster->HasAura(SPELL_DRUID_NATURES_BOUNTY))
caster->RemoveAurasDueToSpell(SPELL_DRUID_NATURES_BOUNTY);
*/
}
}
}