Scripts/ScarletMonastry: reworked Houndmaster Loksey's and Arcanist Doan's scripts

This commit is contained in:
Ovahlord
2020-02-23 22:32:08 +01:00
parent 091e337574
commit de010d6282
5 changed files with 160 additions and 138 deletions

View File

@@ -0,0 +1,12 @@
-- Houndmaster Loksey
UPDATE `creature_template` SET `flags_extra`= `flags_extra` | 0x800 WHERE `entry`= 3974;
DELETE FROM `spawn_group_template` WHERE `groupId`= 433;
INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES
(433, 'Scarlet Monastry - Houndmaster Loksey - Scarlet Tracking Hounds', 4);
DELETE FROM `spawn_group` WHERE `groupId`= 433;
INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES
(433, 0, 40089),
(433, 0, 40091),
(433, 0, 40090);

View File

@@ -21,117 +21,107 @@
enum Yells
{
SAY_AGGRO = 0,
SAY_SPECIALAE = 1
SAY_AGGRO = 0,
SAY_DETONATION = 1
};
enum Spells
{
SPELL_SILENCE = 8988,
SPELL_ARCANE_EXPLOSION = 9433,
SPELL_DETONATION = 9435,
SPELL_ARCANE_BUBBLE = 9438,
SPELL_POLYMORPH = 13323
SPELL_DETONATION = 9435,
SPELL_SILENCE = 8988,
SPELL_ARCANE_EXPLOSION = 9433,
SPELL_ARCANE_BUBBLE = 9438,
SPELL_POLYMORPH = 13323
};
enum Events
{
EVENT_SILENCE = 1,
EVENT_ARCANE_EXPLOSION = 2,
EVENT_ARCANE_BUBBLE = 3,
EVENT_POLYMORPH = 4
EVENT_DETONATION = 1,
EVENT_SILENCE,
EVENT_ARCANE_EXPLOSION,
EVENT_ARCANE_BUBBLE,
EVENT_POLYMORPH
};
class boss_arcanist_doan : public CreatureScript
struct boss_arcanist_doan : public BossAI
{
public:
boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { }
boss_arcanist_doan(Creature* creature) : BossAI(creature, DATA_ARCANIST_DOAN), _detonationTriggered(false) { }
struct boss_arcanist_doanAI : public BossAI
void Reset() override
{
_Reset();
_detonationTriggered = false;
}
void JustEngagedWith(Unit* /*who*/) override
{
_JustEngagedWith();
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_SILENCE, 6s);
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 11s);
events.ScheduleEvent(EVENT_POLYMORPH, 45s);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (!_detonationTriggered && me->HealthBelowPctDamaged(50, damage))
{
boss_arcanist_doanAI(Creature* creature) : BossAI(creature, DATA_ARCANIST_DOAN)
{
_healthAbove50Pct = true;
}
void Reset() override
{
_Reset();
_healthAbove50Pct = true;
}
void JustEngagedWith(Unit* /*who*/) override
{
_JustEngagedWith();
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_SILENCE, 15 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 3 * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_POLYMORPH, 30 * IN_MILLISECONDS);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_SILENCE:
DoCastVictim(SPELL_SILENCE);
events.ScheduleEvent(EVENT_SILENCE, urand(15, 20) * IN_MILLISECONDS);
break;
case EVENT_ARCANE_EXPLOSION:
DoCastVictim(SPELL_ARCANE_EXPLOSION);
events.ScheduleEvent(EVENT_SILENCE, 8 * IN_MILLISECONDS);
break;
case EVENT_POLYMORPH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f, true))
DoCast(target, SPELL_POLYMORPH);
events.ScheduleEvent(EVENT_POLYMORPH, 20 * IN_MILLISECONDS);
break;
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
if (_healthAbove50Pct && HealthBelowPct(50))
{
_healthAbove50Pct = false;
Talk(SAY_SPECIALAE);
DoCast(me, SPELL_ARCANE_BUBBLE);
DoCastAOE(SPELL_DETONATION);
}
DoMeleeAttackIfReady();
}
private:
bool _healthAbove50Pct;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetScarletMonasteryAI<boss_arcanist_doanAI>(creature);
events.ScheduleEvent(EVENT_ARCANE_BUBBLE, 1ms);
_detonationTriggered = true;
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_DETONATION:
Talk(SAY_DETONATION);
DoCastAOE(SPELL_DETONATION);
events.DelayEvents(3s);
break;
case EVENT_SILENCE:
DoCastAOE(SPELL_SILENCE);
events.Repeat(21s, 24s);
break;
case EVENT_ARCANE_EXPLOSION:
DoCastAOE(SPELL_ARCANE_EXPLOSION);
events.Repeat(4s, 14s);
break;
case EVENT_ARCANE_BUBBLE:
DoCastSelf(SPELL_ARCANE_BUBBLE);
me->resetAttackTimer();
events.ScheduleEvent(EVENT_DETONATION, 1s);
break;
case EVENT_POLYMORPH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.f, true))
DoCast(target, SPELL_POLYMORPH);
events.Repeat(20s); // To-do: validate
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
private:
bool _detonationTriggered;
};
void AddSC_boss_arcanist_doan()
{
new boss_arcanist_doan();
RegisterScarletMonastryCreatureAI(boss_arcanist_doan);
}

View File

@@ -21,67 +21,79 @@
enum Yells
{
SAY_AGGRO = 0,
SAY_AGGRO = 0
};
enum Spells
{
SPELL_SUMMONSCARLETHOUND = 17164,
SPELL_BLOODLUST = 6742
SPELL_BATTLE_SHOUT = 77808,
SPELL_BLOODLUST = 6742
};
enum Events
{
EVENT_BLOODLUST = 1
EVENT_BATTLE_SHOUT = 1,
EVENT_BLOODLUST
};
class boss_houndmaster_loksey : public CreatureScript
enum SpawnGroups
{
public:
boss_houndmaster_loksey() : CreatureScript("boss_houndmaster_loksey") { }
SPAWN_GROUP_ID_HOUNDS = 433
};
struct boss_houndmaster_lokseyAI : public BossAI
struct boss_houndmaster_loksey : public BossAI
{
boss_houndmaster_loksey(Creature* creature) : BossAI(creature, DATA_HOUNDMASTER_LOKSEY) { }
void Reset() override
{
BossAI::Reset();
// The dogs will respawn after a wipe
instance->instance->SpawnGroupSpawn(SPAWN_GROUP_ID_HOUNDS, true);
}
void JustEngagedWith(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
_JustEngagedWith();
events.ScheduleEvent(EVENT_BATTLE_SHOUT, 7s);
events.ScheduleEvent(EVENT_BLOODLUST, 10s);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
boss_houndmaster_lokseyAI(Creature* creature) : BossAI(creature, DATA_HOUNDMASTER_LOKSEY) { }
void Reset() override
switch (eventId)
{
_Reset();
case EVENT_BATTLE_SHOUT:
DoCastAOE(SPELL_BATTLE_SHOUT);
events.Repeat(17s, 20s);
break;
case EVENT_BLOODLUST:
if (Creature* hound = me->FindNearestCreature(NPC_SCARLET_TRACKING_HOUND, 10.f, true))
DoCast(hound, SPELL_BLOODLUST);
events.Repeat(46s);
break;
default:
break;
}
void JustEngagedWith(Unit* /*who*/) override
{
Talk(SAY_AGGRO);
_JustEngagedWith();
events.ScheduleEvent(EVENT_BLOODLUST, 20000);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
}
void ExecuteEvent(uint32 eventId) override
{
switch (eventId)
{
case EVENT_BLOODLUST:
DoCast(me, SPELL_BLOODLUST);
events.ScheduleEvent(EVENT_BLOODLUST, 20000);
break;
default:
break;
}
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetScarletMonasteryAI<boss_houndmaster_lokseyAI>(creature);
}
DoMeleeAttackIfReady();
}
};
void AddSC_boss_houndmaster_loksey()
{
new boss_houndmaster_loksey();
RegisterScarletMonastryCreatureAI(boss_houndmaster_loksey);
}

View File

@@ -26,6 +26,8 @@ ObjectData const creatureData[] =
{
{ BOSS_INTERROGATOR_VISHAS, DATA_INTERROGATOR_VISHAS },
{ BOSS_BLOODMAGE_THALNOS, DATA_BLOODMAGE_THALNOS },
{ BOSS_HOUNDMASTER_LOKSEY, DATA_HOUNDMASTER_LOKSEY },
{ BOSS_ARCANIST_DOAN, DATA_ARCANIST_DOAN },
{ 0, 0 } // END
};

View File

@@ -50,6 +50,12 @@ enum SMCreatureIds
// Bosses
BOSS_INTERROGATOR_VISHAS = 3983,
BOSS_BLOODMAGE_THALNOS = 4543,
BOSS_HOUNDMASTER_LOKSEY = 3974,
BOSS_ARCANIST_DOAN = 6487,
// Encounter related creature
/*Houndmaster Loksey*/
NPC_SCARLET_TRACKING_HOUND = 4304,
NPC_MOGRAINE = 3976,
NPC_WHITEMANE = 3977,