diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-12-14 11:42:42 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-12-15 00:25:58 -0300 |
| commit | 5d91beb1dbc795382a12ec05f6e72c76b195b141 (patch) | |
| tree | 330ab1854570da61eecb4e8b03567d1516ba47a5 /src/server/scripts | |
| parent | c8633a792b9a728246862b91b93f6463c58c7abd (diff) | |
Core/Auras: periodics refactor part 1:
- Don't skip ticks if diff is greater than amplitude
- Fixed spells without ampltude in DBC
Diffstat (limited to 'src/server/scripts')
6 files changed, 19 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 00b9392eab8..9f38ef11339 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 863637ca90b..d76f9ec6990 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -197,6 +197,8 @@ class spell_grobbulus_poison_cloud : public SpellScriptLoader void PeriodicTick(AuraEffect const* aurEff) { PreventDefaultAction(); + if (!aurEff->GetTotalTicks()) + return; uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].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 8b618c8b271..a18572992e9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -995,7 +995,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 8b6785b60a8..e35db1add89 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -177,6 +177,8 @@ class spell_broggok_poison_cloud : public SpellScriptLoader void PeriodicTick(AuraEffect const* aurEff) { PreventDefaultAction(); + if (!aurEff->GetTotalTicks()) + return; uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].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 0a4b7ae303e..1fda9d3ebf2 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -825,6 +825,12 @@ class spell_dru_innervate : public SpellScriptLoader 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 @@ -855,6 +861,9 @@ class spell_dru_insect_swarm : public SpellScriptLoader void CalculateAmount(AuraEffect const* aurEff, int32 & amount, bool & /*canBeRecalculated*/) { + if (!aurEff->GetTotalTicks()) + return; + if (Unit* caster = GetCaster()) if (AuraEffect const* relicAurEff = caster->GetAuraEffect(SPELL_DRUID_ITEM_T8_BALANCE_RELIC, EFFECT_0)) amount += relicAurEff->GetAmount() / aurEff->GetTotalTicks(); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 1b06b8c3a4a..4a95c19c628 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1339,7 +1339,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; @@ -1410,6 +1410,9 @@ class spell_gen_lifeblood : public AuraScript void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { + if (!aurEff->GetTotalTicks()) + return; + if (Unit* owner = GetUnitOwner()) amount += int32(CalculatePct(owner->GetMaxHealth(), 1.5f / aurEff->GetTotalTicks())); } |
