mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: fix some spells double dipping from done/taken bonuses
Closes #21007
This commit is contained in:
5
sql/updates/world/3.3.5/2018_01_17_00_world_335.sql
Normal file
5
sql/updates/world/3.3.5/2018_01_17_00_world_335.sql
Normal file
@@ -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');
|
||||
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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, { }));
|
||||
caster = owner;
|
||||
|
||||
// Restorative Totems
|
||||
if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_RESTORATIVE_TOTEMS, 1))
|
||||
AddPct(damage, dummy->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());
|
||||
|
||||
// Glyph of Healing Stream Totem
|
||||
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
|
||||
AddPct(damage, aurEff->GetAmount());
|
||||
// Glyph of Healing Stream Totem
|
||||
if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
|
||||
AddPct(damage, aurEff->GetAmount());
|
||||
|
||||
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user