refactor(Scripts/ShadowLabirynth): Update Blackheart the Inciter to t… (#16049)
refactor(Scripts/ShadowLabirynth): Update Blackheart the Inciter to the new script model
This commit is contained in:
+9
-33
@@ -25,6 +25,7 @@ enum BlackheartTheInciter
|
|||||||
SPELL_INCITE_CHAOS_B = 33684, //debuff applied to each member of party
|
SPELL_INCITE_CHAOS_B = 33684, //debuff applied to each member of party
|
||||||
SPELL_CHARGE = 33709,
|
SPELL_CHARGE = 33709,
|
||||||
SPELL_WAR_STOMP = 33707,
|
SPELL_WAR_STOMP = 33707,
|
||||||
|
SPELL_LAUGHTER = 33722,
|
||||||
|
|
||||||
SAY_INTRO = 0,
|
SAY_INTRO = 0,
|
||||||
SAY_AGGRO = 1,
|
SAY_AGGRO = 1,
|
||||||
@@ -41,41 +42,22 @@ enum BlackheartTheInciter
|
|||||||
NPC_INCITE_TRIGGER = 19300
|
NPC_INCITE_TRIGGER = 19300
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_blackheart_the_inciter : public CreatureScript
|
struct boss_blackheart_the_inciter : public BossAI
|
||||||
{
|
{
|
||||||
public:
|
boss_blackheart_the_inciter(Creature* creature) : BossAI(creature, DATA_BLACKHEARTTHEINCITEREVENT) { }
|
||||||
boss_blackheart_the_inciter() : CreatureScript("boss_blackheart_the_inciter") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return GetShadowLabyrinthAI<boss_blackheart_the_inciterAI>(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct boss_blackheart_the_inciterAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
boss_blackheart_the_inciterAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
|
||||||
instance = creature->GetInstanceScript();
|
|
||||||
}
|
|
||||||
|
|
||||||
InstanceScript* instance;
|
|
||||||
EventMap events;
|
|
||||||
bool InciteChaos;
|
bool InciteChaos;
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
|
_Reset();
|
||||||
me->SetImmuneToPC(false);
|
me->SetImmuneToPC(false);
|
||||||
InciteChaos = false;
|
InciteChaos = false;
|
||||||
events.Reset();
|
|
||||||
if (instance)
|
|
||||||
{
|
|
||||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KilledUnit(Unit* victim) override
|
void KilledUnit(Unit* victim) override
|
||||||
{
|
{
|
||||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0, 1))
|
if (victim->IsPlayer() && urand(0, 1))
|
||||||
{
|
{
|
||||||
Talk(SAY_SLAY);
|
Talk(SAY_SLAY);
|
||||||
}
|
}
|
||||||
@@ -84,10 +66,7 @@ public:
|
|||||||
void JustDied(Unit* /*killer*/) override
|
void JustDied(Unit* /*killer*/) override
|
||||||
{
|
{
|
||||||
Talk(SAY_DEATH);
|
Talk(SAY_DEATH);
|
||||||
if (instance)
|
_JustDied();
|
||||||
{
|
|
||||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
@@ -98,10 +77,7 @@ public:
|
|||||||
events.ScheduleEvent(EVENT_INCITE_WAIT, 15000);
|
events.ScheduleEvent(EVENT_INCITE_WAIT, 15000);
|
||||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, urand(30000, 50000));
|
events.ScheduleEvent(EVENT_SPELL_CHARGE, urand(30000, 50000));
|
||||||
events.ScheduleEvent(EVENT_SPELL_WAR_STOMP, urand(16950, 26350));
|
events.ScheduleEvent(EVENT_SPELL_WAR_STOMP, urand(16950, 26350));
|
||||||
if (instance)
|
_JustEngagedWith();
|
||||||
{
|
|
||||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterEvadeMode(EvadeReason why) override
|
void EnterEvadeMode(EvadeReason why) override
|
||||||
@@ -129,6 +105,7 @@ public:
|
|||||||
case EVENT_SPELL_INCITE:
|
case EVENT_SPELL_INCITE:
|
||||||
{
|
{
|
||||||
DoCastAOE(SPELL_INCITE_CHAOS);
|
DoCastAOE(SPELL_INCITE_CHAOS);
|
||||||
|
DoCastSelf(SPELL_LAUGHTER, true);
|
||||||
|
|
||||||
uint32 inciteTriggerID = NPC_INCITE_TRIGGER;
|
uint32 inciteTriggerID = NPC_INCITE_TRIGGER;
|
||||||
std::list<HostileReference*> t_list = me->GetThreatMgr().GetThreatList();
|
std::list<HostileReference*> t_list = me->GetThreatMgr().GetThreatList();
|
||||||
@@ -169,9 +146,8 @@ public:
|
|||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_boss_blackheart_the_inciter()
|
void AddSC_boss_blackheart_the_inciter()
|
||||||
{
|
{
|
||||||
new boss_blackheart_the_inciter();
|
RegisterShadowLabyrinthCreatureAI(boss_blackheart_the_inciter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user