diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-12-14 11:42:42 -0300 |
|---|---|---|
| committer | funjoker <funjoker109@gmail.com> | 2021-03-15 20:17:31 +0100 |
| commit | 5f9e0d92d563c983c229db1569414916b3dce51e (patch) | |
| tree | 79c906bdf9d526646c26f827db677a566460bf43 /src/server/scripts | |
| parent | fe362cf2c9d5c71db4698480ce26cb35dbc58f28 (diff) | |
Core/Auras: periodics refactor part 1:
- Don't skip ticks if diff is greater than amplitude
- Fixed spells without ampltude in DBC
(cherry picked from commit 5d91beb1dbc795382a12ec05f6e72c76b195b141)
Diffstat (limited to 'src/server/scripts')
6 files changed, 13 insertions, 3 deletions
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index 8528aba9fb7..511c0e17893 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -149,7 +149,7 @@ class spell_marwyn_shared_suffering : public SpellScriptLoader if (Unit* caster = GetCaster()) { - int32 remainingDamage = aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); + int32 remainingDamage = aurEff->GetAmount() * aurEff->GetRemainingTicks(); if (remainingDamage > 0) caster->CastCustomSpell(SPELL_SHARED_SUFFERING_DISPEL, SPELLVALUE_BASE_POINT1, remainingDamage, GetTarget(), TRIGGERED_FULL_MASK); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index cb7beeafb42..73dcd478546 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -200,6 +200,8 @@ class spell_grobbulus_poison_cloud : public SpellScriptLoader void PeriodicTick(AuraEffect const* aurEff) { PreventDefaultAction(); + if (!aurEff->GetTotalTicks()) + return; uint32 triggerSpell = aurEff->GetSpellEffectInfo()->TriggerSpell; int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index df299a03c50..41c5b3c68d6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -976,7 +976,7 @@ struct npc_thorim_trashAI : public ScriptedAI uint32 heal = 0; Unit::AuraEffectList const& auras = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); for (AuraEffect const* aurEff : auras) - heal += aurEff->GetAmount() * (aurEff->GetTotalTicks() - aurEff->GetTickNumber()); + heal += aurEff->GetAmount() * aurEff->GetRemainingTicks(); return heal; } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index a1737fc4e11..f8ae540f12e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -178,6 +178,8 @@ class spell_broggok_poison_cloud : public SpellScriptLoader void PeriodicTick(AuraEffect const* aurEff) { PreventDefaultAction(); + if (!aurEff->GetTotalTicks()) + return; uint32 triggerSpell = aurEff->GetSpellEffectInfo()->TriggerSpell; int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 80cee09da89..5719b684ccd 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -555,6 +555,12 @@ public: void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { + if (!aurEff->GetTotalTicks()) + { + amount = 0; + return; + } + if (Unit* caster = GetCaster()) amount = int32(CalculatePct(caster->GetCreatePowers(POWER_MANA), amount) / aurEff->GetTotalTicks()); else diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 0d39c1181ad..496c7da3676 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1319,7 +1319,7 @@ class spell_gen_gift_of_naaru : public AuraScript void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { - if (!GetCaster()) + if (!GetCaster() || !aurEff->GetTotalTicks()) return; float heal = 0.0f; |
