Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_arcanist_doan.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/* ScriptData
7SDName: Boss_Arcanist_Doan
8SD%Complete: 100
9SDComment:
10SDCategory: Scarlet Monastery
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
17{
20};
21
30
32{
33public:
34 boss_arcanist_doan() : CreatureScript("boss_arcanist_doan") { }
35
37 {
38 return new boss_arcanist_doanAI(creature);
39 }
40
42 {
43 boss_arcanist_doanAI(Creature* creature) : ScriptedAI(creature) { }
44
50
52 {
53 Polymorph_Timer = 20000;
54 AoESilence_Timer = 15000;
56 bCanDetonate = false;
57 bShielded = false;
58 }
59
60 void EnterCombat(Unit* /*who*/) OVERRIDE
61 {
63 }
64
66 {
67 if (!UpdateVictim())
68 return;
69
71 {
73 bCanDetonate = false;
74 }
75
76 if (me->HasAura(SPELL_ARCANEBUBBLE))
77 return;
78
79 //If we are <50% hp cast Arcane Bubble
80 if (!bShielded && !HealthAbovePct(50))
81 {
82 //wait if we already casting
83 if (me->IsNonMeleeSpellCasted(false))
84 return;
85
88
89 bCanDetonate = true;
90 bShielded = true;
91 }
92
93 if (Polymorph_Timer <= diff)
94 {
95 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
96 DoCast(target, SPELL_POLYMORPH);
97
98 Polymorph_Timer = 20000;
99 }
100 else Polymorph_Timer -= diff;
101
102 //AoESilence_Timer
103 if (AoESilence_Timer <= diff)
104 {
106 AoESilence_Timer = urand(15000, 20000);
107 }
108 else AoESilence_Timer -= diff;
109
110 //ArcaneExplosion_Timer
111 if (ArcaneExplosion_Timer <= diff)
112 {
115 }
116 else ArcaneExplosion_Timer -= diff;
117
119 }
120 };
121};
122
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SPECIALAE
@ SPELL_FIREAOE
@ SPELL_AOESILENCE
@ SPELL_ARCANEBUBBLE
@ SPELL_POLYMORPH
@ SPELL_ARCANEEXPLOSION
void AddSC_boss_arcanist_doan()
#define SAY_AGGRO
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthAbovePct(uint32 pct) const
ScriptedAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================