mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Unit: corrected calculation for SPELL_AURA_MOD_DAMAGE_TAKEN/SPELL_AURA_MOD_HEALING auras
- Spell bonus calculation and penalty was done twice, but it's simply flat +SP, which should be taken into account before other bonuses - Fixed missing code from SpellDamageBonusDone/SpellHealingBonusDone and killed multiplication by stack amount twice for default coefficient spells (already multiplied on level penalty)
This commit is contained in:
@@ -2022,13 +2022,21 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* victim = eventInfo.GetProcTarget();
|
||||
|
||||
float ap = GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK);
|
||||
int32 holy = GetTarget()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY);
|
||||
holy += eventInfo.GetProcTarget()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY);
|
||||
int32 bp = int32((ap * 0.022f + 0.044f * holy) * GetTarget()->GetAttackTime(BASE_ATTACK) / 1000);
|
||||
ap += victim->GetTotalAuraModifier(SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS);
|
||||
|
||||
int32 sph = GetTarget()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY);
|
||||
sph += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_TAKEN, SPELL_SCHOOL_MASK_HOLY);
|
||||
|
||||
float mws = GetTarget()->GetAttackTime(BASE_ATTACK);
|
||||
mws /= 1000.0f;
|
||||
|
||||
int32 bp = int32(mws * (0.022f * ap + 0.044f * sph));
|
||||
CastSpellExtraArgs args(aurEff);
|
||||
args.AddSpellBP0(bp);
|
||||
GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, args);
|
||||
GetTarget()->CastSpell(victim, SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, args);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
@@ -715,7 +715,7 @@ class spell_sha_flametongue_weapon : public SpellScriptLoader
|
||||
if (!item || !item->IsEquipped())
|
||||
return false;
|
||||
|
||||
WeaponAttackType attType = static_cast<WeaponAttackType>(player->GetAttackBySlot(item->GetSlot()));
|
||||
WeaponAttackType attType = Player::GetAttackBySlot(item->GetSlot());
|
||||
if (attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
return false;
|
||||
|
||||
@@ -738,26 +738,32 @@ class spell_sha_flametongue_weapon : public SpellScriptLoader
|
||||
|
||||
Item* item = ASSERT_NOTNULL(player->GetWeaponForAttack(attType));
|
||||
|
||||
float const basePoints = GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue();
|
||||
float basePoints = GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue();
|
||||
|
||||
// Flametongue max damage is normalized based on a 4.0 speed weapon
|
||||
// Tooltip says max damage = BasePoints / 25, so BasePoints / 25 / 4 to get base damage per 1.0s AS
|
||||
float attackSpeed = player->GetAttackTime(attType) / 1000.f;
|
||||
float fireDamage = basePoints / 100.0f;
|
||||
float const attackSpeed = player->GetAttackTime(attType) / 1000.f;
|
||||
fireDamage *= attackSpeed;
|
||||
|
||||
// clip value between (BasePoints / 77) and (BasePoints / 25) as the tooltip indicates
|
||||
RoundToInterval(fireDamage, basePoints / 77.0f, basePoints / 25.0f);
|
||||
|
||||
// Calculate Spell Power scaling
|
||||
float spellPowerBonus = player->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) + target->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE);
|
||||
float spellPowerBonus = player->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE);
|
||||
spellPowerBonus += target->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_TAKEN, SPELL_SCHOOL_MASK_FIRE);
|
||||
|
||||
// calculate penalty from passive aura as is the one with level
|
||||
float const factorMod = player->CalculateSpellpowerCoefficientLevelPenalty(GetSpellInfo());
|
||||
|
||||
float const spCoeff = 0.03811f;
|
||||
spellPowerBonus *= spCoeff * attackSpeed;
|
||||
spellPowerBonus *= spCoeff * attackSpeed * factorMod;
|
||||
|
||||
// All done, now proc damage
|
||||
CastSpellExtraArgs args(aurEff);
|
||||
args.CastItem = item;
|
||||
args.AddSpellBP0(fireDamage + spellPowerBonus);
|
||||
args
|
||||
.SetCastItem(item)
|
||||
.AddSpellBP0(fireDamage + spellPowerBonus);
|
||||
player->CastSpell(target, SPELL_SHAMAN_FLAMETONGUE_ATTACK, args);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user