TrinityCore
Loading...
Searching...
No Matches
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#include "ScriptMgr.h"
19#include "Containers.h"
20#include "molten_core.h"
21#include "ScriptedCreature.h"
22
24{
25 // Sulfuron Harbringer
30 SPELL_THROW = 19785,
31
32 // Flamewaker Priest
36 SPELL_IMMOLATE = 20294
37};
38
54
55// 12098 - Sulfuron Harbinger
56struct boss_sulfuron : public BossAI
57{
59
70
71 void UpdateAI(uint32 diff) override
72 {
73 if (!UpdateVictim())
74 return;
75
76 events.Update(diff);
77
79 return;
80
81 while (uint32 eventId = events.ExecuteEvent())
82 {
83 switch (eventId)
84 {
87 events.Repeat(25s, 35s);
88 break;
89 case EVENT_INSPIRE:
90 {
91 std::list<Creature*> healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE);
92 if (!healers.empty())
94
95 events.Repeat(15s, 20s);
96 break;
97 }
100 events.Repeat(10s, 25s);
101 break;
104 DoCast(target, SPELL_FLAME_SPEAR);
105 events.Repeat(10s, 20s);
106 break;
107 case EVENT_THROW:
109 events.Repeat(2s);
110 break;
111 default:
112 break;
113 }
114
116 return;
117 }
118
120 }
121};
122
123// 11662 - Flamewaker Priest
125{
126 npc_flamewaker_priest(Creature* creature) : ScriptedAI(creature) { }
127
128 void Reset() override
129 {
130 _events.Reset();
131 }
132
140
141 void UpdateAI(uint32 diff) override
142 {
143 if (!UpdateVictim())
144 return;
145
146 _events.Update(diff);
147
149 return;
150
151 while (uint32 eventId = _events.ExecuteEvent())
152 {
153 switch (eventId)
154 {
156 if (Unit* target = DoSelectLowestHpFriendly(60.0f))
157 DoCast(target, SPELL_DARK_MENDING);
158 _events.Repeat(15s, 20s);
159 break;
161 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_SHADOW_WORD_PAIN))
163 _events.Repeat(3s, 10s);
164 break;
167 _events.Repeat(5s, 7s);
168 break;
169 case EVENT_IMMOLATE:
170 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_IMMOLATE))
171 DoCast(target, SPELL_IMMOLATE);
172 _events.Repeat(4s, 8s);
173 break;
174 default:
175 break;
176 }
177
179 return;
180 }
181
183 }
184
185private:
187};
188
uint32_t uint32
Definition Define.h:133
@ UNIT_STATE_CASTING
Definition Unit.h:235
void AddSC_boss_sulfuron()
@ EVENT_SHADOW_WORD_PAIN
@ EVENT_HAND_OF_RAGNAROS
@ EVENT_DEMORALIZING_SHOUT
@ SPELL_HAND_OF_RAGNAROS
@ SPELL_SHADOW_WORD_PAIN
@ SPELL_DEMORALIZING_SHOUT
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:63
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void Reset()
Definition EventMap.cpp:21
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:166
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
#define RegisterMoltenCoreCreatureAI(ai_name)
@ 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:108
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 *who) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
npc_flamewaker_priest(Creature *creature)