diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-01-17 13:01:18 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2018-01-17 13:01:18 -0300 |
commit | ab3307fc2373ace51bea93682bc66bc709ca019c (patch) | |
tree | 2103c4f17a7a0dd64a0a1e567bc17c5db3d78fea | |
parent | b64c5043140dc7b7908e259e441de16cc0261320 (diff) |
Core/Scripts: fix some spells double dipping from done/taken bonuses
Closes #21007
-rw-r--r-- | sql/updates/world/3.3.5/2018_01_17_00_world_335.sql | 5 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_druid.cpp | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 8 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 38 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 28 |
6 files changed, 33 insertions, 51 deletions
diff --git a/sql/updates/world/3.3.5/2018_01_17_00_world_335.sql b/sql/updates/world/3.3.5/2018_01_17_00_world_335.sql new file mode 100644 index 00000000000..296ab2072ae --- /dev/null +++ b/sql/updates/world/3.3.5/2018_01_17_00_world_335.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_bonus_data` WHERE `entry` IN (379, 974, 52042); +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(379, 0.4762, -1, -1, -1, 'Shaman - Earth Shield heal'), +(974, 0, 0, 0, 0, 'Shaman - Earth Shield'), +(52042, -1, 0, 0, 0, 'Shaman - Healing Stream Totem'); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index c9bb513eb5a..859f097d638 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1013,9 +1013,6 @@ class spell_dru_lifebloom : public SpellScriptLoader int32 healAmount = aurEff->GetAmount(); if (Unit* caster = GetCaster()) { - healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, { }, stack); - healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack); - // restore mana CastSpellExtraArgs args(aurEff); args.OriginalCaster = GetCasterGUID(); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index f8791201a82..91647a422a9 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -253,12 +253,8 @@ class spell_hun_chimera_shot : public SpellScriptLoader { spellId = SPELL_HUNTER_CHIMERA_SHOT_SERPENT; - // first, calculate damage of basic tick (C&P from AuraEffect::HandlePeriodicDamageAurasTick) - basePoint = aurEff->GetAmount(); - basePoint = unitTarget->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); - - // then, multiply to get damage potential - basePoint *= aurEff->GetTotalTicks(); + // calculate damage of basic tick (bonuses are already factored in AuraEffect) + basePoint = aurEff->GetAmount() * aurEff->GetTotalTicks(); ApplyPct(basePoint, 40); } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index fdfa7292c25..0d30d4fa177 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -1113,8 +1113,6 @@ class spell_pri_renew : public SpellScriptLoader if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1)) { int32 heal = aurEff->GetAmount(); - heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT); - heal *= GetSpellInfo()->GetMaxTicks(); CastSpellExtraArgs args(aurEff); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index df260380b97..93892d34401 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -432,13 +432,6 @@ class spell_sha_earth_shield : public SpellScriptLoader return ValidateSpellInfo({ SPELL_SHAMAN_EARTH_SHIELD_HEAL }); } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) - { - if (Unit* caster = GetCaster()) - amount = caster->SpellHealingBonusDone(GetUnitOwner(), GetSpellInfo(), amount, HEAL, { }); - // SpellHealingBonusTaken will be called on Heal - } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); @@ -451,7 +444,6 @@ class spell_sha_earth_shield : public SpellScriptLoader void Register() override { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; @@ -991,28 +983,22 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader SpellInfo const* triggeringSpell = GetTriggeringSpell(); if (Unit* target = GetHitUnit()) { - if (Unit* caster = GetCaster()) - { + Unit* caster = GetCaster(); + if (caster->GetTypeId() == TYPEID_UNIT && caster->IsTotem()) if (Unit* owner = caster->GetOwner()) - { - if (triggeringSpell) - damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL, { })); - - // Restorative Totems - if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, 1)) - AddPct(damage, dummy->GetAmount()); + caster = owner; - // Glyph of Healing Stream Totem - if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) - AddPct(damage, aurEff->GetAmount()); + // Restorative Totems + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, EFFECT_1)) + AddPct(damage, aurEff->GetAmount()); - damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL)); - } + // Glyph of Healing Stream Totem + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) + AddPct(damage, aurEff->GetAmount()); - CastSpellExtraArgs args(GetOriginalCaster()->GetGUID()); - args.AddSpellBP0(damage); - caster->CastSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, args); - } + CastSpellExtraArgs args(GetOriginalCaster()->GetGUID()); + args.AddSpellBP0(damage); + caster->CastSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, args); } } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index ac3ddb25e6f..fd657f0ae94 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -99,27 +99,21 @@ class spell_warr_bloodthirst : public SpellScriptLoader void HandleDamage(SpellEffIndex /*effIndex*/) { - int32 damage = GetEffectValue(); - ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK)); + uint32 APbonus = GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK); + if (Unit* victim = GetHitUnit()) + APbonus += victim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS); - if (Unit* target = GetHitUnit()) - { - damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE, { }); - damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE); - } - SetHitDamage(damage); + SetEffectValue(CalculatePct(APbonus, GetEffectValue())); } void HandleDummy(SpellEffIndex /*effIndex*/) { - CastSpellExtraArgs args(TRIGGERED_FULL_MASK); - args.AddSpellBP0(GetEffectValue()); - GetCaster()->CastSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, args); + GetCaster()->CastSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, true); } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + OnEffectLaunchTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); } }; @@ -140,10 +134,16 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader { PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WARRIOR_BLOODTHIRST_DAMAGE }); + } + void HandleHeal(SpellEffIndex /*effIndex*/) { - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE)) - SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()))); + SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE); + int32 const healPct = spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()); + SetHitHeal(GetCaster()->CountPctFromMaxHealth(healPct)); } void Register() override |