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:
Skjalf
2023-04-21 10:04:42 -03:00
committed by GitHub
parent 197b053eb4
commit 58d1419add
@@ -25,6 +25,7 @@ enum BlackheartTheInciter
SPELL_INCITE_CHAOS_B = 33684, //debuff applied to each member of party
SPELL_CHARGE = 33709,
SPELL_WAR_STOMP = 33707,
SPELL_LAUGHTER = 33722,
SAY_INTRO = 0,
SAY_AGGRO = 1,
@@ -41,41 +42,22 @@ enum BlackheartTheInciter
NPC_INCITE_TRIGGER = 19300
};
class boss_blackheart_the_inciter : public CreatureScript
struct boss_blackheart_the_inciter : public BossAI
{
public:
boss_blackheart_the_inciter() : CreatureScript("boss_blackheart_the_inciter") { }
boss_blackheart_the_inciter(Creature* creature) : BossAI(creature, DATA_BLACKHEARTTHEINCITEREVENT) { }
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;
void Reset() override
{
_Reset();
me->SetImmuneToPC(false);
InciteChaos = false;
events.Reset();
if (instance)
{
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
}
}
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0, 1))
if (victim->IsPlayer() && urand(0, 1))
{
Talk(SAY_SLAY);
}
@@ -84,10 +66,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DEATH);
if (instance)
{
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
}
_JustDied();
}
void JustEngagedWith(Unit* /*who*/) override
@@ -98,10 +77,7 @@ public:
events.ScheduleEvent(EVENT_INCITE_WAIT, 15000);
events.ScheduleEvent(EVENT_SPELL_CHARGE, urand(30000, 50000));
events.ScheduleEvent(EVENT_SPELL_WAR_STOMP, urand(16950, 26350));
if (instance)
{
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
}
_JustEngagedWith();
}
void EnterEvadeMode(EvadeReason why) override
@@ -129,6 +105,7 @@ public:
case EVENT_SPELL_INCITE:
{
DoCastAOE(SPELL_INCITE_CHAOS);
DoCastSelf(SPELL_LAUGHTER, true);
uint32 inciteTriggerID = NPC_INCITE_TRIGGER;
std::list<HostileReference*> t_list = me->GetThreatMgr().GetThreatList();
@@ -169,9 +146,8 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_blackheart_the_inciter()
{
new boss_blackheart_the_inciter();
RegisterShadowLabyrinthCreatureAI(boss_blackheart_the_inciter);
}