From 794a3e43887d3fea4bb9b1ec77a98ab596eea0be Mon Sep 17 00:00:00 2001 From: ariel- Date: Fri, 15 Dec 2017 03:40:36 -0300 Subject: Core/Auras: fixed off by one error in counting SPELL_ATTR5_START_PERIODIC_AT_APPLY ticks - Made SpellInfo::GetMaxTicks and AuraEffect::GetTotalTicks return the same number without mods (dumped arbitrary default return value of 6 and arbitrary 30 sec limit) - They should be streamlined whenever SPELL_AURA_48 is implemented (cherry picked from commit 7dff0e3246f68c39e122e6ccb93b18c29f6df130) --- src/server/scripts/Spells/spell_druid.cpp | 2 ++ src/server/scripts/Spells/spell_mage.cpp | 1 + src/server/scripts/Spells/spell_paladin.cpp | 2 ++ src/server/scripts/Spells/spell_priest.cpp | 2 ++ src/server/scripts/Spells/spell_shaman.cpp | 6 ++++++ 5 files changed, 13 insertions(+) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 5719b684ccd..c46909bdf13 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1383,6 +1383,8 @@ public: SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_DRUID_LANGUISH, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to damage done amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_DRUID_LANGUISH, SPELL_AURA_PERIODIC_DAMAGE); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 8dc3e31f781..c30f9b22643 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -452,6 +452,7 @@ class spell_mage_ignite : public AuraScript SpellInfo const* igniteDot = sSpellMgr->AssertSpellInfo(SPELL_MAGE_IGNITE, GetCastDifficulty()); int32 pct = aurEff->GetAmount(); + ASSERT(igniteDot->GetMaxTicks() > 0); int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); amount += eventInfo.GetProcTarget()->GetRemainingPeriodicAmount(eventInfo.GetActor()->GetGUID(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE); GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 4cf7d5e5a2c..2b4b568fa57 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1028,6 +1028,8 @@ class spell_pal_t8_2p_bonus : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_HOLY_MENDING, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(healInfo->GetHeal()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to damage done amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PALADIN_HOLY_MENDING, SPELL_AURA_PERIODIC_HEAL); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index d041d45032a..c4c63b35ee3 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -878,6 +878,8 @@ class spell_pri_t10_heal_2p_bonus : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_BLESSED_HEALING, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(healInfo->GetHeal()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to healing done diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 48fda95f406..e2052359cc0 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1081,6 +1081,8 @@ class spell_sha_t8_elemental_4p_bonus : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_ELECTRIFIED, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to damage done @@ -1128,6 +1130,8 @@ class spell_sha_t9_elemental_4p_bonus : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(damageInfo->GetDamage()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to damage done @@ -1220,6 +1224,8 @@ class spell_sha_t10_restoration_4p_bonus : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_SHAMAN_CHAINED_HEAL, GetCastDifficulty()); int32 amount = CalculatePct(static_cast(healInfo->GetHeal()), aurEff->GetAmount()); + + ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); // Add remaining ticks to healing done -- cgit v1.2.3