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:
Jelle Meeus
2025-07-20 08:10:47 +02:00
committed by GitHub
parent 7c4a5bc37c
commit 53e1cd553b
6 changed files with 93 additions and 19 deletions

View File

@@ -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);