refactor(Scripts/AhnKahet): new script system (#9040)
This commit is contained in:
@@ -71,4 +71,7 @@ inline AI* GetAhnKahetAI(T* obj)
|
||||
return GetInstanceAI<AI>(obj, AhnKahetScriptName);
|
||||
}
|
||||
|
||||
#define RegisterAhnKahetCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetAhnKahetAI)
|
||||
#define RegisterAhnKahetGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetAhnKahetAI)
|
||||
|
||||
#endif // DEF_AHNKAHET_H
|
||||
|
||||
@@ -99,16 +99,9 @@ Position const MushroomPositions[MAX_MUSHROOMS_COUNT] =
|
||||
{ 398.2797f, -851.8694f, -68.84419f, 0.5759587f }
|
||||
};
|
||||
|
||||
class boss_amanitar : public CreatureScript
|
||||
struct boss_amanitar : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_amanitar() : CreatureScript("boss_amanitar")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_amanitarAI : public BossAI
|
||||
{
|
||||
boss_amanitarAI(Creature* creature) : BossAI(creature, DATA_AMANITAR), mushroomsSummoned(false)
|
||||
boss_amanitar(Creature* creature) : BossAI(creature, DATA_AMANITAR), mushroomsSummoned(false)
|
||||
{
|
||||
creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
|
||||
@@ -227,7 +220,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
std::deque<Position> _mushroomsDeque;
|
||||
bool mushroomsSummoned;
|
||||
|
||||
@@ -235,22 +228,11 @@ public:
|
||||
{
|
||||
me->SummonCreature(roll_chance_i(40) ? NPC_HEALTHY_MUSHROOM : NPC_POISONOUS_MUSHROOM, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 4000);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<boss_amanitarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_amanitar_mushrooms : public CreatureScript
|
||||
struct npc_amanitar_mushrooms : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_amanitar_mushrooms() : CreatureScript("npc_amanitar_mushrooms") { }
|
||||
|
||||
struct npc_amanitar_mushroomsAI : public ScriptedAI
|
||||
{
|
||||
npc_amanitar_mushroomsAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
npc_amanitar_mushrooms(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
|
||||
@@ -336,25 +318,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<npc_amanitar_mushroomsAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 57283 Remove Mushroom Power
|
||||
class spell_amanitar_remove_mushroom_power : public SpellScriptLoader
|
||||
class spell_amanitar_remove_mushroom_power : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_amanitar_remove_mushroom_power() : SpellScriptLoader("spell_amanitar_remove_mushroom_power") { }
|
||||
|
||||
class spell_amanitar_remove_mushroom_power_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_amanitar_remove_mushroom_power_AuraScript);
|
||||
PrepareAuraScript(spell_amanitar_remove_mushroom_power);
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
@@ -366,21 +337,15 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_amanitar_remove_mushroom_power_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_amanitar_remove_mushroom_power_AuraScript();
|
||||
OnEffectApply += AuraEffectApplyFn(spell_amanitar_remove_mushroom_power::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_amanitar()
|
||||
{
|
||||
new boss_amanitar();
|
||||
new npc_amanitar_mushrooms();
|
||||
RegisterAhnKahetCreatureAI(boss_amanitar);
|
||||
RegisterAhnKahetCreatureAI(npc_amanitar_mushrooms);
|
||||
|
||||
// Spells
|
||||
new spell_amanitar_remove_mushroom_power();
|
||||
RegisterSpellScript(spell_amanitar_remove_mushroom_power);
|
||||
}
|
||||
|
||||
@@ -69,14 +69,9 @@ enum Yells
|
||||
EMOTE_HATCHES = 4
|
||||
};
|
||||
|
||||
class boss_elder_nadox : public CreatureScript
|
||||
struct boss_elder_nadox : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_elder_nadox() : CreatureScript("boss_elder_nadox") { }
|
||||
|
||||
struct boss_elder_nadoxAI : public BossAI
|
||||
{
|
||||
boss_elder_nadoxAI(Creature* creature) : BossAI(creature, DATA_PRINCE_TALDARAM),
|
||||
boss_elder_nadox(Creature* creature) : BossAI(creature, DATA_PRINCE_TALDARAM),
|
||||
guardianSummoned(false),
|
||||
respectYourElders(true)
|
||||
{
|
||||
@@ -232,7 +227,7 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
GuidList swarmEggs;
|
||||
GuidList guardianEggs;
|
||||
ObjectGuid previousSwarmEgg_GUID; // This will prevent casting summoning spells on same egg twice
|
||||
@@ -299,22 +294,11 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<boss_elder_nadoxAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_ahnkahar_nerubian : public CreatureScript
|
||||
struct npc_ahnkahar_nerubian : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_ahnkahar_nerubian() : CreatureScript("npc_ahnkahar_nerubian") { }
|
||||
|
||||
struct npc_ahnkahar_nerubianAI : public ScriptedAI
|
||||
{
|
||||
npc_ahnkahar_nerubianAI(Creature* c) : ScriptedAI(c) { }
|
||||
npc_ahnkahar_nerubian(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -338,24 +322,13 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
uint32 uiSprintTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<npc_ahnkahar_nerubianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ahn_kahet_swarmer_aura : public SpellScriptLoader
|
||||
class spell_ahn_kahet_swarmer_aura : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_ahn_kahet_swarmer_aura() : SpellScriptLoader("spell_ahn_kahet_swarmer_aura") { }
|
||||
|
||||
class spell_ahn_kahet_swarmer_aura_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ahn_kahet_swarmer_aura_SpellScript)
|
||||
PrepareSpellScript(spell_ahn_kahet_swarmer_aura)
|
||||
|
||||
void CountTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
@@ -391,14 +364,8 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ahn_kahet_swarmer_aura_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ahn_kahet_swarmer_aura_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_ahn_kahet_swarmer_aura_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ahn_kahet_swarmer_aura::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ahn_kahet_swarmer_aura::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -417,11 +384,11 @@ class achievement_respect_your_elders : public AchievementCriteriaScript
|
||||
void AddSC_boss_elder_nadox()
|
||||
{
|
||||
// Creatures
|
||||
new boss_elder_nadox();
|
||||
new npc_ahnkahar_nerubian();
|
||||
RegisterAhnKahetCreatureAI(boss_elder_nadox);
|
||||
RegisterAhnKahetCreatureAI(npc_ahnkahar_nerubian);
|
||||
|
||||
// Spells
|
||||
new spell_ahn_kahet_swarmer_aura();
|
||||
RegisterSpellScript(spell_ahn_kahet_swarmer_aura);
|
||||
|
||||
// Achievements
|
||||
new achievement_respect_your_elders();
|
||||
|
||||
@@ -86,18 +86,12 @@ enum Events
|
||||
|
||||
const std::array<uint32, MAX_INSANITY_TARGETS> InsanitySpells = { SPELL_INSANITY_PHASING_1, SPELL_INSANITY_PHASING_2, SPELL_INSANITY_PHASING_3, SPELL_INSANITY_PHASING_4, SPELL_INSANITY_PHASING_5 };
|
||||
|
||||
class boss_volazj : public CreatureScript
|
||||
struct boss_volazj : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_volazj() : CreatureScript("boss_volazj") { }
|
||||
|
||||
struct boss_volazjAI : public BossAI
|
||||
{
|
||||
boss_volazjAI(Creature* pCreature) : BossAI(pCreature, DATA_HERALD_VOLAZJ),
|
||||
boss_volazj(Creature* pCreature) : BossAI(pCreature, DATA_HERALD_VOLAZJ),
|
||||
insanityTimes(0),
|
||||
insanityPhase(false)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
@@ -277,7 +271,7 @@ public:
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
uint8 insanityTimes;
|
||||
bool insanityPhase; // Indicates if boss enter to insanity phase
|
||||
|
||||
@@ -345,23 +339,12 @@ public:
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<boss_volazjAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 57496 Insanity
|
||||
class spell_herald_volzaj_insanity : public SpellScriptLoader
|
||||
class spell_herald_volzaj_insanity : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_herald_volzaj_insanity() : SpellScriptLoader("spell_herald_volzaj_insanity") { }
|
||||
|
||||
class spell_herald_volzaj_insanity_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_herald_volzaj_insanity_SpellScript);
|
||||
PrepareSpellScript(spell_herald_volzaj_insanity);
|
||||
|
||||
bool Load() override { return GetCaster()->GetTypeId() == TYPEID_UNIT; }
|
||||
|
||||
@@ -452,14 +435,8 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_herald_volzaj_insanity_SpellScript::HandleDummyEffect, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
AfterCast += SpellCastFn(spell_herald_volzaj_insanity_SpellScript::HandleAfterCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_herald_volzaj_insanity_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_herald_volzaj_insanity::HandleDummyEffect, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
AfterCast += SpellCastFn(spell_herald_volzaj_insanity::HandleAfterCast);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -470,14 +447,9 @@ public:
|
||||
// 60295 Volazj Whisper: Slay 03
|
||||
// 60296 Volazj Whisper: Death 01
|
||||
// 60297 Volazj Whisper: Death 02
|
||||
class spell_volazj_whisper : public SpellScriptLoader
|
||||
class spell_volazj_whisper : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_volazj_whisper() : SpellScriptLoader("spell_volazj_whisper") { }
|
||||
|
||||
class spell_volazj_whisper_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_volazj_whisper_SpellScript);
|
||||
PrepareSpellScript(spell_volazj_whisper);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
@@ -521,19 +493,13 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_volazj_whisper_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_volazj_whisper_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_volazj_whisper::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_volazj()
|
||||
{
|
||||
new boss_volazj();
|
||||
new spell_herald_volzaj_insanity();
|
||||
new spell_volazj_whisper();
|
||||
RegisterAhnKahetCreatureAI(boss_volazj);
|
||||
RegisterSpellScript(spell_herald_volzaj_insanity);
|
||||
RegisterSpellScript(spell_volazj_whisper);
|
||||
}
|
||||
|
||||
@@ -150,20 +150,14 @@ const Position VolunteerSpotPositions[MAX_COMBAT_INITIATES][2] =
|
||||
{ { 404.0797f, -783.829f, -31.59497f }, { 367.8631f, -722.5212f, -16.17974f } }
|
||||
};
|
||||
|
||||
class boss_jedoga_shadowseeker : public CreatureScript
|
||||
struct boss_jedoga_shadowseeker : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_jedoga_shadowseeker() : CreatureScript("boss_jedoga_shadowseeker") { }
|
||||
|
||||
struct boss_jedoga_shadowseekerAI : public BossAI
|
||||
{
|
||||
boss_jedoga_shadowseekerAI(Creature* pCreature) : BossAI(pCreature, DATA_JEDOGA_SHADOWSEEKER),
|
||||
boss_jedoga_shadowseeker(Creature* pCreature) : BossAI(pCreature, DATA_JEDOGA_SHADOWSEEKER),
|
||||
sayPreachTimer(120000),
|
||||
combatSummonsSummoned(false),
|
||||
ritualTriggered(false),
|
||||
volunteerWork(true)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
// Disabled events
|
||||
void MoveInLineOfSight(Unit* /*who*/) override {}
|
||||
@@ -525,7 +519,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
GuidList oocSummons;
|
||||
GuidList oocTriggers;
|
||||
ObjectGuid sacraficeTarget_GUID;
|
||||
@@ -568,22 +562,11 @@ public:
|
||||
oocSummons.clear();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<boss_jedoga_shadowseekerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_twilight_volunteer : public CreatureScript
|
||||
struct npc_twilight_volunteer : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_twilight_volunteer() : CreatureScript("npc_twilight_volunteer") { }
|
||||
|
||||
struct npc_twilight_volunteerAI : public ScriptedAI
|
||||
{
|
||||
npc_twilight_volunteerAI(Creature* pCreature) : ScriptedAI(pCreature),
|
||||
npc_twilight_volunteer(Creature* pCreature) : ScriptedAI(pCreature),
|
||||
pInstance(pCreature->GetInstanceScript()),
|
||||
isSacraficeTarget(false)
|
||||
{
|
||||
@@ -678,27 +661,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
bool isSacraficeTarget;
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<npc_twilight_volunteerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 56328 - Random Lightning Visual Effect
|
||||
class spell_random_lightning_visual_effect : public SpellScriptLoader
|
||||
class spell_random_lightning_visual_effect : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_random_lightning_visual_effect() : SpellScriptLoader("spell_random_lightning_visual_effect") { }
|
||||
|
||||
class spell_random_lightning_visual_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_random_lightning_visual_effect_SpellScript);
|
||||
PrepareSpellScript(spell_random_lightning_visual_effect);
|
||||
|
||||
void ModDestHeight(SpellDestination& dest)
|
||||
{
|
||||
@@ -708,25 +680,14 @@ class spell_random_lightning_visual_effect : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_random_lightning_visual_effect_SpellScript::ModDestHeight, EFFECT_0, TARGET_DEST_CASTER_RANDOM);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_random_lightning_visual_effect_SpellScript();
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_random_lightning_visual_effect::ModDestHeight, EFFECT_0, TARGET_DEST_CASTER_RANDOM);
|
||||
}
|
||||
};
|
||||
|
||||
// 56150 - Sacrifice Beam
|
||||
class spell_jedoga_sacrafice_beam : public SpellScriptLoader
|
||||
class spell_jedoga_sacrafice_beam : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_jedoga_sacrafice_beam() : SpellScriptLoader("spell_jedoga_sacrafice_beam") { }
|
||||
|
||||
class spell_jedoga_sacrafice_beam_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_jedoga_sacrafice_beam_AuraScript);
|
||||
PrepareAuraScript(spell_jedoga_sacrafice_beam);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
@@ -744,13 +705,7 @@ class spell_jedoga_sacrafice_beam : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_jedoga_sacrafice_beam_AuraScript::HandleRemoval, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_jedoga_sacrafice_beam_AuraScript();
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_jedoga_sacrafice_beam::HandleRemoval, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -776,12 +731,12 @@ class achievement_volunteer_work : public AchievementCriteriaScript
|
||||
void AddSC_boss_jedoga_shadowseeker()
|
||||
{
|
||||
// Creatures
|
||||
new boss_jedoga_shadowseeker();
|
||||
new npc_twilight_volunteer();
|
||||
RegisterAhnKahetCreatureAI(boss_jedoga_shadowseeker);
|
||||
RegisterAhnKahetCreatureAI(npc_twilight_volunteer);
|
||||
|
||||
// Spells
|
||||
new spell_random_lightning_visual_effect();
|
||||
new spell_jedoga_sacrafice_beam();
|
||||
RegisterSpellScript(spell_random_lightning_visual_effect);
|
||||
RegisterSpellScript(spell_jedoga_sacrafice_beam);
|
||||
|
||||
// Achievements
|
||||
new achievement_volunteer_work();
|
||||
|
||||
@@ -93,14 +93,9 @@ constexpr float DATA_GROUND_POSITION_Z = 11.308135f;
|
||||
constexpr float DATA_SPHERE_DISTANCE = 25.0f;
|
||||
#define DATA_SPHERE_ANGLE_OFFSET float(M_PI) / 2.0f
|
||||
|
||||
class npc_taldaram_flamesphere : public CreatureScript
|
||||
struct npc_taldaram_flamesphere : public NullCreatureAI
|
||||
{
|
||||
public:
|
||||
npc_taldaram_flamesphere() : CreatureScript("npc_taldaram_flamesphere") { }
|
||||
|
||||
struct npc_taldaram_flamesphereAI : public NullCreatureAI
|
||||
{
|
||||
npc_taldaram_flamesphereAI(Creature *pCreature) : NullCreatureAI(pCreature),
|
||||
npc_taldaram_flamesphere(Creature *pCreature) : NullCreatureAI(pCreature),
|
||||
instance(pCreature->GetInstanceScript()),
|
||||
uiDespawnTimer(13000),
|
||||
moveTimer(0)
|
||||
@@ -198,29 +193,16 @@ public:
|
||||
victimPos.Relocate(pos);
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
Position victimPos;
|
||||
InstanceScript* instance;
|
||||
uint32 uiDespawnTimer;
|
||||
uint32 moveTimer;
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<npc_taldaram_flamesphereAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_taldaram : public CreatureScript
|
||||
struct boss_taldaram : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_taldaram() : CreatureScript("boss_taldaram")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_taldaramAI : public BossAI
|
||||
{
|
||||
boss_taldaramAI(Creature* pCreature) : BossAI(pCreature, DATA_PRINCE_TALDARAM),
|
||||
boss_taldaram(Creature* pCreature) : BossAI(pCreature, DATA_PRINCE_TALDARAM),
|
||||
vanishDamage(0)
|
||||
{
|
||||
}
|
||||
@@ -363,7 +345,7 @@ public:
|
||||
case NPC_FLAME_SPHERE_2:
|
||||
case NPC_FLAME_SPHERE_3:
|
||||
{
|
||||
if (npc_taldaram_flamesphere::npc_taldaram_flamesphereAI* summonAI = dynamic_cast<npc_taldaram_flamesphere::npc_taldaram_flamesphereAI*>(summon->AI()))
|
||||
if (npc_taldaram_flamesphere* summonAI = dynamic_cast<npc_taldaram_flamesphere*>(summon->AI()))
|
||||
{
|
||||
summonAI->SetVictimPos(victimSperePos);
|
||||
}
|
||||
@@ -491,7 +473,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
Position victimSperePos;
|
||||
ObjectGuid vanishTarget_GUID;
|
||||
uint32 vanishDamage;
|
||||
@@ -504,27 +486,22 @@ public:
|
||||
vanishTarget_GUID.Clear();
|
||||
vanishDamage = 0;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetAhnKahetAI<boss_taldaramAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: Turn into new script type when Gossips have been updated
|
||||
class go_prince_taldaram_sphere : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_prince_taldaram_sphere() : GameObjectScript("go_prince_taldaram_sphere") { }
|
||||
go_prince_taldaram_sphere() : GameObjectScript("go_prince_taldaram_sphere") {}
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, GameObject *go) override
|
||||
bool OnGossipHello(Player* pPlayer, GameObject* go) override
|
||||
{
|
||||
if (pPlayer && pPlayer->IsInCombat())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
InstanceScript *pInstance = go->GetInstanceScript();
|
||||
InstanceScript* pInstance = go->GetInstanceScript();
|
||||
if (!pInstance)
|
||||
{
|
||||
return true;
|
||||
@@ -550,14 +527,9 @@ public:
|
||||
};
|
||||
|
||||
// 55931 - Conjure Flame Sphere
|
||||
class spell_prince_taldaram_conjure_flame_sphere : public SpellScriptLoader
|
||||
class spell_prince_taldaram_conjure_flame_sphere : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_prince_taldaram_conjure_flame_sphere() : SpellScriptLoader("spell_prince_taldaram_conjure_flame_sphere") { }
|
||||
|
||||
class spell_prince_taldaram_conjure_flame_sphere_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_prince_taldaram_conjure_flame_sphere_SpellScript);
|
||||
PrepareSpellScript(spell_prince_taldaram_conjure_flame_sphere);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
@@ -583,25 +555,14 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_prince_taldaram_conjure_flame_sphere_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_prince_taldaram_conjure_flame_sphere_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_prince_taldaram_conjure_flame_sphere::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 55895, 59511, 59512 - Flame Sphere Summon
|
||||
class spell_prince_taldaram_flame_sphere_summon : public SpellScriptLoader
|
||||
class spell_prince_taldaram_flame_sphere_summon : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_prince_taldaram_flame_sphere_summon() : SpellScriptLoader("spell_prince_taldaram_flame_sphere_summon") { }
|
||||
|
||||
class spell_prince_taldaram_flame_sphere_summon_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_prince_taldaram_flame_sphere_summon_SpellScript);
|
||||
PrepareSpellScript(spell_prince_taldaram_flame_sphere_summon);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
@@ -610,23 +571,17 @@ class spell_prince_taldaram_flame_sphere_summon : public SpellScriptLoader
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_prince_taldaram_flame_sphere_summon_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_prince_taldaram_flame_sphere_summon_SpellScript();
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_prince_taldaram_flame_sphere_summon::SetDest, EFFECT_0, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_taldaram()
|
||||
{
|
||||
new npc_taldaram_flamesphere();
|
||||
new boss_taldaram();
|
||||
RegisterAhnKahetCreatureAI(npc_taldaram_flamesphere);
|
||||
RegisterAhnKahetCreatureAI(boss_taldaram);
|
||||
new go_prince_taldaram_sphere();
|
||||
|
||||
// Spells
|
||||
new spell_prince_taldaram_conjure_flame_sphere();
|
||||
new spell_prince_taldaram_flame_sphere_summon();
|
||||
RegisterSpellScript(spell_prince_taldaram_conjure_flame_sphere);
|
||||
RegisterSpellScript(spell_prince_taldaram_flame_sphere_summon);
|
||||
}
|
||||
|
||||
@@ -257,14 +257,9 @@ public:
|
||||
|
||||
// 56702 Shadow Sickle
|
||||
// 59103 Shadow Sickle
|
||||
class spell_shadow_sickle_periodic_damage : public SpellScriptLoader
|
||||
class spell_shadow_sickle_periodic_damage : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_shadow_sickle_periodic_damage() : SpellScriptLoader("spell_shadow_sickle_periodic_damage") { }
|
||||
|
||||
class spell_shadow_sickle_periodic_damage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shadow_sickle_periodic_damage_AuraScript);
|
||||
PrepareAuraScript(spell_shadow_sickle_periodic_damage);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
@@ -273,18 +268,12 @@ public:
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadow_sickle_periodic_damage_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_shadow_sickle_periodic_damage_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadow_sickle_periodic_damage::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_ahnkahet()
|
||||
{
|
||||
new instance_ahnkahet;
|
||||
new spell_shadow_sickle_periodic_damage();
|
||||
RegisterSpellScript(spell_shadow_sickle_periodic_damage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user