refactor(Scripts/Ulduar): Spell Scripts use registry macros (#19045)

* algalon phase punch

* algalon collapse

* algalon trigger 3 adds

* algalon cosmic smash damage

* algalon big bang

* algalon remove phase

* algalon supermassive fail

* auriaya sentinel blast

* ic shield of runes

* ic assembly meltdown

* ic rune of summoning

* thorim lightning pillar

* thorim trash impale

* kologarn ulduar stone grip cast target

* kologarn stone grip

* kologarn squeezed lifeless

* kologarn stone shout pair

* mimiron rapid burst

* mimiron laser barrage

* ignis scorch

* ignis grab initial

* ignis slag pot

* ulduar energy sap

* ulduar arachnopod damage

* xt tympanic tantrum

* xt gravity bomb damage

* xt gravity bomb pair

* xt searing light spwan life spark pair

* fl load into catapult

* fl auto repair

* fl systems shutdown

* fl pursue

* fl vehicle throw passenger

* fl tar blaze

* fl vehicle grab pyrite

* fl vehicle circuit overload

* fl orbital supports

* fl thorims hammer

* fl transitus shield beam

* fl shield generator

* fl demolisher ride vehicle

* yogg malady of the mind

* yogg brain_link pair

* yogg shadow beacon

* yogg destabilization matrix

* yogg titanic storm

* yogg lunatic gaze

* yogg protective gaze

* yogg empowered

* yogg insane periodic trigger

* yogg insane

* yogg sanity well

* yogg sanity reduce

* yogg empowering shadows

yogg empowering shadows

* yogg in the mwas of the old god

* yogg target selectors

* yogg grim reprisal

* add sql

* fixup! algalon phase punch

* fixup! algalon remove phase

* fixup! ic assembly meltdown

* vezax mark of the faceless periodic

* vezax mark of the faceless drainhealth

* vezax saronite vapors dummy

* vezax saronite vapors damage

* vezax aura of despair

vezax aura of despair style

vezax aura of despair add validate

* vezax aura of despair add validate hasspell

* Revert "vezax aura of despair add validate hasspell"

This reverts commit fccf163399a12119fc468c2fe41ea0798a55eefc.

* sort sql
This commit is contained in:
Jelle Meeus
2024-06-11 20:42:48 +02:00
committed by GitHub
parent 9684eb437a
commit 77d57efdd1
13 changed files with 1518 additions and 1982 deletions

View File

@@ -1192,68 +1192,51 @@ public:
}
};
class spell_algalon_phase_punch : public SpellScriptLoader
class spell_algalon_phase_punch_aura : public AuraScript
{
public:
spell_algalon_phase_punch() : SpellScriptLoader("spell_algalon_phase_punch") { }
PrepareAuraScript(spell_algalon_phase_punch_aura);
class spell_algalon_phase_punch_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_algalon_phase_punch_AuraScript);
return ValidateSpellInfo(PhasePunchAlphaId);
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
if (GetStackAmount() != 1)
GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 2]);
GetTarget()->CastSpell(GetTarget(), PhasePunchAlphaId[GetStackAmount() - 1], TRIGGERED_FULL_MASK);
if (GetStackAmount() == 5)
Remove(AURA_REMOVE_BY_DEFAULT);
}
void OnRemove(AuraEffect const*, AuraEffectHandleModes)
{
if (GetStackAmount() != 5)
GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 1]);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_phase_punch_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_algalon_phase_punch_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
return new spell_algalon_phase_punch_AuraScript();
PreventDefaultAction();
if (GetStackAmount() != 1)
GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 2]);
GetTarget()->CastSpell(GetTarget(), PhasePunchAlphaId[GetStackAmount() - 1], TRIGGERED_FULL_MASK);
if (GetStackAmount() == 5)
Remove(AURA_REMOVE_BY_DEFAULT);
}
void OnRemove(AuraEffect const*, AuraEffectHandleModes)
{
if (GetStackAmount() != 5)
GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 1]);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_phase_punch_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_algalon_phase_punch_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_algalon_collapse : public SpellScriptLoader
class spell_algalon_collapse_aura : public AuraScript
{
public:
spell_algalon_collapse() : SpellScriptLoader("spell_algalon_collapse") { }
PrepareAuraScript(spell_algalon_collapse_aura);
class spell_algalon_collapse_AuraScript : public AuraScript
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_algalon_collapse_AuraScript);
PreventDefaultAction();
Unit::DealDamage(GetTarget(), GetTarget(), GetTarget()->CountPctFromMaxHealth(1), nullptr, NODAMAGE);
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
Unit::DealDamage(GetTarget(), GetTarget(), GetTarget()->CountPctFromMaxHealth(1), nullptr, NODAMAGE);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_collapse_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_algalon_collapse_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_collapse_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
@@ -1266,172 +1249,123 @@ public:
}
};
class spell_algalon_trigger_3_adds : public SpellScriptLoader
class spell_algalon_trigger_3_adds : public SpellScript
{
public:
spell_algalon_trigger_3_adds() : SpellScriptLoader("spell_algalon_trigger_3_adds") { }
PrepareSpellScript(spell_algalon_trigger_3_adds);
class spell_algalon_trigger_3_adds_SpellScript : public SpellScript
void SelectTarget(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript);
targets.remove_if(ActiveConstellationFilter());
}
void SelectTarget(std::list<WorldObject*>& targets)
{
targets.remove_if(ActiveConstellationFilter());
}
void HandleDummyEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Creature* target = GetHitCreature();
if (!target)
return;
target->AI()->DoAction(ACTION_ACTIVATE_STAR);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_algalon_trigger_3_adds_SpellScript::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void HandleDummyEffect(SpellEffIndex effIndex)
{
return new spell_algalon_trigger_3_adds_SpellScript();
PreventHitDefaultEffect(effIndex);
Creature* target = GetHitCreature();
if (!target)
return;
target->AI()->DoAction(ACTION_ACTIVATE_STAR);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_trigger_3_adds::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_algalon_trigger_3_adds::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_algalon_cosmic_smash_damage : public SpellScriptLoader
class spell_algalon_cosmic_smash_damage : public SpellScript
{
public:
spell_algalon_cosmic_smash_damage() : SpellScriptLoader("spell_algalon_cosmic_smash_damage") { }
PrepareSpellScript(spell_algalon_cosmic_smash_damage);
class spell_algalon_cosmic_smash_damage_SpellScript : public SpellScript
void RecalculateDamage()
{
PrepareSpellScript(spell_algalon_cosmic_smash_damage_SpellScript);
if (!GetExplTargetDest() || !GetHitUnit())
return;
void RecalculateDamage()
{
if (!GetExplTargetDest() || !GetHitUnit())
return;
float distance = GetHitUnit()->GetDistance2d(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY());
if (distance >= 10.0f)
SetHitDamage(int32(float(GetHitDamage()) / distance));
else if (distance > 6.0f)
SetHitDamage(int32(float(GetHitDamage()) / distance) * 2);
}
float distance = GetHitUnit()->GetDistance2d(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY());
if (distance >= 10.0f)
SetHitDamage(int32(float(GetHitDamage()) / distance));
else if (distance > 6.0f)
SetHitDamage(int32(float(GetHitDamage()) / distance) * 2);
}
void Register() override
{
OnHit += SpellHitFn(spell_algalon_cosmic_smash_damage_SpellScript::RecalculateDamage);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_algalon_cosmic_smash_damage_SpellScript();
OnHit += SpellHitFn(spell_algalon_cosmic_smash_damage::RecalculateDamage);
}
};
class spell_algalon_big_bang : public SpellScriptLoader
class spell_algalon_big_bang : public SpellScript
{
public:
spell_algalon_big_bang() : SpellScriptLoader("spell_algalon_big_bang") { }
PrepareSpellScript(spell_algalon_big_bang);
class spell_algalon_big_bang_SpellScript : public SpellScript
bool Load() override
{
PrepareSpellScript(spell_algalon_big_bang_SpellScript);
_targetCount = 0;
return true;
}
bool Load() override
{
_targetCount = 0;
return true;
}
void CountTargets(std::list<WorldObject*>& targets)
{
_targetCount = targets.size();
}
void CheckTargets()
{
Unit* caster = GetCaster();
if (!_targetCount && caster && caster->GetAI())
caster->GetAI()->DoAction(ACTION_ASCEND);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets);
}
uint32 _targetCount;
};
SpellScript* GetSpellScript() const override
void CountTargets(std::list<WorldObject*>& targets)
{
return new spell_algalon_big_bang_SpellScript();
_targetCount = targets.size();
}
void CheckTargets()
{
Unit* caster = GetCaster();
if (!_targetCount && caster && caster->GetAI())
caster->GetAI()->DoAction(ACTION_ASCEND);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_algalon_big_bang::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
AfterCast += SpellCastFn(spell_algalon_big_bang::CheckTargets);
}
private:
uint32 _targetCount;
};
class spell_algalon_remove_phase_aura : public AuraScript
{
PrepareAuraScript(spell_algalon_remove_phase_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_BLACK_HOLE_DAMAGE });
}
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
GetTarget()->RemoveAurasByType(SPELL_AURA_PHASE);
GetTarget()->RemoveAurasDueToSpell(SPELL_BLACK_HOLE_DAMAGE);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_remove_phase_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_algalon_remove_phase : public SpellScriptLoader
class spell_algalon_supermassive_fail : public SpellScript
{
public:
spell_algalon_remove_phase() : SpellScriptLoader("spell_algalon_remove_phase") { }
PrepareSpellScript(spell_algalon_supermassive_fail);
class spell_algalon_remove_phase_AuraScript : public AuraScript
void RecalculateDamage()
{
PrepareAuraScript(spell_algalon_remove_phase_AuraScript);
if (!GetHitPlayer())
return;
void HandlePeriodic(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
GetTarget()->RemoveAurasByType(SPELL_AURA_PHASE);
GetTarget()->RemoveAurasDueToSpell(SPELL_BLACK_HOLE_DAMAGE);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_remove_phase_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_algalon_remove_phase_AuraScript();
GetHitPlayer()->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true);
}
};
class spell_algalon_supermassive_fail : public SpellScriptLoader
{
public:
spell_algalon_supermassive_fail() : SpellScriptLoader("spell_algalon_supermassive_fail") { }
class spell_algalon_supermassive_fail_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_algalon_supermassive_fail_SpellScript);
void RecalculateDamage()
{
if (!GetHitPlayer())
return;
GetHitPlayer()->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true);
}
void Register() override
{
OnHit += SpellHitFn(spell_algalon_supermassive_fail_SpellScript::RecalculateDamage);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_algalon_supermassive_fail_SpellScript();
OnHit += SpellHitFn(spell_algalon_supermassive_fail::RecalculateDamage);
}
};
@@ -1470,13 +1404,13 @@ void AddSC_boss_algalon_the_observer()
new go_celestial_planetarium_access();
// Spells
new spell_algalon_phase_punch();
new spell_algalon_collapse();
new spell_algalon_trigger_3_adds();
new spell_algalon_cosmic_smash_damage();
new spell_algalon_big_bang();
new spell_algalon_remove_phase();
new spell_algalon_supermassive_fail();
RegisterSpellScript(spell_algalon_phase_punch_aura);
RegisterSpellScript(spell_algalon_collapse_aura);
RegisterSpellScript(spell_algalon_trigger_3_adds);
RegisterSpellScript(spell_algalon_cosmic_smash_damage);
RegisterSpellScript(spell_algalon_big_bang);
RegisterSpellScript(spell_algalon_remove_phase_aura);
RegisterSpellScript(spell_algalon_supermassive_fail);
// Achievements
new achievement_algalon_he_feeds_on_your_tears();

View File

@@ -844,94 +844,71 @@ public:
};
};
class spell_shield_of_runes : public SpellScriptLoader
class spell_shield_of_runes_aura : public AuraScript
{
public:
spell_shield_of_runes() : SpellScriptLoader("spell_shield_of_runes") { }
PrepareAuraScript(spell_shield_of_runes_aura);
class spell_shield_of_runes_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_shield_of_runes_AuraScript);
return ValidateSpellInfo({ SPELL_SHIELD_OF_RUNES_BUFF });
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Unit* owner = GetUnitOwner())
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && aurEff->GetAmount() <= 0)
owner->CastSpell(owner, SPELL_SHIELD_OF_RUNES_BUFF, false);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_shield_of_runes_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
return new spell_shield_of_runes_AuraScript();
if (Unit* owner = GetUnitOwner())
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && aurEff->GetAmount() <= 0)
owner->CastSpell(owner, SPELL_SHIELD_OF_RUNES_BUFF, false);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_shield_of_runes_aura::OnRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_assembly_meltdown : public SpellScriptLoader
class spell_assembly_meltdown : public SpellScript
{
public:
spell_assembly_meltdown() : SpellScriptLoader("spell_assembly_meltdown") { }
PrepareSpellScript(spell_assembly_meltdown);
class spell_assembly_meltdown_SpellScript : public SpellScript
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
PrepareSpellScript(spell_assembly_meltdown_SpellScript);
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetGuidData(DATA_STEELBREAKER)))
Steelbreaker->AI()->DoAction(ACTION_ADD_CHARGE);
}
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetGuidData(DATA_STEELBREAKER)))
Steelbreaker->AI()->DoAction(ACTION_ADD_CHARGE);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_assembly_meltdown_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_assembly_meltdown_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_assembly_meltdown::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
}
};
class spell_assembly_rune_of_summoning : public SpellScriptLoader
class spell_assembly_rune_of_summoning_aura : public AuraScript
{
public:
spell_assembly_rune_of_summoning() : SpellScriptLoader("spell_assembly_rune_of_summoning") { }
PrepareAuraScript(spell_assembly_rune_of_summoning_aura);
class spell_assembly_rune_of_summoning_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_assembly_rune_of_summoning_AuraScript);
return ValidateSpellInfo({ SPELL_RUNE_OF_SUMMONING_SUMMON });
}
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (aurEff->GetTickNumber() % 2 == 0)
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, nullptr, aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : ObjectGuid::Empty);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (TempSummon* summ = GetTarget()->ToTempSummon())
summ->DespawnOrUnsummon(1);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_assembly_rune_of_summoning_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_assembly_rune_of_summoning_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnPeriodic(AuraEffect const* aurEff)
{
return new spell_assembly_rune_of_summoning_AuraScript();
PreventDefaultAction();
if (aurEff->GetTickNumber() % 2 == 0)
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, nullptr, aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : ObjectGuid::Empty);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (TempSummon* summ = GetTarget()->ToTempSummon())
summ->DespawnOrUnsummon(1);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_assembly_rune_of_summoning_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectRemove += AuraEffectRemoveFn(spell_assembly_rune_of_summoning_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -978,9 +955,9 @@ void AddSC_boss_assembly_of_iron()
new boss_stormcaller_brundir();
new npc_assembly_lightning();
new spell_shield_of_runes();
new spell_assembly_meltdown();
new spell_assembly_rune_of_summoning();
RegisterSpellScript(spell_shield_of_runes_aura);
RegisterSpellScript(spell_assembly_meltdown);
RegisterSpellScript(spell_assembly_rune_of_summoning_aura);
new achievement_assembly_of_iron("achievement_but_im_on_your_side", 0);
new achievement_assembly_of_iron("achievement_assembly_steelbreaker", NPC_STEELBREAKER);

View File

@@ -432,29 +432,18 @@ public:
};
};
class spell_auriaya_sentinel_blast : public SpellScriptLoader
class spell_auriaya_sentinel_blast : public SpellScript
{
public:
spell_auriaya_sentinel_blast() : SpellScriptLoader("spell_auriaya_sentinel_blast") { }
PrepareSpellScript(spell_auriaya_sentinel_blast);
class spell_auriaya_sentinel_blast_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& unitList)
{
PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript);
unitList.remove_if(PlayerOrPetCheck());
}
void FilterTargets(std::list<WorldObject*>& unitList)
{
unitList.remove_if(PlayerOrPetCheck());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_auriaya_sentinel_blast_SpellScript();
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
@@ -496,7 +485,7 @@ void AddSC_boss_auriaya()
new npc_auriaya_sanctum_sentry();
new npc_auriaya_feral_defender();
new spell_auriaya_sentinel_blast();
RegisterSpellScript(spell_auriaya_sentinel_blast);
new achievement_auriaya_crazy_cat_lady();
new achievement_auriaya_nine_lives();

View File

@@ -1437,151 +1437,133 @@ public:
}
};
class spell_load_into_catapult : public SpellScriptLoader
enum LoadIntoCataPult
{
enum Spells
SPELL_PASSENGER_LOADED = 62340
};
class spell_load_into_catapult_aura : public AuraScript
{
PrepareAuraScript(spell_load_into_catapult_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
SPELL_PASSENGER_LOADED = 62340,
};
return ValidateSpellInfo({ SPELL_PASSENGER_LOADED });
}
public:
spell_load_into_catapult() : SpellScriptLoader("spell_load_into_catapult") { }
class spell_load_into_catapult_AuraScript : public AuraScript
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
PrepareAuraScript(spell_load_into_catapult_AuraScript);
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
owner->CastSpell(owner, SPELL_PASSENGER_LOADED, true);
}
owner->CastSpell(owner, SPELL_PASSENGER_LOADED, true);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
owner->RemoveAurasDueToSpell(SPELL_PASSENGER_LOADED);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_load_into_catapult_AuraScript::OnApply, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_load_into_catapult_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_load_into_catapult_AuraScript();
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
owner->RemoveAurasDueToSpell(SPELL_PASSENGER_LOADED);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_load_into_catapult_aura::OnApply, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_load_into_catapult_aura::OnRemove, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
class spell_auto_repair : public SpellScriptLoader
enum AutoRepair
{
enum Spells
SPELL_AUTO_REPAIR = 62705,
};
class spell_auto_repair : public SpellScript
{
PrepareSpellScript(spell_auto_repair);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
SPELL_AUTO_REPAIR = 62705,
};
return ValidateSpellInfo({ SPELL_AUTO_REPAIR });
}
public:
spell_auto_repair() : SpellScriptLoader("spell_auto_repair") {}
class spell_auto_repair_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_auto_repair_SpellScript);
std::list<WorldObject*> tmplist;
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if (!(*itr)->ToUnit()->HasAura(SPELL_AUTO_REPAIR))
tmplist.push_back(*itr);
void FilterTargets(std::list<WorldObject*>& targets)
{
std::list<WorldObject*> tmplist;
for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
if (!(*itr)->ToUnit()->HasAura(SPELL_AUTO_REPAIR))
tmplist.push_back(*itr);
targets.clear();
for (std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr)
targets.push_back(*itr);
}
targets.clear();
for (std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr)
targets.push_back(*itr);
}
void HandleScript(SpellEffIndex /*eff*/)
{
Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
if (!vehicle)
return;
Unit* driver = vehicle->GetPassenger(0);
if (!driver)
return;
//driver->TextEmote(VEHICLE_EMOTE_REPAIR, driver, true); // No source
// Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
vehicle->GetBase()->SetFullHealth();
// Achievement
if (InstanceScript* instance = vehicle->GetBase()->GetInstanceScript())
instance->SetData(DATA_UNBROKEN_ACHIEVEMENT, 0);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auto_repair_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_auto_repair_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex /*eff*/)
{
return new spell_auto_repair_SpellScript();
Vehicle* vehicle = GetHitUnit()->GetVehicleKit();
if (!vehicle)
return;
Unit* driver = vehicle->GetPassenger(0);
if (!driver)
return;
//driver->TextEmote(VEHICLE_EMOTE_REPAIR, driver, true); // No source
// Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well.
vehicle->GetBase()->SetFullHealth();
// Achievement
if (InstanceScript* instance = vehicle->GetBase()->GetInstanceScript())
instance->SetData(DATA_UNBROKEN_ACHIEVEMENT, 0);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auto_repair::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENTRY);
OnEffectHitTarget += SpellEffectFn(spell_auto_repair::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_systems_shutdown : public SpellScriptLoader
class spell_systems_shutdown_aura : public AuraScript
{
public:
spell_systems_shutdown() : SpellScriptLoader("spell_systems_shutdown") { }
PrepareAuraScript(spell_systems_shutdown_aura);
class spell_systems_shutdown_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_systems_shutdown_AuraScript);
return ValidateSpellInfo({ SPELL_GATHERING_SPEED });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Creature* owner = GetOwner()->ToCreature();
if (!owner)
return;
owner->SetControlled(true, UNIT_STATE_STUNNED);
owner->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
if (Vehicle* veh = owner->GetVehicleKit())
if (Unit* cannon = veh->GetPassenger(SEAT_CANNON))
cannon->GetAI()->DoAction(ACTION_DELAY_CANNON);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Creature* owner = GetOwner()->ToCreature();
if (!owner)
return;
owner->SetControlled(false, UNIT_STATE_STUNNED);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_systems_shutdown_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_systems_shutdown_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_systems_shutdown_AuraScript();
Creature* owner = GetOwner()->ToCreature();
if (!owner)
return;
owner->SetControlled(true, UNIT_STATE_STUNNED);
owner->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED);
if (Vehicle* vehicle = owner->GetVehicleKit())
if (Unit* cannon = vehicle->GetPassenger(SEAT_CANNON))
cannon->GetAI()->DoAction(ACTION_DELAY_CANNON);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Creature* owner = GetOwner()->ToCreature();
if (!owner)
return;
owner->SetControlled(false, UNIT_STATE_STUNNED);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_systems_shutdown_aura::OnApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_systems_shutdown_aura::OnRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1625,431 +1607,344 @@ public:
}
};
class spell_pursue : public SpellScriptLoader
class spell_pursue : public SpellScript
{
public:
spell_pursue() : SpellScriptLoader("spell_pursue") {}
PrepareSpellScript(spell_pursue);
class spell_pursue_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_pursue_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
targets.remove_if(FlameLeviathanPursuedTargetSelector());
if (targets.empty())
{
targets.remove_if(FlameLeviathanPursuedTargetSelector());
if (targets.empty())
{
if (Creature* caster = GetCaster()->ToCreature())
caster->AI()->EnterEvadeMode();
}
else
{
//! In the end, only one target should be selected
WorldObject* _target = Acore::Containers::SelectRandomContainerElement(targets);
targets.clear();
if (_target)
targets.push_back(_target);
}
if (Creature* caster = GetCaster()->ToCreature())
caster->AI()->EnterEvadeMode();
}
void HandleScript(SpellEffIndex /*eff*/)
else
{
Creature* target = GetHitCreature();
Unit* caster = GetCaster();
if (!target || !caster)
return;
caster->GetThreatMgr().ResetAllThreat();
caster->GetAI()->AttackStart(target); // Chase target
caster->AddThreat(target, 10000000.0f);
//! In the end, only one target should be selected
WorldObject* _target = Acore::Containers::SelectRandomContainerElement(targets);
targets.clear();
if (_target)
targets.push_back(_target);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_pursue_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex /*eff*/)
{
return new spell_pursue_SpellScript();
Creature* target = GetHitCreature();
Unit* caster = GetCaster();
if (!target || !caster)
return;
caster->GetThreatMgr().ResetAllThreat();
caster->GetAI()->AttackStart(target); // Chase target
caster->AddThreat(target, 10000000.0f);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_pursue::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_pursue::HandleScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
}
};
class spell_vehicle_throw_passenger : public SpellScriptLoader
class spell_vehicle_throw_passenger : public SpellScript
{
public:
spell_vehicle_throw_passenger() : SpellScriptLoader("spell_vehicle_throw_passenger") {}
PrepareSpellScript(spell_vehicle_throw_passenger);
class spell_vehicle_throw_passenger_SpellScript : public SpellScript
void HandleScript()
{
PrepareSpellScript(spell_vehicle_throw_passenger_SpellScript);
void HandleScript()
{
Spell* baseSpell = GetSpell();
SpellCastTargets targets = baseSpell->m_targets;
if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
if (Unit* passenger = vehicle->GetPassenger(3))
Spell* baseSpell = GetSpell();
SpellCastTargets targets = baseSpell->m_targets;
if (Vehicle* vehicle = GetCaster()->GetVehicleKit())
if (Unit* passenger = vehicle->GetPassenger(3))
{
// use 99 because it is 3d search
std::list<WorldObject*> targetList;
Acore::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, nullptr);
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellAreaTargetCheck> searcher(GetCaster(), targetList, check);
Cell::VisitAllObjects(GetCaster(), searcher, 99.0f);
float minDist = 99 * 99;
Unit* target = nullptr;
for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
{
// use 99 because it is 3d search
std::list<WorldObject*> targetList;
Acore::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, nullptr);
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellAreaTargetCheck> searcher(GetCaster(), targetList, check);
Cell::VisitAllObjects(GetCaster(), searcher, 99.0f);
float minDist = 99 * 99;
Unit* target = nullptr;
for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
{
if (Unit* unit = (*itr)->ToUnit())
if (unit->GetEntry() == NPC_SEAT)
if (Vehicle* seat = unit->GetVehicleKit())
if (!seat->GetPassenger(0))
if (Unit* device = seat->GetPassenger(2))
if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if (Unit* unit = (*itr)->ToUnit())
if (unit->GetEntry() == NPC_SEAT)
if (Vehicle* seat = unit->GetVehicleKit())
if (!seat->GetPassenger(0))
if (Unit* device = seat->GetPassenger(2))
if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
{
float dist = unit->GetExactDistSq(targets.GetDstPos());
if (dist < minDist)
{
float dist = unit->GetExactDistSq(targets.GetDstPos());
if (dist < minDist)
{
minDist = dist;
target = unit;
}
minDist = dist;
target = unit;
}
}
if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[EFFECT_0].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
{
passenger->ExitVehicle();
passenger->EnterVehicle(target, 0);
}
else
{
passenger->ExitVehicle();
float x, y, z;
targets.GetDstPos()->GetPosition(x, y, z);
passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ());
}
}
}
}
void Register() override
{
AfterCast += SpellCastFn(spell_vehicle_throw_passenger_SpellScript::HandleScript);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_vehicle_throw_passenger_SpellScript();
}
};
class spell_tar_blaze : public SpellScriptLoader
{
public:
spell_tar_blaze() : SpellScriptLoader("spell_tar_blaze") { }
class spell_tar_blaze_AuraScript : public AuraScript
{
PrepareAuraScript(spell_tar_blaze_AuraScript);
void OnPeriodic(AuraEffect const* aurEff)
{
GetUnitOwner()->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tar_blaze_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_tar_blaze_AuraScript();
}
};
class spell_vehicle_grab_pyrite : public SpellScriptLoader
{
public:
spell_vehicle_grab_pyrite() : SpellScriptLoader("spell_vehicle_grab_pyrite") {}
class spell_vehicle_grab_pyrite_SpellScript : public SpellScript
{
PrepareSpellScript(spell_vehicle_grab_pyrite_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
if (Unit* seat = GetCaster()->GetVehicleBase())
if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[EFFECT_0].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct
{
if (Vehicle* vSeat = seat->GetVehicleKit())
if (Unit* pyrite = vSeat->GetPassenger(1))
pyrite->ExitVehicle();
if (Unit* parent = seat->GetVehicleBase())
{
GetCaster()->CastSpell(parent, 62496 /*SPELL_ADD_PYRITE*/, true);
target->CastSpell(seat, GetEffectValue());
if (target->GetTypeId() == TYPEID_UNIT)
target->ToCreature()->DespawnOrUnsummon(1300);
}
passenger->ExitVehicle();
passenger->EnterVehicle(target, 0);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_vehicle_grab_pyrite_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_vehicle_grab_pyrite_SpellScript();
}
};
class spell_vehicle_circuit_overload : public SpellScriptLoader
{
public:
spell_vehicle_circuit_overload() : SpellScriptLoader("spell_vehicle_circuit_overload") { }
class spell_vehicle_circuit_overload_AuraScript : public AuraScript
{
PrepareAuraScript(spell_vehicle_circuit_overload_AuraScript);
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* target = GetTarget())
if (int(target->GetAppliedAuras().count(SPELL_OVERLOAD_CIRCUIT)) >= (target->GetMap()->Is25ManRaid() ? 4 : 2))
else
{
target->CastSpell(target, SPELL_SYSTEMS_SHUTDOWN, true);
target->RemoveAurasDueToSpell(SPELL_OVERLOAD_CIRCUIT);
passenger->ExitVehicle();
float x, y, z;
targets.GetDstPos()->GetPosition(x, y, z);
passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ());
}
}
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_vehicle_circuit_overload_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_vehicle_circuit_overload_AuraScript();
AfterCast += SpellCastFn(spell_vehicle_throw_passenger::HandleScript);
}
};
class spell_orbital_supports : public SpellScriptLoader
class spell_tar_blaze_aura : public AuraScript
{
public:
spell_orbital_supports() : SpellScriptLoader("spell_orbital_supports") { }
PrepareAuraScript(spell_tar_blaze_aura);
class spell_orbital_supports_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* aurEff)
{
PrepareAuraScript(spell_orbital_supports_AuraScript);
GetUnitOwner()->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
bool CheckAreaTarget(Unit* target)
{
return target->GetEntry() == NPC_LEVIATHAN;
}
void Register() override
{
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_orbital_supports_AuraScript::CheckAreaTarget);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_orbital_supports_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tar_blaze_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_thorims_hammer : public SpellScriptLoader
enum VehicleGrabPyrite
{
public:
spell_thorims_hammer() : SpellScriptLoader("spell_thorims_hammer") { }
SPELL_ADD_PYRITE = 62496
};
class spell_thorims_hammer_SpellScript : public SpellScript
class spell_vehicle_grab_pyrite : public SpellScript
{
PrepareSpellScript(spell_vehicle_grab_pyrite);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_thorims_hammer_SpellScript);
return ValidateSpellInfo({ SPELL_ADD_PYRITE });
}
void RecalculateDamage(SpellEffIndex effIndex)
{
if (!GetHitUnit() || effIndex == EFFECT_1)
{
PreventHitDefaultEffect(effIndex);
return;
}
float dist = GetHitUnit()->GetExactDist2d(GetCaster());
if (dist <= 7.0f)
{
SetHitDamage(GetSpellInfo()->Effects[EFFECT_1].CalcValue());
}
else
{
dist -= 6.0f;
SetHitDamage(int32(GetSpellInfo()->Effects[EFFECT_1].CalcValue() / std::max(dist, 1.0f)));
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_thorims_hammer_SpellScript::RecalculateDamage, EFFECT_ALL, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex /*effIndex*/)
{
return new spell_thorims_hammer_SpellScript();
if (Unit* target = GetHitUnit())
if (Unit* seat = GetCaster()->GetVehicleBase())
{
if (Vehicle* vehicle = seat->GetVehicleKit())
if (Unit* pyrite = vehicle->GetPassenger(1))
pyrite->ExitVehicle();
if (Unit* parent = seat->GetVehicleBase())
{
GetCaster()->CastSpell(parent, SPELL_ADD_PYRITE, true);
target->CastSpell(seat, GetEffectValue());
if (target->GetTypeId() == TYPEID_UNIT)
target->ToCreature()->DespawnOrUnsummon(1300);
}
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_vehicle_grab_pyrite::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_transitus_shield_beam : public SpellScriptLoader
class spell_vehicle_circuit_overload_aura : public AuraScript
{
public:
spell_transitus_shield_beam() : SpellScriptLoader("spell_transitus_shield_beam") { }
PrepareAuraScript(spell_vehicle_circuit_overload_aura);
class spell_transitus_shield_beam_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_transitus_shield_beam_AuraScript);
return ValidateSpellInfo({ SPELL_SYSTEMS_SHUTDOWN });
}
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
{
return;
}
Unit* target = GetTarget();
if (!target)
{
return;
}
switch (aurEff->GetEffIndex())
{
case EFFECT_0:
caster->AddAura(SPELL_TRANSITUS_SHIELD_IMPACT, target);
break;
}
}
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
{
return;
}
Unit* target = GetTarget();
if (target)
{
target->RemoveAurasDueToSpell(SPELL_TRANSITUS_SHIELD_IMPACT);
}
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_transitus_shield_beam_AuraScript::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_transitus_shield_beam_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const override
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
return new spell_transitus_shield_beam_AuraScript();
if (Unit* target = GetTarget())
if (int(target->GetAppliedAuras().count(SPELL_OVERLOAD_CIRCUIT)) >= (target->GetMap()->Is25ManRaid() ? 4 : 2))
{
target->CastSpell(target, SPELL_SYSTEMS_SHUTDOWN, true);
target->RemoveAurasDueToSpell(SPELL_OVERLOAD_CIRCUIT);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_vehicle_circuit_overload_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_shield_generator : public SpellScriptLoader
class spell_orbital_supports_aura : public AuraScript
{
public:
spell_shield_generator() : SpellScriptLoader("spell_shield_generator") { }
PrepareAuraScript(spell_orbital_supports_aura);
class spell_shield_generator_AuraScript : public AuraScript
bool CheckAreaTarget(Unit* target)
{
PrepareAuraScript(spell_shield_generator_AuraScript);
uint32 absorbPct;
bool Load() override
{
absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
return true;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_shield_generator_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_shield_generator_AuraScript::Absorb, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
return target->GetEntry() == NPC_LEVIATHAN;
}
void Register() override
{
return new spell_shield_generator_AuraScript();
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_orbital_supports_aura::CheckAreaTarget);
}
};
class spell_demolisher_ride_vehicle : public SpellScriptLoader
class spell_thorims_hammer : public SpellScript
{
public:
spell_demolisher_ride_vehicle() : SpellScriptLoader("spell_demolisher_ride_vehicle") {}
PrepareSpellScript(spell_thorims_hammer);
class spell_demolisher_ride_vehicle_SpellScript : public SpellScript
void RecalculateDamage(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_demolisher_ride_vehicle_SpellScript);
SpellCastResult CheckCast()
if (!GetHitUnit() || effIndex == EFFECT_1)
{
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
return SPELL_CAST_OK;
PreventHitDefaultEffect(effIndex);
return;
}
Unit* target = this->GetExplTargetUnit();
if (!target || target->GetEntry() != NPC_SALVAGED_DEMOLISHER)
return SPELL_FAILED_DONT_REPORT;
float dist = GetHitUnit()->GetExactDist2d(GetCaster());
if (dist <= 7.0f)
{
SetHitDamage(GetSpellInfo()->Effects[EFFECT_1].CalcValue());
}
else
{
dist -= 6.0f;
SetHitDamage(int32(GetSpellInfo()->Effects[EFFECT_1].CalcValue() / std::max(dist, 1.0f)));
}
}
Vehicle* veh = target->GetVehicleKit();
if (veh && veh->GetPassenger(0))
if (Unit* target2 = veh->GetPassenger(1))
if (Vehicle* veh2 = target2->GetVehicleKit())
{
if (!veh2->GetPassenger(0))
target2->HandleSpellClick(GetCaster());
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_thorims_hammer::RecalculateDamage, EFFECT_ALL, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
return SPELL_FAILED_DONT_REPORT;
}
class spell_transitus_shield_beam_aura : public AuraScript
{
PrepareAuraScript(spell_transitus_shield_beam_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_TRANSITUS_SHIELD_IMPACT });
}
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
{
return;
}
Unit* target = GetTarget();
if (!target)
{
return;
}
switch (aurEff->GetEffIndex())
{
case EFFECT_0:
caster->AddAura(SPELL_TRANSITUS_SHIELD_IMPACT, target);
break;
}
}
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
{
return;
}
Unit* target = GetTarget();
if (target)
{
target->RemoveAurasDueToSpell(SPELL_TRANSITUS_SHIELD_IMPACT);
}
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_transitus_shield_beam_aura::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
OnEffectRemove += AuraEffectRemoveFn(spell_transitus_shield_beam_aura::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
class spell_shield_generator_aura : public AuraScript
{
PrepareAuraScript(spell_shield_generator_aura);
bool Load() override
{
_absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster());
return true;
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
// Set absorbtion amount to unlimited
amount = -1;
}
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
{
absorbAmount = CalculatePct(dmgInfo.GetDamage(), _absorbPct);
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_shield_generator_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_shield_generator_aura::Absorb, EFFECT_0);
}
private:
uint32 _absorbPct;
};
class spell_demolisher_ride_vehicle : public SpellScript
{
PrepareSpellScript(spell_demolisher_ride_vehicle);
SpellCastResult CheckCast()
{
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
return SPELL_CAST_OK;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_demolisher_ride_vehicle_SpellScript::CheckCast);
}
};
Unit* target = this->GetExplTargetUnit();
if (!target || target->GetEntry() != NPC_SALVAGED_DEMOLISHER)
return SPELL_FAILED_DONT_REPORT;
SpellScript* GetSpellScript() const override
Vehicle* vehicle = target->GetVehicleKit();
if (vehicle && vehicle->GetPassenger(0))
if (Unit* target2 = vehicle->GetPassenger(1))
if (Vehicle* vehicle2 = target2->GetVehicleKit())
{
if (!vehicle2->GetPassenger(0))
target2->HandleSpellClick(GetCaster());
return SPELL_FAILED_DONT_REPORT;
}
return SPELL_CAST_OK;
}
void Register() override
{
return new spell_demolisher_ride_vehicle_SpellScript();
OnCheckCast += SpellCheckCastFn(spell_demolisher_ride_vehicle::CheckCast);
}
};
@@ -2143,19 +2038,19 @@ void AddSC_boss_flame_leviathan()
new go_ulduar_tower();
// Spells
new spell_load_into_catapult();
new spell_auto_repair();
new spell_systems_shutdown();
new spell_pursue();
new spell_vehicle_throw_passenger();
new spell_tar_blaze();
new spell_vehicle_grab_pyrite();
new spell_vehicle_circuit_overload();
new spell_orbital_supports();
new spell_thorims_hammer();
new spell_transitus_shield_beam();
new spell_shield_generator();
new spell_demolisher_ride_vehicle();
RegisterSpellScript(spell_load_into_catapult_aura);
RegisterSpellScript(spell_auto_repair);
RegisterSpellScript(spell_systems_shutdown_aura);
RegisterSpellScript(spell_pursue);
RegisterSpellScript(spell_vehicle_throw_passenger);
RegisterSpellScript(spell_tar_blaze_aura);
RegisterSpellScript(spell_vehicle_grab_pyrite);
RegisterSpellScript(spell_vehicle_circuit_overload_aura);
RegisterSpellScript(spell_orbital_supports_aura);
RegisterSpellScript(spell_thorims_hammer);
RegisterSpellScript(spell_transitus_shield_beam_aura);
RegisterSpellScript(spell_shield_generator_aura);
RegisterSpellScript(spell_demolisher_ride_vehicle);
// Achievements
new achievement_flame_leviathan_towers("achievement_flame_leviathan_orbital_bombardment", 1);

View File

@@ -472,173 +472,138 @@ public:
};
};
class spell_aura_of_despair : public SpellScriptLoader
class spell_aura_of_despair_aura : public AuraScript
{
public:
spell_aura_of_despair() : SpellScriptLoader("spell_aura_of_despair") { }
PrepareAuraScript(spell_aura_of_despair_aura);
class spell_aura_of_despair_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_aura_of_despair_AuraScript)
return ValidateSpellInfo({ SPELL_AURA_OF_DESPAIR_2, SPELL_CORRUPTED_RAGE, SPELL_CORRUPTED_WISDOM });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
{
if (target->GetTypeId() != TYPEID_PLAYER)
return;
target->CastSpell(target, SPELL_AURA_OF_DESPAIR_2, true);
if( target->HasSpell(SPELL_SHAMANISTIC_RAGE) )
caster->CastSpell(target, SPELL_CORRUPTED_RAGE, true);
else if( target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 2) )
caster->CastSpell(target, SPELL_CORRUPTED_WISDOM, true);
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
{
target->RemoveAurasDueToSpell(SPELL_AURA_OF_DESPAIR_2);
target->RemoveAurasDueToSpell(SPELL_CORRUPTED_RAGE);
target->RemoveAurasDueToSpell(SPELL_CORRUPTED_WISDOM);
if (target->GetTypeId() != TYPEID_PLAYER)
return;
target->CastSpell(target, SPELL_AURA_OF_DESPAIR_2, true);
if (target->HasSpell(SPELL_SHAMANISTIC_RAGE))
caster->CastSpell(target, SPELL_CORRUPTED_RAGE, true);
else if (target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 2))
caster->CastSpell(target, SPELL_CORRUPTED_WISDOM, true);
}
}
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_aura_of_despair_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PREVENT_REGENERATE_POWER, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_aura_of_despair_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PREVENT_REGENERATE_POWER, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
return new spell_aura_of_despair_AuraScript();
if (Unit* target = GetTarget())
{
target->RemoveAurasDueToSpell(SPELL_AURA_OF_DESPAIR_2);
target->RemoveAurasDueToSpell(SPELL_CORRUPTED_RAGE);
target->RemoveAurasDueToSpell(SPELL_CORRUPTED_WISDOM);
}
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_aura_of_despair_aura::OnApply, EFFECT_0, SPELL_AURA_PREVENT_REGENERATE_POWER, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_aura_of_despair_aura::OnRemove, EFFECT_0, SPELL_AURA_PREVENT_REGENERATE_POWER, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_mark_of_the_faceless_periodic : public SpellScriptLoader
class spell_mark_of_the_faceless_periodic_aura : public AuraScript
{
public:
spell_mark_of_the_faceless_periodic() : SpellScriptLoader("spell_mark_of_the_faceless_periodic") { }
PrepareAuraScript(spell_mark_of_the_faceless_periodic_aura);
class spell_mark_of_the_faceless_periodic_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_mark_of_the_faceless_periodic_AuraScript)
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
if (target->GetMapId() == 603)
{
int32 dmg = 5000;
caster->CastCustomSpell(target, SPELL_MARK_OF_THE_FACELESS_EFFECT, 0, &dmg, 0, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_the_faceless_periodic_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mark_of_the_faceless_periodic_AuraScript();
return ValidateSpellInfo({ SPELL_MARK_OF_THE_FACELESS_EFFECT });
}
};
class spell_mark_of_the_faceless_drainhealth : public SpellScriptLoader
{
public:
spell_mark_of_the_faceless_drainhealth() : SpellScriptLoader("spell_mark_of_the_faceless_drainhealth") { }
class spell_mark_of_the_faceless_drainhealth_SpellScript : public SpellScript
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareSpellScript(spell_mark_of_the_faceless_drainhealth_SpellScript);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove(GetExplTargetUnit());
if (targets.empty())
Cancel();
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_the_faceless_drainhealth_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mark_of_the_faceless_drainhealth_SpellScript();
}
};
class spell_saronite_vapors_dummy : public SpellScriptLoader
{
public:
spell_saronite_vapors_dummy() : SpellScriptLoader("spell_saronite_vapors_dummy") { }
class spell_saronite_vapors_dummy_AuraScript : public AuraScript
{
PrepareAuraScript(spell_saronite_vapors_dummy_AuraScript)
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
{
int32 damage = 100 * pow(2.0f, (float)GetStackAmount());
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DMG, &damage, nullptr, nullptr, true);
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_saronite_vapors_dummy_AuraScript::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_saronite_vapors_dummy_AuraScript();
}
};
class spell_saronite_vapors_damage : public SpellScriptLoader
{
public:
spell_saronite_vapors_damage() : SpellScriptLoader("spell_saronite_vapors_damage") { }
class spell_saronite_vapors_damage_SpellScript : public SpellScript
{
PrepareSpellScript(spell_saronite_vapors_damage_SpellScript);
void HandleAfterHit()
{
if (Unit* caster = GetCaster())
if (GetHitDamage() > 2)
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
if (target->GetMapId() == 603)
{
int32 mana = GetHitDamage() / 2;
if (Unit* t = GetHitUnit())
caster->CastCustomSpell(t, SPELL_SARONITE_VAPORS_ENERGIZE, &mana, nullptr, nullptr, true);
int32 dmg = 5000;
caster->CastCustomSpell(target, SPELL_MARK_OF_THE_FACELESS_EFFECT, 0, &dmg, 0, true);
}
}
}
void Register() override
{
AfterHit += SpellHitFn(spell_saronite_vapors_damage_SpellScript::HandleAfterHit);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_saronite_vapors_damage_SpellScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_the_faceless_periodic_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_mark_of_the_faceless_drainhealth : public SpellScript
{
PrepareSpellScript(spell_mark_of_the_faceless_drainhealth);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove(GetExplTargetUnit());
if (targets.empty())
Cancel();
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_the_faceless_drainhealth::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
class spell_saronite_vapors_dummy_aura : public AuraScript
{
PrepareAuraScript(spell_saronite_vapors_dummy_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SARONITE_VAPORS_DMG });
}
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
{
int32 damage = 100 * pow(2.0f, (float)GetStackAmount());
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DMG, &damage, nullptr, nullptr, true);
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_saronite_vapors_dummy_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
};
class spell_saronite_vapors_damage : public SpellScript
{
PrepareSpellScript(spell_saronite_vapors_damage);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SARONITE_VAPORS_ENERGIZE });
}
void HandleAfterHit()
{
if (Unit* caster = GetCaster())
if (GetHitDamage() > 2)
{
int32 mana = GetHitDamage() / 2;
if (Unit* target = GetHitUnit())
caster->CastCustomSpell(target, SPELL_SARONITE_VAPORS_ENERGIZE, &mana, nullptr, nullptr, true);
}
}
void Register() override
{
AfterHit += SpellHitFn(spell_saronite_vapors_damage::HandleAfterHit);
}
};
@@ -693,11 +658,11 @@ void AddSC_boss_vezax()
new npc_ulduar_saronite_vapors();
new npc_ulduar_saronite_animus();
new spell_aura_of_despair();
new spell_mark_of_the_faceless_periodic();
new spell_mark_of_the_faceless_drainhealth();
new spell_saronite_vapors_dummy();
new spell_saronite_vapors_damage();
RegisterSpellScript(spell_aura_of_despair_aura);
RegisterSpellScript(spell_mark_of_the_faceless_periodic_aura);
RegisterSpellScript(spell_mark_of_the_faceless_drainhealth);
RegisterSpellScript(spell_saronite_vapors_dummy_aura);
RegisterSpellScript(spell_saronite_vapors_damage);
new achievement_smell_saronite();
new achievement_shadowdodger();

View File

@@ -426,112 +426,112 @@ public:
};
};
class spell_ignis_scorch : public SpellScriptLoader
class spell_ignis_scorch_aura : public AuraScript
{
public:
spell_ignis_scorch() : SpellScriptLoader("spell_ignis_scorch") { }
PrepareAuraScript(spell_ignis_scorch_aura);
class spell_ignis_scorch_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_ignis_scorch_AuraScript)
return ValidateSpellInfo( { SPELL_SCORCHED_GROUND_10, SPELL_SCORCHED_GROUND_25 });
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
if (Unit* c = GetCaster())
if (Creature* s = c->SummonCreature(NPC_SCORCHED_GROUND, c->GetPositionX() + 20.0f * cos(c->GetOrientation()), c->GetPositionY() + 20.0f * std::sin(c->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
{
if (!s->FindNearestCreature(NPC_WATER_TRIGGER, 25.0f, true)) // must be away from the water
s->CastSpell(s, (aurEff->GetId() == 62546 ? SPELL_SCORCHED_GROUND_10 : SPELL_SCORCHED_GROUND_25), true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ignis_scorch_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
return new spell_ignis_scorch_AuraScript();
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
if (Unit* caster = GetCaster())
if (Creature* summon = caster->SummonCreature(NPC_SCORCHED_GROUND, caster->GetPositionX() + 20.0f * cos(caster->GetOrientation()), caster->GetPositionY() + 20.0f * std::sin(caster->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
{
if (!summon->FindNearestCreature(NPC_WATER_TRIGGER, 25.0f, true)) // must be away from the water
summon->CastSpell(summon, (aurEff->GetId() == SPELL_SCORCH_10 ? SPELL_SCORCHED_GROUND_10 : SPELL_SCORCHED_GROUND_25), true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ignis_scorch_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_ignis_grab_initial : public SpellScriptLoader
class spell_ignis_grab_initial : public SpellScript
{
public:
spell_ignis_grab_initial() : SpellScriptLoader("spell_ignis_grab_initial") { }
PrepareSpellScript(spell_ignis_grab_initial);
class spell_ignis_grab_initial_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_ignis_grab_initial_SpellScript);
return ValidateSpellInfo( { SPELL_GRAB_TRIGGERED });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* t = GetHitUnit())
t->CastSpell(t, SPELL_GRAB_TRIGGERED, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ignis_grab_initial_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void HandleScript(SpellEffIndex /*effIndex*/)
{
return new spell_ignis_grab_initial_SpellScript();
if (Unit* target = GetHitUnit())
target->CastSpell(target, SPELL_GRAB_TRIGGERED, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ignis_grab_initial::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
class spell_ignis_slag_pot : public SpellScriptLoader
enum SlagPot
{
public:
spell_ignis_slag_pot() : SpellScriptLoader("spell_ignis_slag_pot") { }
SPELL_SLAG_POT_DAMAGE_1 = 65722,
SPELL_SLAG_POT_DAMAGE_2 = 65723,
SPELL_SCORCH_DAMAGE_1 = 62549,
SPELL_SCORCH_DAMAGE_2 = 63475,
SPELL_SLAG_IMBUED_1 = 62836,
SPELL_SLAG_IMBUED_2 = 63536
};
class spell_ignis_slag_pot_AuraScript : public AuraScript
class spell_ignis_slag_pot_aura : public AuraScript
{
PrepareAuraScript(spell_ignis_slag_pot_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_ignis_slag_pot_AuraScript)
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* c = GetCaster())
if (Unit* t = GetTarget())
c->CastSpell(t, (GetId() == 62717 ? 65722 : 65723), true);
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* t = GetTarget())
return ValidateSpellInfo(
{
t->ApplySpellImmune(GetId(), IMMUNITY_ID, 62549, true);
t->ApplySpellImmune(GetId(), IMMUNITY_ID, 63475, true);
}
}
SPELL_SLAG_POT_DAMAGE_1,
SPELL_SLAG_POT_DAMAGE_2,
SPELL_SCORCH_DAMAGE_1,
SPELL_SCORCH_DAMAGE_2,
SPELL_SLAG_IMBUED_1,
SPELL_SLAG_IMBUED_2
});
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* t = GetTarget())
{
t->ApplySpellImmune(GetId(), IMMUNITY_ID, 62549, false);
t->ApplySpellImmune(GetId(), IMMUNITY_ID, 63475, false);
if (t->IsAlive())
t->CastSpell(t, (GetId() == 62717 ? 62836 : 63536), true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ignis_slag_pot_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectApply += AuraEffectApplyFn(spell_ignis_slag_pot_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_ignis_slag_pot_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
return new spell_ignis_slag_pot_AuraScript();
if (Unit* caster = GetCaster())
if (Unit* target = GetTarget())
caster->CastSpell(target, (GetId() == SPELL_SLAG_POT_10 ? SPELL_SLAG_POT_DAMAGE_1 : SPELL_SLAG_POT_DAMAGE_2), true);
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
{
target->ApplySpellImmune(GetId(), IMMUNITY_ID, SPELL_SCORCH_DAMAGE_1, true);
target->ApplySpellImmune(GetId(), IMMUNITY_ID, SPELL_SCORCH_DAMAGE_2, true);
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
{
target->ApplySpellImmune(GetId(), IMMUNITY_ID, SPELL_SCORCH_DAMAGE_1, false);
target->ApplySpellImmune(GetId(), IMMUNITY_ID, SPELL_SCORCH_DAMAGE_2, false);
if (target->IsAlive())
target->CastSpell(target, (GetId() == SPELL_SLAG_POT_10 ? SPELL_SLAG_IMBUED_1 : SPELL_SLAG_IMBUED_2), true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ignis_slag_pot_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
OnEffectApply += AuraEffectApplyFn(spell_ignis_slag_pot_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_ignis_slag_pot_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -552,8 +552,8 @@ void AddSC_boss_ignis()
{
new boss_ignis();
new npc_ulduar_iron_construct();
new spell_ignis_scorch();
new spell_ignis_grab_initial();
new spell_ignis_slag_pot();
RegisterSpellScript(spell_ignis_scorch_aura);
RegisterSpellScript(spell_ignis_grab_initial);
RegisterSpellScript(spell_ignis_slag_pot_aura);
new achievement_ignis_shattered();
}

View File

@@ -718,156 +718,107 @@ private:
Unit const* _victim;
};
class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
class spell_ulduar_stone_grip_cast_target : public SpellScript
{
public:
spell_ulduar_stone_grip_cast_target() : SpellScriptLoader("spell_ulduar_stone_grip_cast_target") { }
PrepareSpellScript(spell_ulduar_stone_grip_cast_target);
class spell_ulduar_stone_grip_cast_target_SpellScript : public SpellScript
bool Load() override
{
PrepareSpellScript(spell_ulduar_stone_grip_cast_target_SpellScript);
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
return false;
return true;
}
bool Load() override
{
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
return false;
return true;
}
void FilterTargetsInitial(std::list<WorldObject*>& targets)
{
// Remove "main tank" and non-player targets
targets.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->GetVictim()));
// Maximum affected targets per difficulty mode
uint32 maxTargets = 1;
if (GetSpellInfo()->Id == 63981)
maxTargets = 3;
// Return a random amount of targets based on maxTargets
while (maxTargets < targets.size())
{
std::list<WorldObject*>::iterator itr = targets.begin();
advance(itr, urand(0, targets.size() - 1));
targets.erase(itr);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void FilterTargetsInitial(std::list<WorldObject*>& targets)
{
return new spell_ulduar_stone_grip_cast_target_SpellScript();
// Remove "main tank" and non-player targets
targets.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->GetVictim()));
// Maximum affected targets per difficulty mode
uint32 maxTargets = 1;
if (GetSpellInfo()->Id == 63981)
maxTargets = 3;
// Return a random amount of targets based on maxTargets
while (maxTargets < targets.size())
{
std::list<WorldObject*>::iterator itr = targets.begin();
advance(itr, urand(0, targets.size() - 1));
targets.erase(itr);
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target::FilterTargetsInitial, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_ulduar_stone_grip : public SpellScriptLoader
class spell_ulduar_stone_grip_aura : public AuraScript
{
public:
spell_ulduar_stone_grip() : SpellScriptLoader("spell_ulduar_stone_grip") { }
PrepareAuraScript(spell_ulduar_stone_grip_aura);
class spell_ulduar_stone_grip_AuraScript : public AuraScript
void OnRemoveStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
PrepareAuraScript(spell_ulduar_stone_grip_AuraScript);
if (Player* owner = GetOwner()->ToPlayer())
owner->RemoveAurasDueToSpell(aurEff->GetAmount());
}
void OnRemoveStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Player* owner = GetOwner()->ToPlayer())
owner->RemoveAurasDueToSpell(aurEff->GetAmount());
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_AuraScript::OnRemoveStun, EFFECT_2, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_ulduar_stone_grip_AuraScript();
OnEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_aura::OnRemoveStun, EFFECT_2, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
class spell_ulduar_squeezed_lifeless : public SpellScript
{
public:
spell_ulduar_squeezed_lifeless() : SpellScriptLoader("spell_ulduar_squeezed_lifeless") { }
PrepareSpellScript(spell_ulduar_squeezed_lifeless);
class spell_ulduar_squeezed_lifeless_SpellScript : public SpellScript
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
PrepareSpellScript(spell_ulduar_squeezed_lifeless_SpellScript);
if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle())
return;
void HandleInstaKill(SpellEffIndex /*effIndex*/)
{
if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle())
return;
// Hack to set correct position is in _ExitVehicle()
GetHitPlayer()->ExitVehicle();
}
// Hack to set correct position is in _ExitVehicle()
GetHitPlayer()->ExitVehicle();
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_ulduar_squeezed_lifeless_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_ulduar_squeezed_lifeless_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_ulduar_squeezed_lifeless::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
}
};
class spell_kologarn_stone_shout : public SpellScriptLoader
class spell_kologarn_stone_shout : public SpellScript
{
public:
spell_kologarn_stone_shout() : SpellScriptLoader("spell_kologarn_stone_shout") { }
PrepareSpellScript(spell_kologarn_stone_shout);
class spell_kologarn_stone_shout_AuraScript : public AuraScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareAuraScript(spell_kologarn_stone_shout_AuraScript);
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
uint32 triggerSpellId = GetSpellInfo()->Effects[EFFECT_0].TriggerSpell;
if (Unit* caster = GetCaster())
caster->CastSpell(caster, triggerSpellId, false);
}
void Register() override
{
if (m_scriptSpellId == SPELL_STONE_SHOUT_10 || m_scriptSpellId == SPELL_STONE_SHOUT_25)
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kologarn_stone_shout_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_kologarn_stone_shout_AuraScript();
targets.remove_if (PlayerOrPetCheck());
}
class spell_kologarn_stone_shout_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_kologarn_stone_shout_SpellScript);
if (m_scriptSpellId != SPELL_STONE_SHOUT_10 && m_scriptSpellId != SPELL_STONE_SHOUT_25)
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if (PlayerOrPetCheck());
}
class spell_kologarn_stone_shout_aura : public AuraScript
{
PrepareAuraScript(spell_kologarn_stone_shout_aura);
void Register() override
{
if (m_scriptSpellId != SPELL_STONE_SHOUT_10 && m_scriptSpellId != SPELL_STONE_SHOUT_25)
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
return new spell_kologarn_stone_shout_SpellScript();
uint32 triggerSpellId = GetSpellInfo()->Effects[EFFECT_0].TriggerSpell;
if (Unit* caster = GetCaster())
caster->CastSpell(caster, triggerSpellId, false);
}
void Register() override
{
if (m_scriptSpellId == SPELL_STONE_SHOUT_10 || m_scriptSpellId == SPELL_STONE_SHOUT_25)
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kologarn_stone_shout_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -928,10 +879,10 @@ void AddSC_boss_kologarn()
RegisterUlduarCreatureAI(boss_kologarn_pit_kill_bunny);
// Spells
new spell_ulduar_stone_grip_cast_target();
new spell_ulduar_stone_grip();
new spell_ulduar_squeezed_lifeless();
new spell_kologarn_stone_shout();
RegisterSpellScript(spell_ulduar_stone_grip_cast_target);
RegisterSpellScript(spell_ulduar_stone_grip_aura);
RegisterSpellScript(spell_ulduar_squeezed_lifeless);
RegisterSpellAndAuraScriptPair(spell_kologarn_stone_shout, spell_kologarn_stone_shout_aura);
// Achievements
new achievement_kologarn_looks_could_kill();

View File

@@ -2104,87 +2104,83 @@ public:
};
};
class spell_mimiron_rapid_burst : public SpellScriptLoader
class spell_mimiron_rapid_burst_aura : public AuraScript
{
public:
spell_mimiron_rapid_burst() : SpellScriptLoader("spell_mimiron_rapid_burst") { }
PrepareAuraScript(spell_mimiron_rapid_burst_aura);
class spell_mimiron_rapid_burst_AuraScript : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_mimiron_rapid_burst_AuraScript)
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (Unit* c = GetCaster())
return ValidateSpellInfo(
{
uint32 id = ( c->GetMap()->Is25ManRaid() ? ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_25_2 : SPELL_RAPID_BURST_DAMAGE_25_1) : ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_10_2 : SPELL_RAPID_BURST_DAMAGE_10_1) );
c->CastSpell((Unit*)nullptr, id, true);
}
}
SPELL_RAPID_BURST_DAMAGE_10_1,
SPELL_RAPID_BURST_DAMAGE_10_2,
SPELL_RAPID_BURST_DAMAGE_25_1,
SPELL_RAPID_BURST_DAMAGE_25_2
});
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_rapid_burst_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
return new spell_mimiron_rapid_burst_AuraScript();
if (Unit* caster = GetCaster())
{
uint32 id = (caster->GetMap()->Is25ManRaid() ? ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_25_2 : SPELL_RAPID_BURST_DAMAGE_25_1) : ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_10_2 : SPELL_RAPID_BURST_DAMAGE_10_1));
caster->CastSpell((Unit*)nullptr, id, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_rapid_burst_aura::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
}
};
class spell_mimiron_p3wx2_laser_barrage : public SpellScriptLoader
enum p3wx2LaserBarrage
{
public:
spell_mimiron_p3wx2_laser_barrage() : SpellScriptLoader("spell_mimiron_p3wx2_laser_barrage") { }
SPELL_P3WX2_LASER_BARRAGE_1 = 63297,
SPELL_P3WX2_LASER_BARRAGE_2 = 64042
};
class spell_mimiron_p3wx2_laser_barrage_AuraScript : public AuraScript
class spell_mimiron_p3wx2_laser_barrage_aura : public AuraScript
{
PrepareAuraScript(spell_mimiron_p3wx2_laser_barrage_aura);
bool Load() override
{
PrepareAuraScript(spell_mimiron_p3wx2_laser_barrage_AuraScript)
uint32 lastMSTime;
float lastOrientation;
bool Load() override
{
lastMSTime = GameTime::GetGameTimeMS().count();
lastOrientation = -1.0f;
return true;
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* c = GetCaster())
{
if (c->GetTypeId() != TYPEID_UNIT)
return;
uint32 diff = getMSTimeDiff(lastMSTime, GameTime::GetGameTimeMS().count());
if (lastOrientation == -1.0f)
{
lastOrientation = (c->ToCreature()->AI()->GetData(0) * 2 * M_PI) / 100.0f;
diff = 0;
}
float new_o = Position::NormalizeOrientation(lastOrientation - (M_PI / 60) * (diff / 250.0f));
lastMSTime = GameTime::GetGameTimeMS().count();
lastOrientation = new_o;
c->SetFacingTo(new_o);
c->CastSpell((Unit*)nullptr, 63297, true);
c->CastSpell((Unit*)nullptr, 64042, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_p3wx2_laser_barrage_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mimiron_p3wx2_laser_barrage_AuraScript();
_lastMSTime = GameTime::GetGameTimeMS().count();
_lastOrientation = -1.0f;
return true;
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* caster = GetCaster())
{
if (caster->GetTypeId() != TYPEID_UNIT)
return;
uint32 diff = getMSTimeDiff(_lastMSTime, GameTime::GetGameTimeMS().count());
if (_lastOrientation == -1.0f)
{
_lastOrientation = (caster->ToCreature()->AI()->GetData(0) * 2 * M_PI) / 100.0f;
diff = 0;
}
float new_o = Position::NormalizeOrientation(_lastOrientation - (M_PI / 60) * (diff / 250.0f));
_lastMSTime = GameTime::GetGameTimeMS().count();
_lastOrientation = new_o;
caster->SetFacingTo(new_o);
caster->CastSpell((Unit*)nullptr, SPELL_P3WX2_LASER_BARRAGE_1, true);
caster->CastSpell((Unit*)nullptr, SPELL_P3WX2_LASER_BARRAGE_2, true);
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mimiron_p3wx2_laser_barrage_aura::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
private:
uint32 _lastMSTime;
float _lastOrientation;
};
class go_ulduar_do_not_push_this_button : public GameObjectScript
@@ -2518,8 +2514,8 @@ void AddSC_boss_mimiron()
new npc_ulduar_mimiron_rocket();
new npc_ulduar_magnetic_core();
new npc_ulduar_bot_summon_trigger();
new spell_mimiron_rapid_burst();
new spell_mimiron_p3wx2_laser_barrage();
RegisterSpellScript(spell_mimiron_rapid_burst_aura);
RegisterSpellScript(spell_mimiron_p3wx2_laser_barrage_aura);
new go_ulduar_do_not_push_this_button();
new npc_ulduar_flames_initial();
new npc_ulduar_flames_spread();

View File

@@ -1729,59 +1729,37 @@ public:
}
};
class spell_thorim_lightning_pillar_P2 : public SpellScriptLoader
class spell_thorim_lightning_pillar_P2_aura : public AuraScript
{
public:
spell_thorim_lightning_pillar_P2() : SpellScriptLoader("spell_thorim_lightning_pillar_P2") { }
PrepareAuraScript(spell_thorim_lightning_pillar_P2_aura);
class spell_thorim_lightning_pillar_P2_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* aurEff)
{
PrepareAuraScript(spell_thorim_lightning_pillar_P2_AuraScript);
PreventDefaultAction();
if (Unit* caster = GetCaster())
GetUnitOwner()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void OnPeriodic(AuraEffect const* aurEff)
{
PreventDefaultAction();
if (Unit* caster = GetCaster())
GetUnitOwner()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_lightning_pillar_P2_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_thorim_lightning_pillar_P2_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_lightning_pillar_P2_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
class spell_thorim_trash_impale : public SpellScriptLoader
class spell_thorim_trash_impale_aura : public AuraScript
{
public:
spell_thorim_trash_impale() : SpellScriptLoader("spell_thorim_trash_impale") { }
PrepareAuraScript(spell_thorim_trash_impale_aura);
class spell_thorim_trash_impale_AuraScript : public AuraScript
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_thorim_trash_impale_AuraScript);
// deals damage until target is healed above 90%
if (GetUnitOwner()->HealthAbovePct(90))
SetDuration(0);
}
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
// deals damage until target is healed above 90%
if (GetUnitOwner()->HealthAbovePct(90))
SetDuration(0);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_trash_impale_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_thorim_trash_impale_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_trash_impale_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
@@ -1838,8 +1816,8 @@ void AddSC_boss_thorim()
new go_thorim_lever();
// Spells
new spell_thorim_lightning_pillar_P2();
new spell_thorim_trash_impale();
RegisterSpellScript(spell_thorim_lightning_pillar_P2_aura);
RegisterSpellScript(spell_thorim_trash_impale_aura);
// Achievements
new achievement_thorim_stand_in_the_lightning();

View File

@@ -857,191 +857,147 @@ public:
};
// 62775 - Tympanic Tantrum
class spell_xt002_tympanic_tantrum : public SpellScriptLoader
class spell_xt002_tympanic_tantrum : public SpellScript
{
public:
spell_xt002_tympanic_tantrum() : SpellScriptLoader("spell_xt002_tympanic_tantrum") { }
PrepareSpellScript(spell_xt002_tympanic_tantrum);
class spell_xt002_tympanic_tantrum_SpellScript : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript);
targets.remove_if(PlayerOrPetCheck());
}
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(PlayerOrPetCheck());
}
void RecalculateDamage()
{
if (GetHitUnit())
SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
}
};
SpellScript* GetSpellScript() const override
void RecalculateDamage()
{
return new spell_xt002_tympanic_tantrum_SpellScript();
if (GetHitUnit())
SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum::RecalculateDamage);
}
};
// 64234, 63024 - Gravity Bomb
class spell_xt002_gravity_bomb_aura : public SpellScriptLoader
enum GravityBomb
{
public:
spell_xt002_gravity_bomb_aura() : SpellScriptLoader("spell_xt002_gravity_bomb_aura") { }
SPELL_GRAVTY_BOMB_10 = 63025
};
class spell_xt002_gravity_bomb_aura_AuraScript : public AuraScript
class spell_xt002_gravity_bomb : public SpellScript
{
PrepareSpellScript(spell_xt002_gravity_bomb);
void SelectTarget(std::list<WorldObject*>& targets)
{
PrepareAuraScript(spell_xt002_gravity_bomb_aura_AuraScript);
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetOwner()->ToPlayer())
if (Unit* xt002 = GetCaster())
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
if (Creature* cr = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
{
int32 damage = GetSpellInfo()->Id == 63025 ? 5000 : 7500;
cr->CastCustomSpell(cr, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
}
}
void OnPeriodic(AuraEffect const* aurEff)
{
Unit* xt002 = GetCaster();
if (!xt002)
return;
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
if (xt002->GetAI())
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura_AuraScript::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_xt002_gravity_bomb_aura_AuraScript();
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
}
class spell_xt002_gravity_bomb_aura_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_xt002_gravity_bomb_aura_SpellScript);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
void SelectTarget(std::list<WorldObject*>& targets)
{
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
}
class spell_xt002_gravity_bomb_aura : public AuraScript
{
PrepareAuraScript(spell_xt002_gravity_bomb_aura);
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb_aura_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return new spell_xt002_gravity_bomb_aura_SpellScript();
return ValidateSpellInfo({ SPELL_VOID_ZONE_DAMAGE });
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetOwner()->ToPlayer())
if (Unit* xt002 = GetCaster())
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
if (Creature* creature = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
{
int32 damage = GetSpellInfo()->Id == SPELL_GRAVTY_BOMB_10 ? 5000 : 7500;
creature->CastCustomSpell(creature, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
}
}
void OnPeriodic(AuraEffect const* aurEff)
{
Unit* xt002 = GetCaster();
if (!xt002)
return;
Unit* owner = GetOwner()->ToUnit();
if (!owner)
return;
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
if (xt002->GetAI())
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
// 64233, 63025 - Gravity Bomb
class spell_xt002_gravity_bomb_damage : public SpellScriptLoader
class spell_xt002_gravity_bomb_damage : public SpellScript
{
public:
spell_xt002_gravity_bomb_damage() : SpellScriptLoader("spell_xt002_gravity_bomb_damage") { }
PrepareSpellScript(spell_xt002_gravity_bomb_damage);
class spell_xt002_gravity_bomb_damage_SpellScript : public SpellScript
void HandleScript(SpellEffIndex /*eff*/)
{
PrepareSpellScript(spell_xt002_gravity_bomb_damage_SpellScript);
Unit* caster = GetCaster();
if (!caster)
return;
void HandleScript(SpellEffIndex /*eff*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
if (caster->GetAI())
caster->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
}
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
if (caster->GetAI())
caster->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_xt002_gravity_bomb_damage_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_xt002_gravity_bomb_damage_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_xt002_gravity_bomb_damage::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
// 63018, 65121 - Searing Light
class spell_xt002_searing_light_spawn_life_spark : public SpellScriptLoader
class spell_xt002_searing_light_spawn_life_spark : public SpellScript
{
public:
spell_xt002_searing_light_spawn_life_spark() : SpellScriptLoader("spell_xt002_searing_light_spawn_life_spark") { }
PrepareSpellScript(spell_xt002_searing_light_spawn_life_spark);
class spell_xt002_searing_light_spawn_life_spark_AuraScript : public AuraScript
void SelectTarget(std::list<WorldObject*>& targets)
{
PrepareAuraScript(spell_xt002_searing_light_spawn_life_spark_AuraScript);
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetOwner()->ToPlayer())
if (Unit* xt002 = GetCaster())
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
xt002->SummonCreature(NPC_LIFE_SPARK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_xt002_searing_light_spawn_life_spark_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_xt002_searing_light_spawn_life_spark_AuraScript();
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
}
class spell_xt002_searing_light_spawn_life_spark_SpellScript : public SpellScript
void Register() override
{
PrepareSpellScript(spell_xt002_searing_light_spawn_life_spark_SpellScript);
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_searing_light_spawn_life_spark::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
void SelectTarget(std::list<WorldObject*>& targets)
{
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
}
class spell_xt002_searing_light_spawn_life_spark_aura : public AuraScript
{
PrepareAuraScript(spell_xt002_searing_light_spawn_life_spark_aura);
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_searing_light_spawn_life_spark_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
SpellScript* GetSpellScript() const override
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
return new spell_xt002_searing_light_spawn_life_spark_SpellScript();
if (Player* player = GetOwner()->ToPlayer())
if (Unit* xt002 = GetCaster())
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
xt002->SummonCreature(NPC_LIFE_SPARK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_xt002_searing_light_spawn_life_spark_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -1088,10 +1044,10 @@ void AddSC_boss_xt002()
new npc_xt002_life_spark();
// Spells
new spell_xt002_tympanic_tantrum();
new spell_xt002_gravity_bomb_aura();
new spell_xt002_gravity_bomb_damage();
new spell_xt002_searing_light_spawn_life_spark();
RegisterSpellScript(spell_xt002_tympanic_tantrum);
RegisterSpellAndAuraScriptPair(spell_xt002_gravity_bomb, spell_xt002_gravity_bomb_aura);
RegisterSpellScript(spell_xt002_gravity_bomb_damage);
RegisterSpellAndAuraScriptPair(spell_xt002_searing_light_spawn_life_spark, spell_xt002_searing_light_spawn_life_spark_aura);
// Achievements
new achievement_xt002_nerf_engineering();

File diff suppressed because it is too large Load Diff

View File

@@ -79,7 +79,8 @@ enum UldSpells
{
SPELL_SIMPLE_TELEPORT = 12980,
SPELL_KEEPER_TELEPORT = 62940,
SPELL_SNOW_MOUND_PARTICLES = 64615
SPELL_SNOW_MOUND_PARTICLES = 64615,
SPELL_ENERGY_SAP_10 = 64740
};
class npc_ulduar_keeper : public CreatureScript
@@ -201,30 +202,30 @@ public:
}
};
class spell_ulduar_energy_sap : public SpellScriptLoader
enum EnergySap
{
public:
spell_ulduar_energy_sap() : SpellScriptLoader("spell_ulduar_energy_sap") { }
SPELL_ENERGY_SAP_DAMAGE_1 = 64747,
SPELL_ENERGY_SAP_DAMAGE_2 = 64863,
};
class spell_ulduar_energy_sap_AuraScript : public AuraScript
class spell_ulduar_energy_sap_aura : public AuraScript
{
PrepareAuraScript(spell_ulduar_energy_sap_aura);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareAuraScript(spell_ulduar_energy_sap_AuraScript)
return ValidateSpellInfo({ SPELL_ENERGY_SAP_DAMAGE_1, SPELL_ENERGY_SAP_DAMAGE_2 });
}
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
if (Unit* target = GetTarget())
target->CastSpell(target, (aurEff->GetId() == 64740) ? 64747 : 64863, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ulduar_energy_sap_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
AuraScript* GetAuraScript() const override
void HandleEffectPeriodic(AuraEffect const* aurEff)
{
return new spell_ulduar_energy_sap_AuraScript();
if (Unit* target = GetTarget())
target->CastSpell(target, (aurEff->GetId() == SPELL_ENERGY_SAP_10) ? SPELL_ENERGY_SAP_DAMAGE_1 : SPELL_ENERGY_SAP_DAMAGE_2, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ulduar_energy_sap_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
@@ -500,30 +501,19 @@ public:
};
};
class spell_ulduar_arachnopod_damaged : public SpellScriptLoader
class spell_ulduar_arachnopod_damaged_aura : public AuraScript
{
public:
spell_ulduar_arachnopod_damaged() : SpellScriptLoader("spell_ulduar_arachnopod_damaged") { }
PrepareAuraScript(spell_ulduar_arachnopod_damaged_aura);
class spell_ulduar_arachnopod_damaged_AuraScript : public AuraScript
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
PrepareAuraScript(spell_ulduar_arachnopod_damaged_AuraScript)
if (Unit* caster = GetCaster())
Unit::Kill(caster, caster, false);
}
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
if (Unit* c = GetCaster())
Unit::Kill(c, c, false);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ulduar_arachnopod_damaged_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
void Register() override
{
return new spell_ulduar_arachnopod_damaged_AuraScript();
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ulduar_arachnopod_damaged_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
@@ -576,11 +566,11 @@ struct npc_salvaged_siege_engine : public VehicleAI
void AddSC_ulduar()
{
new npc_ulduar_keeper();
new spell_ulduar_energy_sap();
RegisterSpellScript(spell_ulduar_energy_sap_aura);
RegisterUlduarCreatureAI(npc_ulduar_snow_mound);
new npc_ulduar_storm_tempered_keeper();
new npc_ulduar_arachnopod_destroyer();
new spell_ulduar_arachnopod_damaged();
RegisterSpellScript(spell_ulduar_arachnopod_damaged_aura);
new AreaTrigger_at_celestial_planetarium_enterance();
RegisterCreatureAI(npc_salvaged_siege_engine);
}