mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Scripts/ScarletMonastery: Boss Arcanist Doan - rewrite to events
Closes #12418
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -16,15 +15,9 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Arcanist_Doan
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Scarlet Monastery
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "scarlet_monastery.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
@@ -34,103 +27,100 @@ enum Yells
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_POLYMORPH = 13323,
|
||||
SPELL_AOESILENCE = 8988,
|
||||
SPELL_ARCANEEXPLOSION = 9433,
|
||||
SPELL_FIREAOE = 9435,
|
||||
SPELL_ARCANEBUBBLE = 9438
|
||||
SPELL_SILENCE = 8988,
|
||||
SPELL_ARCANE_EXPLOSION = 9433,
|
||||
SPELL_DETONATION = 9435,
|
||||
SPELL_ARCANE_BUBBLE = 9438,
|
||||
SPELL_POLYMORPH = 13323
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SILENCE = 1,
|
||||
EVENT_ARCANE_EXPLOSION = 2,
|
||||
EVENT_ARCANE_BUBBLE = 3,
|
||||
EVENT_POLYMORPH = 4
|
||||
};
|
||||
|
||||
class boss_arcanist_doan : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { }
|
||||
public:
|
||||
boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_arcanist_doanAI(creature);
|
||||
}
|
||||
|
||||
struct boss_arcanist_doanAI : public ScriptedAI
|
||||
{
|
||||
boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 Polymorph_Timer;
|
||||
uint32 AoESilence_Timer;
|
||||
uint32 ArcaneExplosion_Timer;
|
||||
bool bCanDetonate;
|
||||
bool bShielded;
|
||||
|
||||
void Reset() override
|
||||
struct boss_arcanist_doanAI : public BossAI
|
||||
{
|
||||
Polymorph_Timer = 20000;
|
||||
AoESilence_Timer = 15000;
|
||||
ArcaneExplosion_Timer = 3000;
|
||||
bCanDetonate = false;
|
||||
bShielded = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bShielded && bCanDetonate)
|
||||
boss_arcanist_doanAI(Creature* creature) : BossAI(creature, DATA_ARCANIST_DOAN)
|
||||
{
|
||||
DoCast(me, SPELL_FIREAOE);
|
||||
bCanDetonate = false;
|
||||
_healthAbove50Pct = true;
|
||||
}
|
||||
|
||||
if (me->HasAura(SPELL_ARCANEBUBBLE))
|
||||
return;
|
||||
|
||||
//If we are <50% hp cast Arcane Bubble
|
||||
if (!bShielded && !HealthAbovePct(50))
|
||||
void Reset() override
|
||||
{
|
||||
//wait if we already casting
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
_Reset();
|
||||
_healthAbove50Pct = true;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
_EnterCombat();
|
||||
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 UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
Talk(SAY_SPECIALAE);
|
||||
DoCast(me, SPELL_ARCANEBUBBLE);
|
||||
events.Update(diff);
|
||||
|
||||
bCanDetonate = true;
|
||||
bShielded = true;
|
||||
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 (_healthAbove50Pct && HealthBelowPct(50))
|
||||
{
|
||||
_healthAbove50Pct = false;
|
||||
Talk(SAY_SPECIALAE);
|
||||
DoCast(me, SPELL_ARCANE_BUBBLE);
|
||||
DoCastAOE(SPELL_DETONATION);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
if (Polymorph_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
DoCast(target, SPELL_POLYMORPH);
|
||||
private:
|
||||
bool _healthAbove50Pct;
|
||||
};
|
||||
|
||||
Polymorph_Timer = 20000;
|
||||
}
|
||||
else Polymorph_Timer -= diff;
|
||||
|
||||
//AoESilence_Timer
|
||||
if (AoESilence_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_AOESILENCE);
|
||||
AoESilence_Timer = urand(15000, 20000);
|
||||
}
|
||||
else AoESilence_Timer -= diff;
|
||||
|
||||
//ArcaneExplosion_Timer
|
||||
if (ArcaneExplosion_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ARCANEEXPLOSION);
|
||||
ArcaneExplosion_Timer = 8000;
|
||||
}
|
||||
else ArcaneExplosion_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_arcanist_doanAI(creature);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_arcanist_doan()
|
||||
|
||||
@@ -30,7 +30,8 @@ enum DataTypes
|
||||
DATA_HORSEMAN_EVENT = 5,
|
||||
GAMEOBJECT_PUMPKIN_SHRINE = 6,
|
||||
|
||||
DATA_VORREL = 7
|
||||
DATA_VORREL = 7,
|
||||
DATA_ARCANIST_DOAN = 8
|
||||
};
|
||||
|
||||
#endif // SCARLET_M_
|
||||
|
||||
Reference in New Issue
Block a user