aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcrom <malcromdev@gmail.com>2013-07-10 18:29:32 -0230
committerMalcrom <malcromdev@gmail.com>2013-07-10 18:29:32 -0230
commitb7cf456f5313b1513f8ea8599e97bfb275d90346 (patch)
treecb822fdc2f23ab4a5ba4b0567a4a30a88314a7ac
parent2005be04740406f17bd8af8569f2cd75aa0614d4 (diff)
Core/Scripting: Additions to Shade of Akama Script. Just ending sequence left to do.
Please supply feedback if anything is not like offi so I can fix.
-rw-r--r--sql/updates/world/2013_07_10_01_world_misc.sql5
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp205
2 files changed, 207 insertions, 3 deletions
diff --git a/sql/updates/world/2013_07_10_01_world_misc.sql b/sql/updates/world/2013_07_10_01_world_misc.sql
new file mode 100644
index 00000000000..8a2430215df
--- /dev/null
+++ b/sql/updates/world/2013_07_10_01_world_misc.sql
@@ -0,0 +1,5 @@
+UPDATE `creature_template` SET `AIName`= '', `ScriptName` = 'npc_ashtongue_elementalist' WHERE `entry`=23523;
+DELETE FROM smart_scripts WHERE entryorguid=23523;
+
+UPDATE `creature_template` SET `AIName`= '', `ScriptName` = 'npc_ashtongue_spiritbinder' WHERE `entry`=23524;
+DELETE FROM smart_scripts WHERE entryorguid=23524;
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 1b15a3596c3..54abbff6365 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -65,7 +65,14 @@ enum Spells
SPELL_WINDFURY = 38229,
// Ashtongue Rogue
SPELL_DEBILITATING_POISON = 41978,
- SPELL_EVISCERATE = 41177
+ SPELL_EVISCERATE = 41177,
+ // Ashtongue Elementalist
+ SPELL_RAIN_OF_FIRE = 42023,
+ SPELL_LIGHTNING_BOLT = 42024,
+ // Ashtongue Spiritbinder
+ SPELL_SPIRIT_MEND = 42025,
+ SPELL_CHAIN_HEAL = 42027,
+ SPELL_SPIRIT_HEAL = 42317
};
enum Creatures
@@ -127,7 +134,12 @@ enum Events
EVENT_WINDFURY = 20,
// Ashtongue Rogue
EVENT_DEBILITATING_POISON = 21,
- EVENT_EVISCERATE = 22
+ EVENT_EVISCERATE = 22,
+ // Ashtongue Elementalist
+ EVENT_RAIN_OF_FIRE = 23,
+ EVENT_LIGHTNING_BOLT = 24,
+ // Ashtongue Spiritbinder
+ EVENT_SPIRIT_HEAL = 25,
};
struct Location
@@ -911,6 +923,9 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
+ if (!UpdateVictim())
+ return;
+
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
@@ -991,11 +1006,14 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
events.ScheduleEvent(EVENT_DEBILITATING_POISON, urand(500, 2000));
- events.ScheduleEvent(SPELL_EVISCERATE, urand(2000, 5000));
+ events.ScheduleEvent(EVENT_EVISCERATE, urand(2000, 5000));
}
void UpdateAI(uint32 diff) OVERRIDE
{
+ if (!UpdateVictim())
+ return;
+
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
@@ -1030,6 +1048,185 @@ public:
}
};
+// ########################################################
+// Ashtongue Elementalist
+// ########################################################
+
+class npc_ashtongue_elementalist : public CreatureScript
+{
+public:
+ npc_ashtongue_elementalist() : CreatureScript("npc_ashtongue_elementalist") { }
+
+ struct npc_ashtongue_elementalistAI : public ScriptedAI
+ {
+ npc_ashtongue_elementalistAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ if (instance)
+ akamaGUID = instance->GetData64(DATA_AKAMA_SHADE);
+ }
+
+ void Reset() OVERRIDE
+ {
+ if (Unit* target = me->GetCreature(*me, akamaGUID))
+ AttackStart(target);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ me->DespawnOrUnsummon(5000);
+ }
+
+ void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
+ {
+ if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid)))
+ CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 18000);
+ events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 6000);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_RAIN_OF_FIRE:
+ DoCastVictim(SPELL_RAIN_OF_FIRE);
+ events.ScheduleEvent(EVENT_RAIN_OF_FIRE, 20000);
+ break;
+ case EVENT_LIGHTNING_BOLT:
+ DoCastVictim(SPELL_LIGHTNING_BOLT);
+ events.ScheduleEvent(EVENT_LIGHTNING_BOLT, 15000);
+ break;
+ default:
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ InstanceScript* instance;
+ EventMap events;
+ uint64 akamaGUID;
+ uint64 summonerGuid;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_ashtongue_elementalistAI(creature);
+ }
+};
+
+// ########################################################
+// Ashtongue Spiritbinder
+// ########################################################
+
+class npc_ashtongue_spiritbinder : public CreatureScript
+{
+public:
+ npc_ashtongue_spiritbinder() : CreatureScript("npc_ashtongue_spiritbinder") { }
+
+ struct npc_ashtongue_spiritbinderAI : public ScriptedAI
+ {
+ npc_ashtongue_spiritbinderAI(Creature* creature) : ScriptedAI(creature)
+ {
+ instance = creature->GetInstanceScript();
+ if (instance)
+ akamaGUID = instance->GetData64(DATA_AKAMA_SHADE);
+ }
+
+ void Reset() OVERRIDE
+ {
+ spiritMend = false;
+ chainHeal = false;
+
+ if (Unit* target = me->GetCreature(*me, akamaGUID))
+ AttackStart(target);
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ me->DespawnOrUnsummon(5000);
+ }
+
+ void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
+ {
+ if (Creature* summoner = (Unit::GetCreature((*me), summonerGuid)))
+ CAST_AI(npc_creature_generator_akama::npc_creature_generator_akamaAI, summoner->AI())->JustSummoned(me);
+ }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (5000, 6000));
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ events.Update(diff);
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SPIRIT_HEAL:
+ DoCast(me, SPELL_SPIRIT_HEAL);
+ events.ScheduleEvent(EVENT_SPIRIT_HEAL, urand (13000, 16000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (!UpdateVictim())
+ return;
+
+ if (!spiritMend)
+ {
+ if (HealthBelowPct(25))
+ {
+ DoCast(me, SPELL_SPIRIT_MEND);
+ spiritMend = true;
+ }
+ }
+
+ if (!chainHeal)
+ {
+ if (HealthBelowPct(40))
+ {
+ DoCast(me, SPELL_CHAIN_HEAL);
+ chainHeal = true;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ InstanceScript* instance;
+ EventMap events;
+ uint64 akamaGUID;
+ uint64 summonerGuid;
+ bool spiritMend;
+ bool chainHeal;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_ashtongue_spiritbinderAI(creature);
+ }
+};
+
void AddSC_boss_shade_of_akama()
{
new boss_shade_of_akama();
@@ -1039,4 +1236,6 @@ void AddSC_boss_shade_of_akama()
new npc_ashtongue_sorcerer();
new npc_ashtongue_defender();
new npc_ashtongue_rogue();
+ new npc_ashtongue_elementalist();
+ new npc_ashtongue_spiritbinder();
}