fix(Core/Spells): Fix Rapid Recuperation, Rapid Killing, and auto-generate PROC_ATTR_REQ_SPELLMOD (#24830)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-23 12:37:37 -06:00
committed by GitHub
parent 57119764a7
commit 4277ac0b26
5 changed files with 183 additions and 41 deletions

View File

@@ -73,8 +73,6 @@ enum HunterSpells
// Proc system spells
SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA = 34720,
SPELL_HUNTER_REPLENISHMENT = 57669,
SPELL_HUNTER_RAPID_RECUPERATION_R1 = 56654,
SPELL_HUNTER_RAPID_RECUPERATION_R2 = 58882,
SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS = 57894,
SPELL_HUNTER_KILL_COMMAND_HUNTER = 34027,
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
@@ -1403,48 +1401,29 @@ class spell_hun_hunting_party : public AuraScript
}
};
// -53228 - Rapid Recuperation
// 56654, 58882 - Rapid Recuperation
class spell_hun_rapid_recuperation : public AuraScript
{
PrepareAuraScript(spell_hun_rapid_recuperation);
bool Validate(SpellInfo const* /*spellInfo*/) override
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ SPELL_HUNTER_RAPID_RECUPERATION_R1, SPELL_HUNTER_RAPID_RECUPERATION_R2 });
return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
}
bool CheckProc(ProcEventInfo& eventInfo)
{
SpellInfo const* procSpell = eventInfo.GetSpellInfo();
if (!procSpell)
return false;
// This effect only from Rapid Killing (mana regen)
return (procSpell->SpellFamilyFlags[1] & 0x01000000) != 0;
}
void HandleProc(ProcEventInfo& /*eventInfo*/)
void HandlePeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
uint32 triggeredSpell = 0;
switch (GetSpellInfo()->Id)
{
case 53228: // Rank 1
triggeredSpell = SPELL_HUNTER_RAPID_RECUPERATION_R1;
break;
case 53232: // Rank 2
triggeredSpell = SPELL_HUNTER_RAPID_RECUPERATION_R2;
break;
default:
return;
}
GetTarget()->CastSpell(GetTarget(), triggeredSpell, true);
Unit* target = GetTarget();
uint32 triggerSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
int32 amount = CalculatePct(static_cast<int32>(target->GetMaxPower(POWER_MANA)), aurEff->GetAmount());
target->CastCustomSpell(target, triggerSpellId, &amount, nullptr, nullptr, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_rapid_recuperation::CheckProc);
OnProc += AuraProcFn(spell_hun_rapid_recuperation::HandleProc);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hun_rapid_recuperation::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -1522,7 +1501,7 @@ class spell_hun_kill_command_pet : public AuraScript
}
};
// -53228 - Rapid Recuperation (trigger)
// -53228 - Rapid Recuperation (talent aura)
class spell_hun_rapid_recuperation_trigger : public AuraScript
{
PrepareAuraScript(spell_hun_rapid_recuperation_trigger);
@@ -1559,8 +1538,8 @@ class spell_hun_rapid_recuperation_trigger : public AuraScript
return;
uint8 rank = GetSpellInfo()->GetRank();
if (rank > 0 && rank <= 2)
GetTarget()->CastSpell(GetTarget(), triggerSpells[rank - 1], true, nullptr, aurEff);
uint32 spellId = triggerSpells[rank - 1];
eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1676,9 +1655,9 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_explosive_shot);
RegisterSpellScript(spell_hun_thrill_of_the_hunt);
RegisterSpellScript(spell_hun_hunting_party);
RegisterSpellScript(spell_hun_rapid_recuperation);
RegisterSpellScript(spell_hun_glyph_of_mend_pet);
// Proc system scripts
RegisterSpellScript(spell_hun_rapid_recuperation);
RegisterSpellScript(spell_hun_kill_command_pet);
RegisterSpellScript(spell_hun_piercing_shots);
RegisterSpellScript(spell_hun_rapid_recuperation_trigger);