fix spell part 1

This commit is contained in:
luis
2026-08-24 18:56:43 -03:00
parent c92cdbcb77
commit bb03b85ca7
12 changed files with 147 additions and 358 deletions
@@ -369,22 +369,9 @@ class spell_swirling_flame : public SpellScript
}
};
// 404897
class spell_swirling_flame_at : public SpellScript
{
void HandleEffect(SpellEffIndex /*effIndex*/)
{
Unit* target = GetHitUnit();
if (Unit* caster = GetCaster())
if (target && target->IsPlayer())
caster->CastSpell(target->GetPosition(), SPELL_SWIRLING_FLAME_AT);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_swirling_flame_at::HandleEffect, EFFECT_1, SPELL_EFFECT_APPLY_AURA);
}
};
// 404897 - Swirling Flame
// Area trigger creation is handled by core via EFFECT_0 SPELL_EFFECT_CREATE_AREATRIGGER
// No spell script needed
//403101
class spell_molten_eruption : public SpellScript
@@ -989,7 +976,7 @@ struct boss_shadowflame_amalgamation : public BossAI
}
};
// 405641
// 405642 - Blistering Twilight
class spell_blistering_twilight : public SpellScriptLoader
{
public:
@@ -999,38 +986,21 @@ public:
{
PrepareSpellScript(spell_blistering_twilight_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(
{
SPELL_BLISTERING_TWILIGHT,
SPELL_BLISTERING_TWILIGHT_DAMAGE,
SPELL_BLISTERING_TWILIGHT_AURA
});
}
void FilterTargets(std::list<WorldObject*>& targets)
{
// Randomly select up to 3 targets
Trinity::Containers::RandomResize(targets, 3);
}
void HandleHit(SpellEffIndex /*effIndex*/)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
if (Unit* target = GetHitUnit())
{
// Apply the aura spell on the target
caster->CastSpell(target, SPELL_BLISTERING_TWILIGHT_AURA, true);
// Additional logic for EFFECT_1 dummy if needed
// The aura application is handled by core via EFFECT_0
}
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_blistering_twilight_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_blistering_twilight_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_blistering_twilight_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
@@ -1074,7 +1044,7 @@ public:
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_blistering_twilight_aura_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_blistering_twilight_aura_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1303,7 +1273,7 @@ void AddSC_boss_the_amalgamation_chamber()
RegisterSpellScript(spell_flery_meteor);
RegisterSpellScript(spell_flery_meteor_damage);
RegisterSpellScript(spell_swirling_flame);
RegisterSpellScript(spell_swirling_flame_at);
// RegisterSpellScript(spell_swirling_flame_at); // Not needed, area trigger handled by core
RegisterSpellScript(spell_molten_eruption);
RegisterSpellScript(spell_molten_eruption_at);
RegisterAberrusTheShadowedCrucibleCreatureAI(boss_essence_of_shadow);
@@ -480,33 +480,18 @@ public:
class spell_rending_charge_SpellScript : public SpellScript
{
uint8 targetsCount = 1;
void FilterTargets(std::list<WorldObject*>& targets)
{
if(targets.size())
targetsCount = targets.size();
}
void HandleHit(SpellEffIndex /*effIndex*/)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
if (Unit* target = GetHitUnit())
{
caster->CastSpell(target, SPELL_RENDING_CHARGE_JUMP_CHARGE, true);
caster->CastSpell(nullptr, SPELL_RENDING_CHARGE_KNOCKBACK, true);
caster->CastSpell(nullptr, SPELL_RENDING_CHARGE_DAMAGE, true);
caster->CastSpell(target, SPELL_RENDING_CHARGE_AURA, true);
}
// The area trigger is handled by the aura on EFFECT_1
// We can add additional logic here if needed
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rending_charge_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_rending_charge_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_rending_charge_SpellScript::HandleHit, EFFECT_1, SPELL_EFFECT_CREATE_AREATRIGGER);
OnEffectHit += SpellEffectFn(spell_rending_charge_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
+3 -3
View File
@@ -323,14 +323,14 @@ class spell_gen_killcredit_prevent_player_hit : public SpellScript
{
// Prevent any effect from hitting players
if (GetHitUnit() && GetHitUnit()->GetTypeId() == TYPEID_PLAYER)
PreventHitEffect(EFFECT_0);
PreventHitEffect(EFFECT_1);
}
void Register() override
{
OnCast += SpellCastFn(spell_gen_killcredit_prevent_player_hit::HandleOnCast);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_killcredit_prevent_player_hit::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_gen_killcredit_prevent_player_hit::PreventPlayerHit, EFFECT_ALL, SPELL_EFFECT_ANY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_killcredit_prevent_player_hit::FilterTargets, EFFECT_1, TARGET_UNIT_CONE_CASTER_TO_DEST_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_gen_killcredit_prevent_player_hit::PreventPlayerHit, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
+3 -25
View File
@@ -723,29 +723,8 @@ class spell_dh_cull : public SpellScript
};
// 389718 - Cycle of Binding
class spell_dh_cycle_of_binding : public AuraScript
{
static constexpr std::array<uint32, 5> SigilSpellsIds = { SPELL_DH_SIGIL_OF_CHAINS, SPELL_DH_SIGIL_OF_FLAME, SPELL_DH_SIGIL_OF_MISERY, SPELL_DH_SIGIL_OF_SILENCE, SPELL_DH_SIGIL_OF_SPITE };
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo(SigilSpellsIds);
}
void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
{
SpellHistory* history = GetTarget()->GetSpellHistory();
SpellHistory::Duration amount = duration_cast<SpellHistory::Duration>(FloatSeconds(-aurEff->GetAmount()));
for (uint32 spellId : SigilSpellsIds)
history->ModifyCooldown(spellId, amount);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_dh_cycle_of_binding::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// The cooldown reduction is handled by core via SPELL_AURA_CHARGE_RECOVERY_MULTIPLIER
// No custom script needed
// Called by 198013 - Eye Beam
class spell_dh_cycle_of_hatred : public SpellScript
@@ -3184,7 +3163,7 @@ class spell_dh_collapsing_star_damage : public SpellScript
if (_apocalypsePct)
AddPct(damage, _apocalypsePct);
// Soft: Midnight E2 $s3 as crit-damage pct on crit (×crit-chance product not wired).
// Soft: Midnight E2 $s3 as crit-damage pct on crit (×crit-chance product not wired).
if (AuraEffect const* mid = GetCaster()->GetAuraEffect(SPELL_DH_MIDNIGHT_APEX_R1, EFFECT_2))
if (IsHitCrit())
AddPct(damage, mid->GetAmountAsInt());
@@ -3230,7 +3209,6 @@ void AddSC_demon_hunter_spell_scripts()
RegisterSpellScript(spell_dh_consume_soul_vengeance_lesser);
RegisterSpellScript(spell_dh_critical_chaos);
RegisterSpellScript(spell_dh_cull);
RegisterSpellScript(spell_dh_cycle_of_binding);
RegisterSpellScript(spell_dh_cycle_of_hatred);
RegisterSpellScript(spell_dh_cycle_of_hatred_remove_stacks);
RegisterSpellScript(spell_dh_cycle_of_hatred_talent);
-37
View File
@@ -43,7 +43,6 @@ enum DruidSpells
SPELL_DRUID_ABUNDANCE_EFFECT = 207640,
SPELL_DRUID_ASTRAL_COMMUNION_ENERGIZE = 450599,
SPELL_DRUID_ASTRAL_COMMUNION_TALENT = 450598,
SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE = 394061,
SPELL_DRUID_BALANCE_T10_BONUS = 70718,
SPELL_DRUID_BALANCE_T10_BONUS_PROC = 70721,
SPELL_DRUID_BARKSKIN = 22812,
@@ -246,41 +245,6 @@ class spell_dru_astral_communion_celestial_alignment : public SpellScript
}
};
// 394058 - Astral Smolder
class spell_dru_astral_smolder : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellEffect({ { SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, EFFECT_0 } })
&& sSpellMgr->AssertSpellInfo(SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, DIFFICULTY_NONE)->GetEffect(EFFECT_0).GetPeriodicTickCount() > 0;
}
bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) const
{
return eventInfo.GetActionTarget() != nullptr;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
{
PreventDefaultAction();
SpellEffectInfo const& astralSmolderDmg = sSpellMgr->AssertSpellInfo(SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, GetCastDifficulty())->GetEffect(EFFECT_0);
SpellEffectValue pct = aurEff->GetAmount();
SpellEffectValue amount = CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / astralSmolderDmg.GetPeriodicTickCount();
CastSpellExtraArgs args(aurEff);
args.AddSpellMod(SPELLVALUE_BASE_POINT0, amount);
GetTarget()->CastSpell(eventInfo.GetActionTarget(), SPELL_DRUID_ASTRAL_SMOLDER_DAMAGE, args);
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_astral_smolder::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_dru_astral_smolder::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
class spell_dru_base_transformer : public SpellScript
{
protected:
@@ -2998,7 +2962,6 @@ void AddSC_druid_spell_scripts()
{
RegisterSpellScript(spell_dru_abundance);
RegisterSpellScript(spell_dru_astral_communion_celestial_alignment);
RegisterSpellScript(spell_dru_astral_smolder);
RegisterSpellScript(spell_dru_barkskin);
RegisterSpellScript(spell_dru_berserk);
RegisterSpellScript(spell_dru_brambles);
+1 -1
View File
@@ -678,7 +678,7 @@ class spell_mage_ethereal_blink : public AuraScript
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_mage_ethereal_blink::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc += AuraEffectProcFn(spell_mage_ethereal_blink::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
+2 -2
View File
@@ -1794,8 +1794,8 @@ class spell_pal_t30_2p_protection_bonus_heal : public AuraScript
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_t30_2p_protection_bonus_heal::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_pal_t30_2p_protection_bonus_heal::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pal_t30_2p_protection_bonus_heal::CheckProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc += AuraEffectProcFn(spell_pal_t30_2p_protection_bonus_heal::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
+4 -44
View File
@@ -4759,49 +4759,10 @@ private:
std::queue<ObjectGuid> _healQueue;
};
// 390693 - Train of Thought
// Called by Flash Heal, Renew, Smite
class spell_pri_train_of_thought : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo
({
SPELL_PRIEST_POWER_WORD_SHIELD,
SPELL_PRIEST_PENANCE
});
}
static bool CheckEffect0(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
{
// Renew & Flash Heal
return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_PRIEST, { 0x840 });
}
static bool CheckEffect1(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo)
{
// Smite
return eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_PRIEST, { 0x80 });
}
void ReducePowerWordShieldCooldown(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
{
GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_PRIEST_POWER_WORD_SHIELD, Milliseconds(aurEff->GetAmountAsInt()));
}
void ReducePenanceCooldown(AuraEffect const* aurEff, ProcEventInfo const& /*eventInfo*/) const
{
GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_PRIEST_PENANCE, Milliseconds(aurEff->GetAmountAsInt()));
}
void Register() override
{
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pri_train_of_thought::CheckEffect0, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_pri_train_of_thought::ReducePowerWordShieldCooldown, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_pri_train_of_thought::CheckEffect1, EFFECT_1, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_pri_train_of_thought::ReducePenanceCooldown, EFFECT_1, SPELL_AURA_DUMMY);
}
};
// 390693 - Inner Focus (was Train of Thought in previous expansion)
// The spell now just increases critical strike chance via SPELL_AURA_ADD_FLAT_MODIFIER
// This is handled automatically by the core, no script needed
// The old Train of Thought cooldown reduction functionality no longer exists
// 373446 - Translucent Image
// Triggered by 586 - Fade
@@ -5703,7 +5664,6 @@ void AddSC_priest_spell_scripts()
RegisterSpellScript(spell_pri_shadowy_apparition_dummy);
RegisterSpellScript(spell_pri_surge_of_light);
RegisterSpellScript(spell_pri_trail_of_light);
RegisterSpellScript(spell_pri_train_of_thought);
RegisterSpellScript(spell_pri_t3_4p_bonus);
RegisterSpellScript(spell_pri_t5_heal_2p_bonus);
RegisterSpellScript(spell_pri_t10_heal_2p_bonus);
+21 -3
View File
@@ -408,17 +408,35 @@ class spell_sha_ashen_catalyst : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SHAMAN_LAVA_LASH });
return ValidateSpellInfo({ SPELL_SHAMAN_LAVA_LASH, SPELL_SHAMAN_FLAME_SHOCK });
}
bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
{
// Only proc when Lava Lash hits a target with Flame Shock
if (!procInfo.GetProcSpell())
return false;
SpellInfo const* spellInfo = procInfo.GetProcSpell()->GetSpellInfo();
if (!spellInfo || spellInfo->Id != SPELL_SHAMAN_LAVA_LASH)
return false;
Unit* target = procInfo.GetActionTarget();
if (!target)
return false;
return target->HasAura(SPELL_SHAMAN_FLAME_SHOCK);
}
void ReduceLavaLashCooldown(AuraEffect const* aurEff, ProcEventInfo const& /*procInfo*/) const
{
GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_SHAMAN_LAVA_LASH, -aurEff->GetAmountAsInt() * 100ms);
GetTarget()->GetSpellHistory()->ModifyCooldown(SPELL_SHAMAN_LAVA_LASH, -aurEff->GetAmountAsInt() * 1ms);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_sha_ashen_catalyst::ReduceLavaLashCooldown, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_sha_ashen_catalyst::CheckProc, EFFECT_0, SPELL_AURA_DUMMY);
OnEffectProc += AuraEffectProcFn(spell_sha_ashen_catalyst::ReduceLavaLashCooldown, EFFECT_0, SPELL_AURA_DUMMY);
}
};
+18 -91
View File
@@ -598,41 +598,33 @@ class spell_warr_honed_reflexes : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
SPELL_WARRIOR_DIE_BY_THE_SWORD,
SPELL_WARRIOR_ENRAGED_REGENERATION,
SPELL_WARRIOR_SHIELD_WALL,
SPELL_WARRIOR_INTERVENE,
SPELL_WARRIOR_SPELL_REFLECTION,
SPELL_WARRIOR_STORM_BOLT,
SPELL_WARRIOR_PUMMEL
});
return ValidateSpellInfo({ 1271964 }); // Honed Reflexes (damage increase)
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo const& /*procInfo*/) const
bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo& procInfo)
{
int32 cooldownReduction = aurEff->GetAmount();
if (!cooldownReduction)
return;
// Only proc on successful interrupts
if (!procInfo.GetProcSpell())
return false;
Unit* target = GetTarget();
static constexpr std::array affectedSpells = {
SPELL_WARRIOR_DIE_BY_THE_SWORD,
SPELL_WARRIOR_ENRAGED_REGENERATION,
SPELL_WARRIOR_SHIELD_WALL,
SPELL_WARRIOR_INTERVENE,
SPELL_WARRIOR_SPELL_REFLECTION,
SPELL_WARRIOR_STORM_BOLT,
SPELL_WARRIOR_PUMMEL
};
SpellInfo const* spellInfo = procInfo.GetProcSpell()->GetSpellInfo();
if (!spellInfo)
return false;
for (int32 spellId : affectedSpells)
target->GetSpellHistory()->ModifyCooldown(spellId, Milliseconds(-cooldownReduction));
return spellInfo->HasEffect(SPELL_EFFECT_INTERRUPT_CAST);
}
void HandleProc(AuraEffect* aurEff, ProcEventInfo& procInfo)
{
PreventDefaultAction();
GetTarget()->CastSpell(procInfo.GetActionTarget(), 1271964, CastSpellExtraArgs(aurEff)
.SetTriggeringSpell(procInfo.GetProcSpell()));
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_warr_honed_reflexes::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
DoCheckEffectProc += AuraCheckEffectProcFn(spell_warr_honed_reflexes::CheckProc, EFFECT_4, SPELL_AURA_PROC_TRIGGER_SPELL);
OnEffectProc += AuraEffectProcFn(spell_warr_honed_reflexes::HandleProc, EFFECT_4, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
@@ -1451,70 +1443,6 @@ class spell_warr_improved_whirlwind : public SpellScript
}
};
/**
* 85739 - Whirlwind Cleave aura, attached to the following spells:
*
* 1464 - Slam
* 1715 - Hamstring
* 23881 - Bloodthirst
* 23922 - Shield Slam
* 34428 - Victory Rush
* 85384 - Raging Blow
* 96103 - Raging Blow
* 100130 - Furious Slash
* 163558 - Execute Off-Hand
* 184707 - Rampage
* 184709 - Rampage
* 201363 - Rampage
* 201364 - Rampage
* 202168 - Impending Victory
* 218617 - Rampage
* 260798 - Execute
* 280772 - Siegebreaker
* 280849 - Execute
* 317483 - Condemn (Venthyr)
* 317488 - Condemn (Venthyr)
* 317489 - Condemn Off-Hand (Venthyr)
* 335096 - Bloodbath
* 335098 - Crushing Blow
* 335100 - Crushing Blow
* 394062 - Rend
* 394063 - Rend
* 396718 - Onslaught
* 463815 - Arms Execute FX Test
* 463816 - Fury Execute FX Test
* 463817 - Fury Execute Off-Hand FX Test
* 1269383 - Heroic Strike
*/
class spell_warr_improved_whirlwind_cleave : public SpellScript
{
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellEffect({ { SPELL_WARRIOR_WHIRLWIND_CLEAVE_AURA, EFFECT_1 } })
&& spellInfo->IsAffected(SPELLFAMILY_WARRIOR, sSpellMgr->AssertSpellInfo(SPELL_WARRIOR_WHIRLWIND_CLEAVE_AURA, DIFFICULTY_NONE)->GetEffect(EFFECT_0).SpellClassMask);
}
bool Load() override
{
return GetCaster()->HasAura(SPELL_WARRIOR_WHIRLWIND_CLEAVE_AURA);
}
void CalculateDamage(SpellEffectInfo const& spellEffectInfo, Unit const* victim, int32& /*damage*/, int32& /*flatMod*/, float& pctMod) const
{
int32 const targetIndex = GetUnitTargetIndexForEffect(victim->GetGUID(), spellEffectInfo.EffectIndex);
if (targetIndex == 0)
return; // nothing to do, it's the first target
if (AuraEffect const* damageEffect = GetCaster()->GetAuraEffect(SPELL_WARRIOR_WHIRLWIND_CLEAVE_AURA, EFFECT_1))
ApplyPct(pctMod, damageEffect->GetAmount());
}
void Register() override
{
CalcDamage += SpellCalcDamageFn(spell_warr_improved_whirlwind_cleave::CalculateDamage);
}
};
// 3411 - Intervene
class spell_warr_intervene : public SpellScript
{
@@ -3396,7 +3324,6 @@ void AddSC_warrior_spell_scripts()
RegisterSpellScript(spell_warr_heroic_leap_damage);
RegisterSpellScript(spell_warr_impending_victory);
RegisterSpellScript(spell_warr_improved_whirlwind);
RegisterSpellScript(spell_warr_improved_whirlwind_cleave);
RegisterSpellScript(spell_warr_intervene);
RegisterSpellScript(spell_warr_intervene_charge);
RegisterSpellScript(spell_warr_intimidating_shout);
@@ -274,43 +274,22 @@ class spell_kyrioss_chain_lightning : public SpellScript
return ValidateSpellInfo({ SPELL_CHAIN_LIGHTNING });
}
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.empty())
return;
uint32 maxTargets = 3;
if (targets.size() > maxTargets)
Trinity::Containers::RandomResize(targets, maxTargets);
_currentTarget = 0;
}
void HandleDamage(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
if (!caster || !target)
if (!caster)
return;
// Calculate damage reduction for each jump
// The damage is reduced by 30% for each jump (common for chain lightning spells)
uint32 damage = GetHitDamage();
uint8 rank = GetEffectInfo(EFFECT_1).CalcValue(); // Get max number of targets from effect 1
uint8 jumps = 0;
// Count how many times the spell has jumped already
if (Aura* aura = target->GetAura(424148, caster->GetGUID()))
if (AuraEffect* eff = aura->GetEffect(EFFECT_0))
jumps = eff->GetAmount();
// Apply damage reduction based on jump count
if (jumps > 0 && jumps < rank)
// Scale damage based on instance difficulty
if (Map* map = caster->GetMap())
{
float reduction = 0.7f; // 30% reduction per jump
for (uint8 i = 0; i < jumps; ++i)
damage = uint32(damage * reduction);
int32 damage = GetHitDamage();
// Adjust damage based on difficulty
if (map->IsHeroic())
damage = int32(damage * 1.25f); // 25% more damage on Heroic
else if (map->IsMythic())
damage = int32(damage * 1.5f); // 50% more damage on Mythic
SetHitDamage(damage);
}
@@ -318,12 +297,8 @@ class spell_kyrioss_chain_lightning : public SpellScript
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kyrioss_chain_lightning::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kyrioss_chain_lightning::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
private:
uint32 _currentTarget = 0;
};
// 419870 - Lightning Dash
@@ -351,15 +326,15 @@ class spell_kyrioss_lightning_dash : public SpellScript
}
};
// 444324 - 444325 - Stormheart
class spell_kyrioss_stormheart : public AuraScript
// 444325 - Stormheart (Trigger Missile)
class spell_kyrioss_stormheart : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_THUNDERBOLT });
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
void HandleTriggerMissile(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster)
@@ -399,7 +374,7 @@ class spell_kyrioss_stormheart : public AuraScript
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kyrioss_stormheart::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
OnEffectLaunch += SpellEffectFn(spell_kyrioss_stormheart::HandleTriggerMissile, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE);
}
};
@@ -526,59 +501,61 @@ class spell_kyrioss_lightning_torrent : public SpellScript
// 444250 - Lightning Torrent (Damage/Stun)
class spell_kyrioss_lightning_torrent_effect : public SpellScript
{
void FilterTargets(std::list<WorldObject*>& targets)
void HandleDamage(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
targets.remove_if([caster](WorldObject* target)
{
return !caster->IsWithinLOSInMap(target);
});
}
void HandleHitTarget(SpellEffIndex /*effIndex*/)
{
Unit* target = GetHitUnit();
if (!target)
if (!caster || !target)
return;
GetCaster()->CastSpell(target, SPELL_AURA_STUN, TRIGGERED_FULL_MASK);
// Scale damage based on instance difficulty
if (Map* map = caster->GetMap())
{
int32 damage = GetHitDamage();
// Adjust damage based on difficulty
if (map->IsHeroic())
damage = int32(damage * 1.25f); // 25% more damage on Heroic
else if (map->IsMythic())
damage = int32(damage * 1.5f); // 50% more damage on Mythic
SetHitDamage(damage);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kyrioss_lightning_torrent_effect::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kyrioss_lightning_torrent_effect::HandleHitTarget, EFFECT_1, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_kyrioss_lightning_torrent_effect::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 424195 - Unstable Charge Explosion
class spell_kyrioss_unstable_charge_explosion : public SpellScript
{
void FilterTargets(std::list<WorldObject*>& targets)
void HandleDamage(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
// Keep only targets that are in line of sight
targets.remove_if([caster](WorldObject* obj) {
if (Unit* unit = obj->ToUnit())
{
// Check if the target is in line of sight
// Note: The spell has SPELL_ATTR2_IGNORE_LINE_OF_SIGHT, but we're implementing
// the "in line of sight" requirement for the explosion manually
return !caster->IsWithinLOSInMap(unit);
}
return true;
});
// Scale damage based on instance difficulty
if (Map* map = caster->GetMap())
{
int32 damage = GetHitDamage();
// Adjust damage based on difficulty
if (map->IsHeroic())
damage = int32(damage * 1.25f); // 25% more damage on Heroic
else if (map->IsMythic())
damage = int32(damage * 1.5f); // 50% more damage on Mythic
SetHitDamage(damage);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kyrioss_unstable_charge_explosion::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_kyrioss_unstable_charge_explosion::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
@@ -116,49 +116,60 @@ struct boss_stormguard_gorren : public BossAI
}
};
// 424739 Chaotic Corruption transfer
class spell_chaotic_corruption : public SpellScript
// 424739 Chaotic Corruption DOT
class spell_chaotic_corruption : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_CHAOTIC_CORRUPTION_DOT });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
if (!caster || !target)
if (!target || !caster)
return;
// Apply the corruption effect to the target
caster->CastSpell(target, 424739, true);
// Find the nearest player to transfer the corruption to
Player* nearestPlayer = nullptr;
float minDistance = FLT_MAX;
// Visual effect for corruption
uint32 visualId = 135038; // From spell data
caster->SendPlaySpellVisual(target, visualId, 0, 0, 1.0f);
}
void FilterTargets(std::list<WorldObject*>& targets)
{
Unit* caster = GetCaster();
if (!caster)
Map* map = target->GetMap();
if (!map)
return;
// Sort targets by distance (closest first)
targets.sort([caster](WorldObject* a, WorldObject* b) {
return caster->GetDistance(a) < caster->GetDistance(b);
});
Map::PlayerList const& players = map->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource())
{
if (player->IsAlive() && !player->IsGameMaster() && player != target)
{
float distance = target->GetDistance(player);
if (distance < minDistance)
{
minDistance = distance;
nearestPlayer = player;
}
}
}
}
// Limit to MaxTargets (1 from spell data)
if (targets.size() > 1)
targets.resize(1);
// Transfer the corruption to the nearest player
if (nearestPlayer && minDistance < 30.0f) // Within reasonable range
{
caster->CastSpell(nearestPlayer, SPELL_CHAOTIC_CORRUPTION_DOT, true);
// Visual effect for the transfer
uint32 visualId = 135038; // From spell data
caster->SendPlaySpellVisual(nearestPlayer, visualId, 0, 0, 1.0f);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_chaotic_corruption::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_chaotic_corruption::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
AfterEffectRemove += AuraEffectRemoveFn(spell_chaotic_corruption::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
}
};