To Hell and Back

This commit is contained in:
luis
2026-09-15 22:35:09 -03:00
parent 452a087df4
commit de6731c35d
+107
View File
@@ -123,6 +123,8 @@ enum WarlockSpells
SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_ANTORAN_INQUISITOR = 1276283, SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_ANTORAN_INQUISITOR = 1276283,
SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_LADY_SACROLASH = 1282501, SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_LADY_SACROLASH = 1282501,
SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_GRAND_WARLOCK_ALYTHESS = 1282502, SPELL_WARLOCK_DOMINION_OF_ARGUS_SUMMON_GRAND_WARLOCK_ALYTHESS = 1282502,
SPELL_WARLOCK_TO_HELL_AND_BACK = 1281511,
SPELL_WARLOCK_TO_HELL_AND_BACK_UNSTABLE_SOUL = 1281512,
SPELL_WARLOCK_HAND_OF_GULDAN_DAMAGE = 86040, SPELL_WARLOCK_HAND_OF_GULDAN_DAMAGE = 86040,
SPELL_WARLOCK_WILD_IMP_SUMMON = 279910, SPELL_WARLOCK_WILD_IMP_SUMMON = 279910,
SPELL_WARLOCK_UMBRAL_BRAZE = 405802, SPELL_WARLOCK_UMBRAL_BRAZE = 405802,
@@ -1851,6 +1853,101 @@ class spell_warl_hand_of_guldan_damage : public SpellScript
} }
}; };
// 1281511 - To Hell and Back
// While talented, Power Siphon and Implosion track how many Wild Imps they sacrifice on
// this aura's stack amount. Every $s2 (EFFECT_1 dummy, default 2) sacrificed Wild Imps,
// the caster summons $s1 (EFFECT_0 dummy, default 1) Wild Imp Gang Boss(es) - Wild Imps
// that instantly gain "Unstable Soul" (1281512): +$w1 damage and Fel Firebolt now jumps
// to 4 additional targets. A fresh talent application (relog / re-talent) resets the
// sacrificed counter to zero.
class spell_warl_to_hell_and_back : public AuraScript
{
public:
// Called by spell_warl_implosion and spell_warl_power_siphon for every Wild Imp they
// sacrifice. Counts on the talent aura's stack; when the threshold (`interval`, from
// EFFECT_1 dummy) is reached, summons `bossCount` Wild Imp(s) (EFFECT_0 dummy) and
// applies "Unstable Soul" (1281512) to the freshly summoned imp.
static void CountSacrifice(Unit* caster)
{
if (!caster)
return;
Aura* talent = caster->GetAura(SPELL_WARLOCK_TO_HELL_AND_BACK);
if (!talent)
return;
int32 interval = 2; // EFFECT_1 dummy default
int32 bossCount = 1; // EFFECT_0 dummy default
if (AuraEffect const* eff = talent->GetEffect(EFFECT_1))
interval = std::max<int32>(1, eff->GetAmount());
if (AuraEffect const* eff = talent->GetEffect(EFFECT_0))
bossCount = std::max<int32>(1, eff->GetAmount());
if (uint32(talent->GetStackAmount()) + 1 < uint32(interval))
{
talent->SetStackAmount(uint8(talent->GetStackAmount() + 1));
return;
}
talent->SetStackAmount(0);
SpellInfo const* summonSpellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_WILD_IMP_SUMMON, DIFFICULTY_NONE);
if (!summonSpellInfo)
return;
uint32 impEntry = uint32(summonSpellInfo->GetEffect(EFFECT_0).MiscValue);
for (int32 i = 0; i < bossCount; ++i)
{
caster->CastSpell(caster, SPELL_WARLOCK_WILD_IMP_SUMMON, CastSpellExtraArgs()
.SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR));
// The freshly summoned Wild Imp spawns right next to the caster (the imps
// that were just sacrificed were despawned moments earlier). The closest
// owned, still-alive Wild Imp that does not already carry Unstable Soul is
// therefore the Imp Gang Boss we just brought in.
std::list<Creature*> imps;
caster->GetCreatureListWithEntryInGrid(imps, impEntry, 100.0f);
Creature* bossImp = nullptr;
float bestDist = std::numeric_limits<float>::max();
for (Creature* imp : imps)
{
if (!imp || !imp->IsAlive() || imp->GetOwnerGUID() != caster->GetGUID())
continue;
if (imp->HasAura(SPELL_WARLOCK_TO_HELL_AND_BACK_UNSTABLE_SOUL))
continue;
float dist = caster->GetDistance(imp);
if (dist < bestDist)
{
bestDist = dist;
bossImp = imp;
}
}
if (bossImp)
bossImp->CastSpell(bossImp, SPELL_WARLOCK_TO_HELL_AND_BACK_UNSTABLE_SOUL, CastSpellExtraArgs()
.SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR));
}
}
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARLOCK_TO_HELL_AND_BACK, SPELL_WARLOCK_TO_HELL_AND_BACK_UNSTABLE_SOUL });
}
// A fresh application (relog / re-talent) resets the sacrificed counter to zero.
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetAura()->SetStackAmount(0);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_warl_to_hell_and_back::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
// 196277 - Implosion // 196277 - Implosion
// Pulls up to 6 Wild Imps toward the target and causes each to explode for Shadowflame AOE damage. // Pulls up to 6 Wild Imps toward the target and causes each to explode for Shadowflame AOE damage.
class spell_warl_implosion : public SpellScript class spell_warl_implosion : public SpellScript
@@ -1902,6 +1999,11 @@ class spell_warl_implosion : public SpellScript
.SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)); .SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR));
imp->DespawnOrUnsummon(); imp->DespawnOrUnsummon();
// To Hell and Back (1281511): every Wild Imp exploded here counts as a
// sacrifice toward the talent's Imp Gang Boss proc.
if (Unit* owner = imp->GetOwner())
spell_warl_to_hell_and_back::CountSacrifice(owner);
}); });
++pulled; ++pulled;
@@ -1949,6 +2051,10 @@ class spell_warl_power_siphon : public SpellScript
imp->DespawnOrUnsummon(); imp->DespawnOrUnsummon();
// To Hell and Back (1281511): every Wild Imp sacrificed by Power Siphon counts
// toward the talent's Imp Gang Boss proc.
spell_warl_to_hell_and_back::CountSacrifice(caster);
caster->CastSpell(caster, SPELL_WARLOCK_POWER_SIPHON_DEMONIC_CORE, caster->CastSpell(caster, SPELL_WARLOCK_POWER_SIPHON_DEMONIC_CORE,
CastSpellExtraArgs(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)); CastSpellExtraArgs(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR));
@@ -2518,5 +2624,6 @@ void AddSC_warlock_spell_scripts()
RegisterSpellScript(spell_warl_dominion_of_argus); RegisterSpellScript(spell_warl_dominion_of_argus);
RegisterSpellScript(spell_warl_implosion); RegisterSpellScript(spell_warl_implosion);
RegisterSpellScript(spell_warl_power_siphon); RegisterSpellScript(spell_warl_power_siphon);
RegisterSpellScript(spell_warl_to_hell_and_back);
RegisterSpellScript(spell_imp_fel_firebolt); RegisterSpellScript(spell_imp_fel_firebolt);
} }