chore(Scripts/BlackTemple): Update Akama, Supremus, Gorefiend and Naj… (#17867)

chore(Scripts/BlackTemple): Update Akama, Supremus, Gorefiend and Najentus to new register method
This commit is contained in:
Andrew
2023-11-26 16:35:16 -03:00
committed by GitHub
parent f440a7479f
commit c9b42d6d6c
5 changed files with 760 additions and 948 deletions
@@ -105,4 +105,6 @@ inline AI* GetBlackTempleAI(T* obj)
return GetInstanceAI<AI>(obj, BlackTempleScriptName); return GetInstanceAI<AI>(obj, BlackTempleScriptName);
} }
#define RegisterBlackTempleCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBlackTempleAI)
#endif // BLACK_TEMPLE_H_ #endif // BLACK_TEMPLE_H_
@@ -90,14 +90,9 @@ enum Misc
EVENT_AKAMA_SCENE7 = 36 EVENT_AKAMA_SCENE7 = 36
}; };
class boss_shade_of_akama : public CreatureScript struct boss_shade_of_akama : public BossAI
{ {
public: boss_shade_of_akama(Creature* creature) : BossAI(creature, DATA_SHADE_OF_AKAMA), summonsChanneler(me), summonsGenerator(me)
boss_shade_of_akama() : CreatureScript("boss_shade_of_akama") { }
struct boss_shade_of_akamaAI : public BossAI
{
boss_shade_of_akamaAI(Creature* creature) : BossAI(creature, DATA_SHADE_OF_AKAMA), summonsChanneler(me), summonsGenerator(me)
{ {
events2.ScheduleEvent(EVENT_SHADE_GATHER_NPCS, 1000); events2.ScheduleEvent(EVENT_SHADE_GATHER_NPCS, 1000);
} }
@@ -158,11 +153,6 @@ public:
} }
} }
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
}
void DoAction(int32 param) override void DoAction(int32 param) override
{ {
if (param == ACTION_START_ENCOUNTER) if (param == ACTION_START_ENCOUNTER)
@@ -268,20 +258,9 @@ public:
} }
}; };
CreatureAI* GetAI(Creature* creature) const override struct npc_akama_shade : public ScriptedAI
{ {
return GetBlackTempleAI<boss_shade_of_akamaAI>(creature); npc_akama_shade(Creature* creature) : ScriptedAI(creature), summons(me)
}
};
class npc_akama_shade : public CreatureScript
{
public:
npc_akama_shade() : CreatureScript("npc_akama_shade") { }
struct npc_akamaAI : public ScriptedAI
{
npc_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me)
{ {
instance = creature->GetInstanceScript(); instance = creature->GetInstanceScript();
} }
@@ -432,24 +411,9 @@ public:
} }
}; };
CreatureAI* GetAI(Creature* creature) const override struct npc_creature_generator_akama : public NullCreatureAI
{ {
return GetBlackTempleAI<npc_akamaAI>(creature); npc_creature_generator_akama(Creature* creature) : NullCreatureAI(creature), summons(me)
}
};
// ########################################################
// Creature Generator Akama
// ########################################################
class npc_creature_generator_akama : public CreatureScript
{
public:
npc_creature_generator_akama() : CreatureScript("npc_creature_generator_akama") { }
struct npc_creature_generator_akamaAI : public NullCreatureAI
{
npc_creature_generator_akamaAI(Creature* creature) : NullCreatureAI(creature), summons(me)
{ {
instance = creature->GetInstanceScript(); instance = creature->GetInstanceScript();
} }
@@ -552,20 +516,9 @@ public:
InstanceScript* instance; InstanceScript* instance;
}; };
CreatureAI* GetAI(Creature* creature) const override class spell_shade_of_akama_shade_soul_channel : public AuraScript
{ {
return GetBlackTempleAI<npc_creature_generator_akamaAI>(creature); PrepareAuraScript(spell_shade_of_akama_shade_soul_channel);
}
};
class spell_shade_of_akama_shade_soul_channel : public SpellScriptLoader
{
public:
spell_shade_of_akama_shade_soul_channel() : SpellScriptLoader("spell_shade_of_akama_shade_soul_channel") { }
class spell_shade_of_akama_shade_soul_channel_AuraScript : public AuraScript
{
PrepareAuraScript(spell_shade_of_akama_shade_soul_channel_AuraScript)
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{ {
@@ -581,25 +534,14 @@ public:
void Register() override void Register() override
{ {
AfterEffectApply += AuraEffectApplyFn(spell_shade_of_akama_shade_soul_channel_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); AfterEffectApply += AuraEffectApplyFn(spell_shade_of_akama_shade_soul_channel::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_shade_of_akama_shade_soul_channel_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); AfterEffectRemove += AuraEffectRemoveFn(spell_shade_of_akama_shade_soul_channel::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
} }
}; };
AuraScript* GetAuraScript() const override class spell_shade_of_akama_akama_soul_expel : public SpellScript
{ {
return new spell_shade_of_akama_shade_soul_channel_AuraScript(); PrepareSpellScript(spell_shade_of_akama_akama_soul_expel);
}
};
class spell_shade_of_akama_akama_soul_expel : public SpellScriptLoader
{
public:
spell_shade_of_akama_akama_soul_expel() : SpellScriptLoader("spell_shade_of_akama_akama_soul_expel") { }
class spell_shade_of_akama_akama_soul_expel_SpellScript : public SpellScript
{
PrepareSpellScript(spell_shade_of_akama_akama_soul_expel_SpellScript);
void SetDest(SpellDestination& dest) void SetDest(SpellDestination& dest)
{ {
@@ -610,21 +552,15 @@ public:
void Register() override void Register() override
{ {
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_shade_of_akama_akama_soul_expel_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS); OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_shade_of_akama_akama_soul_expel::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_shade_of_akama_akama_soul_expel_SpellScript();
} }
}; };
void AddSC_boss_shade_of_akama() void AddSC_boss_shade_of_akama()
{ {
new boss_shade_of_akama(); RegisterBlackTempleCreatureAI(boss_shade_of_akama);
new npc_akama_shade(); RegisterBlackTempleCreatureAI(npc_akama_shade);
new npc_creature_generator_akama(); RegisterBlackTempleCreatureAI(npc_creature_generator_akama);
new spell_shade_of_akama_shade_soul_channel(); RegisterSpellScript(spell_shade_of_akama_shade_soul_channel);
new spell_shade_of_akama_akama_soul_expel(); RegisterSpellScript(spell_shade_of_akama_akama_soul_expel);
} }
@@ -46,26 +46,9 @@ enum Supremus
EVENT_GROUP_ABILITIES = 1 EVENT_GROUP_ABILITIES = 1
}; };
class boss_supremus : public CreatureScript struct boss_supremus : public BossAI
{ {
public: boss_supremus(Creature* creature) : BossAI(creature, DATA_SUPREMUS) { }
boss_supremus() : CreatureScript("boss_supremus") { }
CreatureAI* GetAI(Creature* creature) const override
{
return GetBlackTempleAI<boss_supremusAI>(creature);
}
struct boss_supremusAI : public BossAI
{
boss_supremusAI(Creature* creature) : BossAI(creature, DATA_SUPREMUS)
{
}
void Reset() override
{
BossAI::Reset();
}
void JustEngagedWith(Unit* who) override void JustEngagedWith(Unit* who) override
{ {
@@ -100,11 +83,6 @@ public:
} }
} }
void JustDied(Unit* killer) override
{
BossAI::JustDied(killer);
}
void JustSummoned(Creature* summon) override void JustSummoned(Creature* summon) override
{ {
summons.Summon(summon); summons.Summon(summon);
@@ -201,9 +179,8 @@ public:
return me->GetPositionX() < 565 || me->GetPositionX() > 865 || me->GetPositionY() < 545 || me->GetPositionY() > 1000; return me->GetPositionX() < 565 || me->GetPositionX() > 865 || me->GetPositionY() < 545 || me->GetPositionY() > 1000;
} }
}; };
};
void AddSC_boss_supremus() void AddSC_boss_supremus()
{ {
new boss_supremus(); RegisterBlackTempleCreatureAI(boss_supremus);
} }
@@ -70,22 +70,9 @@ struct ShadowOfDeathSelector
} }
}; };
class boss_teron_gorefiend : public CreatureScript struct boss_teron_gorefiend : public BossAI
{ {
public: boss_teron_gorefiend(Creature* creature) : BossAI(creature, DATA_TERON_GOREFIEND), intro(false) { }
boss_teron_gorefiend() : CreatureScript("boss_teron_gorefiend") { }
CreatureAI* GetAI(Creature* creature) const override
{
return GetBlackTempleAI<boss_teron_gorefiendAI>(creature);
}
struct boss_teron_gorefiendAI : public BossAI
{
boss_teron_gorefiendAI(Creature* creature) : BossAI(creature, DATA_TERON_GOREFIEND)
{
intro = false;
}
bool intro; bool intro;
@@ -179,22 +166,11 @@ public:
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
bool CheckEvadeIfOutOfCombatArea() const override
{
return me->GetDistance(me->GetHomePosition()) > 100.0f;
}
};
}; };
class spell_teron_gorefiend_shadow_of_death : public SpellScriptLoader class spell_teron_gorefiend_shadow_of_death : public AuraScript
{ {
public: PrepareAuraScript(spell_teron_gorefiend_shadow_of_death);
spell_teron_gorefiend_shadow_of_death() : SpellScriptLoader("spell_teron_gorefiend_shadow_of_death") { }
class spell_teron_gorefiend_shadow_of_death_AuraScript : public AuraScript
{
PrepareAuraScript(spell_teron_gorefiend_shadow_of_death_AuraScript)
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/) void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/)
{ {
@@ -218,25 +194,14 @@ public:
void Register() override void Register() override
{ {
OnEffectAbsorb += AuraEffectAbsorbFn(spell_teron_gorefiend_shadow_of_death_AuraScript::Absorb, EFFECT_0); OnEffectAbsorb += AuraEffectAbsorbFn(spell_teron_gorefiend_shadow_of_death::Absorb, EFFECT_0);
AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_shadow_of_death_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL); AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_shadow_of_death::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
} }
}; };
AuraScript* GetAuraScript() const override class spell_teron_gorefiend_spirit_lance : public AuraScript
{ {
return new spell_teron_gorefiend_shadow_of_death_AuraScript(); PrepareAuraScript(spell_teron_gorefiend_spirit_lance);
}
};
class spell_teron_gorefiend_spirit_lance : public SpellScriptLoader
{
public:
spell_teron_gorefiend_spirit_lance() : SpellScriptLoader("spell_teron_gorefiend_spirit_lance") { }
class spell_teron_gorefiend_spirit_lance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_teron_gorefiend_spirit_lance_AuraScript);
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{ {
@@ -253,25 +218,14 @@ public:
void Register() override void Register() override
{ {
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_teron_gorefiend_spirit_lance_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DECREASE_SPEED); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_teron_gorefiend_spirit_lance::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DECREASE_SPEED);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_teron_gorefiend_spirit_lance_AuraScript::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL); OnEffectPeriodic += AuraEffectPeriodicFn(spell_teron_gorefiend_spirit_lance::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
} }
}; };
AuraScript* GetAuraScript() const override class spell_teron_gorefiend_spiritual_vengeance : public AuraScript
{ {
return new spell_teron_gorefiend_spirit_lance_AuraScript(); PrepareAuraScript(spell_teron_gorefiend_spiritual_vengeance);
}
};
class spell_teron_gorefiend_spiritual_vengeance : public SpellScriptLoader
{
public:
spell_teron_gorefiend_spiritual_vengeance() : SpellScriptLoader("spell_teron_gorefiend_spiritual_vengeance") { }
class spell_teron_gorefiend_spiritual_vengeance_AuraScript : public AuraScript
{
PrepareAuraScript(spell_teron_gorefiend_spiritual_vengeance_AuraScript)
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{ {
@@ -280,24 +234,13 @@ public:
void Register() override void Register() override
{ {
AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_spiritual_vengeance_AuraScript::HandleEffectRemove, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL); AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_spiritual_vengeance::HandleEffectRemove, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
} }
}; };
AuraScript* GetAuraScript() const override class spell_teron_gorefiend_shadowy_construct : public AuraScript
{ {
return new spell_teron_gorefiend_spiritual_vengeance_AuraScript(); PrepareAuraScript(spell_teron_gorefiend_shadowy_construct);
}
};
class spell_teron_gorefiend_shadowy_construct : public SpellScriptLoader
{
public:
spell_teron_gorefiend_shadowy_construct() : SpellScriptLoader("spell_teron_gorefiend_shadowy_construct") { }
class spell_teron_gorefiend_shadowy_construct_AuraScript : public AuraScript
{
PrepareAuraScript(spell_teron_gorefiend_shadowy_construct_AuraScript)
bool Load() override bool Load() override
{ {
@@ -325,21 +268,15 @@ public:
void Register() override void Register() override
{ {
AfterEffectApply += AuraEffectApplyFn(spell_teron_gorefiend_shadowy_construct_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); AfterEffectApply += AuraEffectApplyFn(spell_teron_gorefiend_shadowy_construct::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_teron_gorefiend_shadowy_construct_AuraScript();
} }
}; };
void AddSC_boss_teron_gorefiend() void AddSC_boss_teron_gorefiend()
{ {
new boss_teron_gorefiend(); RegisterBlackTempleCreatureAI(boss_teron_gorefiend);
new spell_teron_gorefiend_shadow_of_death(); RegisterSpellScript(spell_teron_gorefiend_shadow_of_death);
new spell_teron_gorefiend_spirit_lance(); RegisterSpellScript(spell_teron_gorefiend_spirit_lance);
new spell_teron_gorefiend_spiritual_vengeance(); RegisterSpellScript(spell_teron_gorefiend_spiritual_vengeance);
new spell_teron_gorefiend_shadowy_construct(); RegisterSpellScript(spell_teron_gorefiend_shadowy_construct);
} }
@@ -50,26 +50,9 @@ enum Events
EVENT_KILL_SPEAK = 6 EVENT_KILL_SPEAK = 6
}; };
class boss_najentus : public CreatureScript struct boss_najentus : public BossAI
{ {
public: boss_najentus(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS) { }
boss_najentus() : CreatureScript("boss_najentus") { }
CreatureAI* GetAI(Creature* creature) const override
{
return GetBlackTempleAI<boss_najentusAI>(creature);
}
struct boss_najentusAI : public BossAI
{
boss_najentusAI(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS)
{
}
void Reset() override
{
BossAI::Reset();
}
void KilledUnit(Unit* victim) override void KilledUnit(Unit* victim) override
{ {
@@ -139,16 +122,10 @@ public:
DoMeleeAttackIfReady(); DoMeleeAttackIfReady();
} }
}; };
};
class spell_najentus_needle_spine : public SpellScriptLoader class spell_najentus_needle_spine : public SpellScript
{ {
public: PrepareSpellScript(spell_najentus_needle_spine);
spell_najentus_needle_spine() : SpellScriptLoader("spell_najentus_needle_spine") { }
class spell_najentus_needle_spine_SpellScript : public SpellScript
{
PrepareSpellScript(spell_najentus_needle_spine_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/) void HandleDummy(SpellEffIndex /*effIndex*/)
{ {
@@ -158,24 +135,13 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_najentus_needle_spine_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_najentus_needle_spine::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
} }
}; };
SpellScript* GetSpellScript() const override class spell_najentus_hurl_spine : public SpellScript
{ {
return new spell_najentus_needle_spine_SpellScript(); PrepareSpellScript(spell_najentus_hurl_spine);
}
};
class spell_najentus_hurl_spine : public SpellScriptLoader
{
public:
spell_najentus_hurl_spine() : SpellScriptLoader("spell_najentus_hurl_spine") { }
class spell_najentus_hurl_spine_SpellScript : public SpellScript
{
PrepareSpellScript(spell_najentus_hurl_spine_SpellScript);
void HandleSchoolDamage(SpellEffIndex /*effIndex*/) void HandleSchoolDamage(SpellEffIndex /*effIndex*/)
{ {
@@ -189,19 +155,13 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_najentus_hurl_spine_SpellScript::HandleSchoolDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); OnEffectHitTarget += SpellEffectFn(spell_najentus_hurl_spine::HandleSchoolDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_najentus_hurl_spine_SpellScript();
} }
}; };
void AddSC_boss_najentus() void AddSC_boss_najentus()
{ {
new boss_najentus(); RegisterBlackTempleCreatureAI(boss_najentus);
new spell_najentus_needle_spine(); RegisterSpellScript(spell_najentus_needle_spine);
new spell_najentus_hurl_spine(); RegisterSpellScript(spell_najentus_hurl_spine);
} }