fix(Scripts/Mechanar): Implement Pathaleon's spawn (#15536)

This commit is contained in:
Skjalf
2023-03-23 05:50:30 -03:00
committed by GitHub
parent 989584b199
commit 10c5ca69cd
3 changed files with 63 additions and 6 deletions
@@ -0,0 +1,4 @@
--
UPDATE `creature_text` SET `Emote` = 33 WHERE `CreatureID` = 19220 AND `GroupID` = 6;
UPDATE `smart_scripts` SET `action_param1` = 1 WHERE `id`=1003 AND `action_type` = 223 AND `entryorguid` IN (-138820, -138869, -138893, -138879);
UPDATE `creature_template_addon` SET `emote` = 0 WHERE (`entry` = 19220);
@@ -37,12 +37,19 @@ enum Spells
SPELL_ARCANE_TORRENT = 36022, SPELL_ARCANE_TORRENT = 36022,
SPELL_MANA_TAP = 36021, SPELL_MANA_TAP = 36021,
SPELL_DOMINATION = 35280, SPELL_DOMINATION = 35280,
SPELL_ETHEREAL_TELEPORT = 34427,
SPELL_GREATER_INVISIBILITY = 34426,
SPELL_SUMMON_NETHER_WRAITH_1 = 35285, SPELL_SUMMON_NETHER_WRAITH_1 = 35285,
SPELL_SUMMON_NETHER_WRAITH_2 = 35286, SPELL_SUMMON_NETHER_WRAITH_2 = 35286,
SPELL_SUMMON_NETHER_WRAITH_3 = 35287, SPELL_SUMMON_NETHER_WRAITH_3 = 35287,
SPELL_SUMMON_NETHER_WRAITH_4 = 35288, SPELL_SUMMON_NETHER_WRAITH_4 = 35288,
}; };
enum Misc
{
ACTION_BRIDGE_MOB_DEATH = 1, // Used by SAI
};
struct boss_pathaleon_the_calculator : public BossAI struct boss_pathaleon_the_calculator : public BossAI
{ {
boss_pathaleon_the_calculator(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) boss_pathaleon_the_calculator(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR)
@@ -53,6 +60,21 @@ struct boss_pathaleon_the_calculator : public BossAI
}); });
} }
void Reset() override
{
_Reset();
if (instance->GetPersistentData(DATA_BRIDGE_MOB_DEATH_COUNT) < 4)
{
DoCastSelf(SPELL_GREATER_INVISIBILITY);
}
}
bool CanAIAttack(Unit const* /*target*/) const override
{
return instance->GetPersistentData(DATA_BRIDGE_MOB_DEATH_COUNT) >= 4;
}
void JustEngagedWith(Unit* /*who*/) override void JustEngagedWith(Unit* /*who*/) override
{ {
_JustEngagedWith(); _JustEngagedWith();
@@ -86,18 +108,48 @@ struct boss_pathaleon_the_calculator : public BossAI
context.Repeat(15s); context.Repeat(15s);
}).Schedule(25s, [this](TaskContext context) }).Schedule(25s, [this](TaskContext context)
{ {
Talk(SAY_DOMINATION); if (DoCastRandomTarget(SPELL_DOMINATION, 1, 50.0f) == SPELL_CAST_OK)
DoCastRandomTarget(SPELL_DOMINATION, 1, 50.0f); {
Talk(SAY_DOMINATION);
}
context.Repeat(30s); context.Repeat(30s);
}).Schedule(8s, [this](TaskContext context)
{
DoCastAOE(SPELL_ARCANE_EXPLOSION);
context.Repeat(12s);
}); });
if (IsHeroic())
{
scheduler.Schedule(8s, [this](TaskContext context)
{
DoCastAOE(SPELL_ARCANE_EXPLOSION);
context.Repeat(12s);
});
}
Talk(SAY_AGGRO); Talk(SAY_AGGRO);
} }
void DoAction(int32 actionId) override
{
if (actionId == ACTION_BRIDGE_MOB_DEATH)
{
uint8 mobCount = instance->GetPersistentData(DATA_BRIDGE_MOB_DEATH_COUNT);
instance->StorePersistentData(DATA_BRIDGE_MOB_DEATH_COUNT, ++mobCount);
if (mobCount >= 4)
{
DoCastSelf(SPELL_ETHEREAL_TELEPORT);
Talk(SAY_APPEAR);
scheduler.Schedule(2s, [this](TaskContext)
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H);
}).Schedule(25s, [this](TaskContext)
{
DoZoneInCombat();
});
}
}
}
void KilledUnit(Unit* victim) override void KilledUnit(Unit* victim) override
{ {
if (victim->IsPlayer()) if (victim->IsPlayer())
@@ -63,6 +63,7 @@ enum SpellIds
enum DataIndex enum DataIndex
{ {
DATA_BRIDGE_MOB_DEATH_COUNT,
MAX_DATA_INDEXES MAX_DATA_INDEXES
}; };