Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_curator.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_Curator
8SD%Complete: 100
9SDComment:
10SDCategory: Karazhan
11EndScriptData */
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15
17{
24
25 //Flare spell info
26 SPELL_ASTRAL_FLARE_PASSIVE = 30234, //Visual effect + Flare damage
27
28 //Curator spell info
31 SPELL_ENRAGE = 30403, //Arcane Infusion: Transforms Curator and adds damage.
33};
34
35
36
37
39{
40public:
41 boss_curator() : CreatureScript("boss_curator") { }
42
44 {
45 return new boss_curatorAI(creature);
46 }
47
48 struct boss_curatorAI : public ScriptedAI
49 {
50 boss_curatorAI(Creature* creature) : ScriptedAI(creature) { }
51
55
56 bool Enraged;
58
60 {
61 AddTimer = 10000;
62 HatefulBoltTimer = 15000; //This time may be wrong
63 BerserkTimer = 720000; //12 minutes
64 Enraged = false;
65 Evocating = false;
66
67 me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
68 }
69
70 void KilledUnit(Unit* /*victim*/) OVERRIDE
71 {
73 }
74
75 void JustDied(Unit* /*killer*/) OVERRIDE
76 {
78 }
79
80 void EnterCombat(Unit* /*who*/) OVERRIDE
81 {
83 }
84
86 {
87 if (!UpdateVictim())
88 return;
89
90 //always decrease BerserkTimer
91 if (BerserkTimer <= diff)
92 {
93 //if evocate, then break evocate
94 if (Evocating)
95 {
96 if (me->HasAura(SPELL_EVOCATION))
97 me->RemoveAurasDueToSpell(SPELL_EVOCATION);
98
99 Evocating = false;
100 }
101
102 //may not be correct SAY (generic hard enrage)
104
105 me->InterruptNonMeleeSpells(true);
107
108 //don't know if he's supposed to do summon/evocate after hard enrage (probably not)
109 Enraged = true;
110 } else BerserkTimer -= diff;
111
112 if (Evocating)
113 {
114 //not supposed to do anything while evocate
115 if (me->HasAura(SPELL_EVOCATION))
116 return;
117 else
118 Evocating = false;
119 }
120
121 if (!Enraged)
122 {
123 if (AddTimer <= diff)
124 {
125 //Summon Astral Flare
126 Creature* AstralFlare = DoSpawnCreature(17096, float(rand()%37), float(rand()%37), 0, 0, TempSummonType::TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
127 Unit* target = NULL;
129
130 if (AstralFlare && target)
131 {
132 AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false);
133 AstralFlare->AI()->AttackStart(target);
134 }
135
136 //Reduce Mana by 10% of max health
137 if (int32 mana = me->GetMaxPower(POWER_MANA))
138 {
139 mana /= 10;
140 me->ModifyPower(POWER_MANA, -mana);
141
142 //if this get's us below 10%, then we evocate (the 10th should be summoned now)
143 if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10)
144 {
146 me->InterruptNonMeleeSpells(false);
148 Evocating = true;
149 //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
150 return;
151 }
152 else
153 {
154 if ((std::rand() % 1) == 0)
155 {
157 }
158 }
159 }
160
161 AddTimer = 10000;
162 } else AddTimer -= diff;
163
164 if (!HealthAbovePct(15))
165 {
166 Enraged = true;
169 }
170 }
171
172 if (HatefulBoltTimer <= diff)
173 {
174 if (Enraged)
175 HatefulBoltTimer = 7000;
176 else
177 HatefulBoltTimer = 15000;
178
179 if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1))
180 DoCast(target, SPELL_HATEFUL_BOLT);
181 } else HatefulBoltTimer -= diff;
182
184 }
185 };
186};
187
189{
190 new boss_curator();
191}
std::int32_t int32
Definition Define.h:73
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ POWER_MANA
@ IMMUNITY_DAMAGE
@ SPELL_SCHOOL_MASK_ARCANE
@ SELECT_TARGET_TOPAGGRO
Definition UnitAI.h:24
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_ENRAGE
#define SAY_DEATH
#define SAY_AGGRO
#define SAY_KILL
Curator
@ SAY_DEATH
@ SPELL_ASTRAL_FLARE_PASSIVE
@ SPELL_ENRAGE
@ SAY_EVOCATE
@ SAY_AGGRO
@ SAY_KILL
@ SPELL_EVOCATION
@ SPELL_HATEFUL_BOLT
@ SAY_ENRAGE
@ SAY_SUMMON
@ SPELL_BERSERK
void AddSC_boss_curator()
#define SPELL_BERSERK
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureAI * AI() const
Definition Creature.h:483
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
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:16
Definition Unit.h:1367
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthAbovePct(uint32 pct) const
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, TempSummonType type, uint32 despawntime)
ScriptedAI(Creature *creature)
boss_curatorAI(Creature *creature)
void KilledUnit(Unit *) OVERRIDE
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE