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 }
119};
120
121// 11662 - Flamewaker Priest
123{
124 npc_flamewaker_priest(Creature* creature) : ScriptedAI(creature) { }
125
126 void Reset() override
127 {
128 _events.Reset();
129 }
130
138
139 void UpdateAI(uint32 diff) override
140 {
141 if (!UpdateVictim())
142 return;
143
144 _events.Update(diff);
145
147 return;
148
149 while (uint32 eventId = _events.ExecuteEvent())
150 {
151 switch (eventId)
152 {
154 if (Unit* target = DoSelectLowestHpFriendly(60.0f))
155 DoCast(target, SPELL_DARK_MENDING);
156 _events.Repeat(15s, 20s);
157 break;
159 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_SHADOW_WORD_PAIN))
161 _events.Repeat(3s, 10s);
162 break;
165 _events.Repeat(5s, 7s);
166 break;
167 case EVENT_IMMOLATE:
168 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, true, -SPELL_IMMOLATE))
169 DoCast(target, SPELL_IMMOLATE);
170 _events.Repeat(4s, 8s);
171 break;
172 default:
173 break;
174 }
175
177 return;
178 }
179 }
180
181private:
183};
184
uint32_t uint32
Definition Define.h:154
@ UNIT_STATE_CASTING
Definition Unit.h:290
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:63
void Update(uint32 time)
Definition EventMap.h:77
void Repeat(Milliseconds time)
Definition EventMap.cpp:67
EventId ExecuteEvent()
Definition EventMap.cpp:77
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:71
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:81
Definition Unit.h:647
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
#define RegisterMoltenCoreCreatureAI(ai_name)
@ BOSS_SULFURON_HARBINGER
Definition molten_core.h:36
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
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)