From 9fa95b4b57c1d843392d0c321cdabbc3a21e1d69 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 26 Feb 2018 22:37:06 -0300 Subject: Core/Spells: Fix periodic rolling adding bonuses twice Calculation is now done in CalculateAmount (cherry picked from commit 93eda20d5cf6eeb34e1aee1b81469ba6e8fa7f0c) --- 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 ------ src/server/scripts/Spells/spell_warrior.cpp | 4 +--- 6 files changed, 1 insertion(+), 16 deletions(-) (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 06b197b4c7b..7016e7c4964 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1563,8 +1563,6 @@ public: 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); CastSpellExtraArgs args(aurEff); args.AddSpellMod(SPELLVALUE_BASE_POINT0, amount); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index b0dfaa38a73..0a1c5614853 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -657,7 +657,6 @@ class spell_mage_ignite : public AuraScript 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); CastSpellExtraArgs args(aurEff); args.AddSpellMod(SPELLVALUE_BASE_POINT0, amount); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index b7bf9fbbdbd..69119d9e3aa 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -1035,8 +1035,6 @@ class spell_pal_t8_2p_bonus : public SpellScriptLoader 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); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(amount); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 42546ba3cfe..6828dc65933 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -1078,10 +1078,8 @@ class spell_pri_t10_heal_2p_bonus : public SpellScriptLoader ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); - // Add remaining ticks to healing done Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PRIEST_BLESSED_HEALING, SPELL_AURA_PERIODIC_HEAL); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(amount); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index eac7c5911f6..b237bb717db 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1238,10 +1238,8 @@ class spell_sha_t8_elemental_4p_bonus : public SpellScriptLoader ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); - // Add remaining ticks to damage done Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_ELECTRIFIED, SPELL_AURA_PERIODIC_DAMAGE); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(amount); @@ -1289,10 +1287,8 @@ class spell_sha_t9_elemental_4p_bonus : public SpellScriptLoader ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); - // Add remaining ticks to damage done Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(amount); @@ -1385,10 +1381,8 @@ class spell_sha_t10_restoration_4p_bonus : public SpellScriptLoader ASSERT(spellInfo->GetMaxTicks() > 0); amount /= spellInfo->GetMaxTicks(); - // Add remaining ticks to healing done Unit* caster = eventInfo.GetActor(); Unit* target = eventInfo.GetProcTarget(); - amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_CHAINED_HEAL, SPELL_AURA_PERIODIC_HEAL); CastSpellExtraArgs args(aurEff); args.AddSpellBP0(amount); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index af1604ff994..2376a3d13fe 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -733,10 +733,8 @@ public: void HandleProc(AuraEffect* aurEff, ProcEventInfo& eventInfo) { Unit* target = eventInfo.GetActionTarget(); - //Get the Remaining Damage from the aura (if exist) - int32 remainingDamage = target->GetRemainingPeriodicAmount(target->GetGUID(), SPELL_WARRIOR_TRAUMA_EFFECT, SPELL_AURA_PERIODIC_DAMAGE); //Get 25% of damage from the spell casted (Slam & Whirlwind) plus Remaining Damage from Aura - int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()) / sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_TRAUMA_EFFECT, GetCastDifficulty())->GetMaxTicks()) + remainingDamage; + int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()) / sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_TRAUMA_EFFECT, GetCastDifficulty())->GetMaxTicks()); CastSpellExtraArgs args(TRIGGERED_FULL_MASK); args.AddSpellMod(SPELLVALUE_BASE_POINT0, damage); GetCaster()->CastSpell(target, SPELL_WARRIOR_TRAUMA_EFFECT, args); -- cgit v1.2.3