refactor(Core/Combat): Port TrinityCore heap-based threat system (#24715)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
Co-authored-by: killerwife <killerwife@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
blinkysc 2026-03-18 13:36:59 -05:00 committed by GitHub
parent c80a0f1fad
commit 984baa92dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
101 changed files with 7045 additions and 2659 deletions

View file

@ -673,6 +673,20 @@ class spell_dk_dancing_rune_weapon : public AuraScript
{
PrepareAuraScript(spell_dk_dancing_rune_weapon);
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
// Redirect 100% of the DRW's threat to the DK player
uint32 npcEntry = GetSpellInfo()->Effects[EFFECT_0].MiscValue;
std::list<Creature*> runeWeapons;
caster->GetAllMinionsByEntry(runeWeapons, npcEntry);
for (Creature* temp : runeWeapons)
temp->GetThreatMgr().RegisterRedirectThreat(GetId(), caster->GetGUID(), 100);
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (!eventInfo.GetActor() || !eventInfo.GetActionTarget() || !eventInfo.GetActionTarget()->IsAlive() || !eventInfo.GetActor()->IsPlayer())
@ -749,6 +763,7 @@ class spell_dk_dancing_rune_weapon : public AuraScript
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dk_dancing_rune_weapon::HandleApply, EFFECT_2, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
DoCheckProc += AuraCheckProcFn(spell_dk_dancing_rune_weapon::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_dk_dancing_rune_weapon::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}