mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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.
This commit is contained in:
5
sql/updates/world/2013_07_10_01_world_misc.sql
Normal file
5
sql/updates/world/2013_07_10_01_world_misc.sql
Normal file
@@ -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;
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user