TrinityCore
boss_sulfuron_harbinger.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19SDName: Boss_Sulfuron_Harbringer
20SD%Complete: 80
21SDComment: Adds NYI
22SDCategory: Molten Core
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "Containers.h"
27#include "molten_core.h"
28#include "ScriptedCreature.h"
29
31{
32 // Sulfuron Harbringer
38
39 // Adds
40 SPELL_HEAL = 19775,
43};
44
46{
52
56};
57
58struct boss_sulfuron : public BossAI
59{
61 {
62 }
63
64 void JustEngagedWith(Unit* victim) override
65 {
72 }
73
74 void UpdateAI(uint32 diff) override
75 {
76 if (!UpdateVictim())
77 return;
78
79 events.Update(diff);
80
82 return;
83
84 while (uint32 eventId = events.ExecuteEvent())
85 {
86 switch (eventId)
87 {
91 break;
95 break;
96 case EVENT_INSPIRE:
97 {
98 std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE);
99 if (!healers.empty())
101
104 break;
105 }
106 case EVENT_KNOCKDOWN:
109 break;
110 case EVENT_FLAMESPEAR:
111 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
112 DoCast(target, SPELL_FLAMESPEAR);
114 break;
115 default:
116 break;
117 }
118
120 return;
121 }
122 }
123};
124
126{
128 {
129 }
130
131 void Reset() override
132 {
133 events.Reset();
134 }
135
136 void JustDied(Unit* /*killer*/) override
137 {
138 events.Reset();
139 }
140
141 void JustEngagedWith(Unit* victim) override
142 {
147 }
148
149 void UpdateAI(uint32 diff) override
150 {
151 if (!UpdateVictim())
152 return;
153
154 events.Update(diff);
155
157 return;
158
159 while (uint32 eventId = events.ExecuteEvent())
160 {
161 switch (eventId)
162 {
163 case EVENT_HEAL:
164 if (Unit* target = DoSelectLowestHpFriendly(60.0f, 1))
165 DoCast(target, SPELL_HEAL);
167 break;
169 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_SHADOWWORDPAIN))
172 break;
173 case EVENT_IMMOLATE:
174 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_IMMOLATE))
175 DoCast(target, SPELL_IMMOLATE);
177 break;
178 default:
179 break;
180 }
181
183 return;
184 }
185 }
186
187private:
189};
190
192{
195}
uint32_t uint32
Definition: Define.h:142
Spells
Definition: PlayerAI.cpp:32
@ UNIT_STATE_CASTING
Definition: Unit.h:270
void AddSC_boss_sulfuron()
@ SPELL_SHADOWWORDPAIN
@ SPELL_DEMORALIZING_SHOUT
@ EVENT_SHADOW_WORD_PAIN
@ EVENT_DEMORALIZING_SHOUT
void JustEngagedWith(Unit *who) override
EventMap events
virtual void JustEngagedWith(Unit *)
Definition: CreatureAI.h:99
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:627
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
#define RegisterMoltenCoreCreatureAI(ai_name)
Definition: molten_core.h:84
@ BOSS_SULFURON_HARBINGER
Definition: molten_core.h:36
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:109
Unit * DoSelectLowestHpFriendly(float range, uint32 minHPDiff=1)
std::list< Creature * > DoFindFriendlyMissingBuff(float range, uint32 spellId)
void UpdateAI(uint32 diff) override
boss_sulfuron(Creature *creature)
void JustEngagedWith(Unit *victim) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *victim) override
void JustDied(Unit *) override
npc_flamewaker_priest(Creature *creature)