mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(Scripts/Spells): Update Death Knight Ebon Gargoyle auras and damage, and Ghoul auras (#22398)
Co-authored-by: Tereneckla <Tereneckla@pm.me>
This commit is contained in:
@@ -280,17 +280,17 @@ class spell_pet_dk_gargoyle_strike : public SpellScript
|
||||
|
||||
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = 60;
|
||||
int32 damage = GetEffectValue();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetLevel() >= 60)
|
||||
damage += (caster->GetLevel() - 60) * 4;
|
||||
damage += (caster->GetLevel() - 60) * 3;
|
||||
|
||||
SetEffectValue(damage);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -776,19 +776,19 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
|
||||
void CalculateSPAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// xinef: dk gargoyle inherits 33% of SP
|
||||
if (GetUnitOwner()->GetEntry() != NPC_EBON_GARGOYLE)
|
||||
return;
|
||||
|
||||
if (Unit* owner = GetUnitOwner()->GetOwner())
|
||||
{
|
||||
int32 modifier = 33;
|
||||
// Percentage of the owner's attack power to be inherited as spell power
|
||||
// This value was chosen based on experimental damage of Gargoyle Strike
|
||||
int32 modifier = 75;
|
||||
|
||||
// xinef: impurity
|
||||
if (owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
|
||||
modifier = 40;
|
||||
if (AuraEffect* impurityEff = owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, EFFECT_0))
|
||||
AddPct(modifier, impurityEff->GetAmount());
|
||||
|
||||
amount = CalculatePct(std::max<int32>(0, owner->GetTotalAttackPowerValue(BASE_ATTACK)), modifier);
|
||||
amount = CalculatePct(std::max<int32>(0, static_cast<int32>(owner->GetTotalAttackPowerValue(BASE_ATTACK))), modifier);
|
||||
|
||||
// xinef: Update appropriate player field
|
||||
if (owner->IsPlayer())
|
||||
@@ -800,8 +800,11 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
{
|
||||
// xinef: scale haste with owners melee haste
|
||||
if (Unit* owner = GetUnitOwner()->GetOwner())
|
||||
if (owner->m_modAttackSpeedPct[BASE_ATTACK] < 1.0f) // inherit haste only
|
||||
amount = std::min<int32>(100, int32(((1.0f / owner->m_modAttackSpeedPct[BASE_ATTACK]) - 1.0f) * 100.0f));
|
||||
{
|
||||
float modSpeed = owner->m_modAttackSpeedPct[BASE_ATTACK];
|
||||
modSpeed = std::ranges::clamp(modSpeed, 1e-6f, 1.0f);
|
||||
amount = static_cast<int32>(((1.0f / modSpeed) - 1.0f) * 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -860,13 +863,13 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
|
||||
void Register() override
|
||||
{
|
||||
if (m_scriptSpellId == 54566)
|
||||
if (m_scriptSpellId == SPELL_DK_PET_SCALING_01)
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateStatAmount, EFFECT_ALL, SPELL_AURA_MOD_STAT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateSPAmount, EFFECT_ALL, SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
}
|
||||
|
||||
if (m_scriptSpellId == 51996)
|
||||
if (m_scriptSpellId == SPELL_DK_PET_SCALING_02)
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateHasteAmount, EFFECT_ALL, SPELL_AURA_MELEE_SLOW);
|
||||
|
||||
OnEffectApply += AuraEffectApplyFn(spell_dk_pet_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
|
||||
@@ -5320,6 +5320,55 @@ class spell_gen_set_health : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 67557 - Serverside - Pet Scaling - Master Spell 03 - Intellect, Spirit, Resilience
|
||||
class spell_pet_intellect_spirit_resilience_scaling : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pet_intellect_spirit_resilience_scaling)
|
||||
|
||||
void CalculateIntellectAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Player* modOwner = GetUnitOwner()->GetSpellModOwner())
|
||||
amount = static_cast<int32>(CalculatePct(std::max<float>(0, modOwner->GetStat(STAT_INTELLECT)), 30));
|
||||
}
|
||||
|
||||
void CalculateSpiritAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Player* modOwner = GetUnitOwner()->GetSpellModOwner())
|
||||
amount = static_cast<int32>(CalculatePct(std::max<float>(0, modOwner->GetStat(STAT_SPIRIT)), 30));
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->ApplySpellImmune(GetId(), IMMUNITY_STATE, aurEff->GetAuraType(), true, SPELL_BLOCK_TYPE_POSITIVE);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
if (!GetUnitOwner()->IsPet())
|
||||
return;
|
||||
|
||||
isPeriodic = true;
|
||||
amplitude = 3 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetEffect(aurEff->GetEffIndex())->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateIntellectAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateSpiritAmount, EFFECT_1,SPELL_AURA_MOD_STAT);
|
||||
// The resilience scaling is not used. The owner's resilience is used directly
|
||||
// DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateResilienceAmount, EFFECT_2, SPELL_AURA_MOD_RATING);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_pet_intellect_spirit_resilience_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::CalcPeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::HandlePeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
}
|
||||
};
|
||||
|
||||
// 67561 - Serverside - Pet Scaling - Master Spell 06 - Spell Hit, Expertise, Spell Penetration
|
||||
class spell_pet_spellhit_expertise_spellpen_scaling : public AuraScript
|
||||
{
|
||||
@@ -5605,6 +5654,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_sober_up);
|
||||
RegisterSpellScript(spell_gen_steal_weapon);
|
||||
RegisterSpellScript(spell_gen_set_health);
|
||||
RegisterSpellScript(spell_pet_intellect_spirit_resilience_scaling);
|
||||
RegisterSpellScript(spell_pet_spellhit_expertise_spellpen_scaling);
|
||||
RegisterSpellScript(spell_gen_proc_on_victim);
|
||||
RegisterSpellScriptWithArgs(spell_gen_translocate, "spell_gen_translocate_down", SPELL_TRANSLOCATION_DOWN);
|
||||
|
||||
Reference in New Issue
Block a user