TrinityCore
boss_general_zarithrian.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 "InstanceScript.h"
20#include "MotionMaster.h"
21#include "ObjectAccessor.h"
22#include "ruby_sanctum.h"
23#include "ScriptedCreature.h"
24
26{
27 SAY_AGGRO = 0, // Alexstrasza has chosen capable allies.... A pity that I must END YOU!
28 SAY_KILL = 1, // You thought you stood a chance? - It's for the best.
29 SAY_ADDS = 2, // Turn them to ash, minions!
30 SAY_DEATH = 3, // HALION! I...
31};
32
34{
35 // General Zarithrian
38
39 // Zarithrian Spawn Stalker
41
42 // Onyx Flamecaller
44 SPELL_LAVA_GOUT = 74394
45};
46
48{
49 // General Zarithrian
54
55 // Onyx Flamecaller
58};
59
61{
65};
66
68{
70
71 void Reset() override
72 {
73 _Reset();
75 {
76 me->SetUninteractible(false);
77 me->SetImmuneToPC(false);
78 }
79 }
80
81 bool CanAIAttack(Unit const* target) const override
82 {
84 }
85
86 void JustEngagedWith(Unit* who) override
87 {
93 if (Is25ManRaid())
95 }
96
97 // Override to not set adds in combat yet.
98 void JustSummoned(Creature* summon) override
99 {
100 summons.Summon(summon);
101 }
102
103 void JustDied(Unit* /*killer*/) override
104 {
105 _JustDied();
107 }
108
109 void EnterEvadeMode(EvadeReason /*why*/) override
110 {
113 }
114
115 void KilledUnit(Unit* victim) override
116 {
117 if (victim->GetTypeId() == TYPEID_PLAYER)
118 Talk(SAY_KILL);
119 }
120
121 void UpdateAI(uint32 diff) override
122 {
123 if (!UpdateVictim())
124 return;
125
126 events.Update(diff);
127
129 return;
130
131 while (uint32 eventId = events.ExecuteEvent())
132 {
133 switch (eventId)
134 {
136 Talk(SAY_ADDS);
137 [[fallthrough]];
139 {
141 stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, true);
142
144 stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, true);
145
146 events.Repeat(Seconds(45));
147 break;
148 }
151 events.Repeat(Seconds(35), Seconds(40));
152 break;
153 case EVENT_CLEAVE:
156 break;
157 default:
158 break;
159 }
160
162 return;
163 }
164 }
165};
166
168{
169 npc_onyx_flamecaller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
170
171 void Reset() override
172 {
173 _events.Reset();
174 _lavaGoutCount = 0;
177 }
178
179 void JustEngagedWith(Unit* /*who*/) override
180 {
183 }
184
185 void EnterEvadeMode(EvadeReason /*why*/) override { }
186
187 void IsSummonedBy(WorldObject* /*summoner*/) override
188 {
189 // Let Zarithrian count as summoner.
191 zarithrian->AI()->JustSummoned(me);
192 }
193
194 void MovementInform(uint32 type, uint32 pointId) override
195 {
196 if (type != SPLINE_CHAIN_MOTION_TYPE && pointId != POINT_GENERAL_ROOM)
197 return;
198
200 }
201
203 {
204 if (me->GetPositionY() < 500.0f)
206 else
208 }
209
210 void UpdateAI(uint32 diff) override
211 {
212 if (!UpdateVictim())
213 return;
214
216 return;
217
218 _events.Update(diff);
219
220 while (uint32 eventId = _events.ExecuteEvent())
221 {
222 switch (eventId)
223 {
224 case EVENT_BLAST_NOVA:
226 _events.Repeat(Seconds(15), Seconds(20));
227 break;
228 case EVENT_LAVA_GOUT:
229 if (_lavaGoutCount >= 3)
230 {
231 _lavaGoutCount = 0;
233 break;
234 }
238 break;
239 default:
240 break;
241 }
242 }
243 }
244private:
248};
249
251{
254}
Texts
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
@ DONE
@ SPLINE_CHAIN_MOTION_TYPE
@ TYPEID_PLAYER
Definition: ObjectGuid.h:41
Spells
Definition: PlayerAI.cpp:32
EvadeReason
Definition: UnitAICommon.h:30
@ REACT_DEFENSIVE
Definition: UnitDefines.h:507
@ UNIT_STATE_CASTING
Definition: Unit.h:270
@ SPELL_CLEAVE_ARMOR
@ SPELL_SUMMON_FLAMECALLER
@ SPELL_INTIMIDATING_ROAR
void AddSC_boss_general_zarithrian()
@ EVENT_INTIDMDATING_ROAR
@ EVENT_SUMMON_ADDS2
@ POINT_GENERAL_ROOM
@ SPLINE_GENERAL_WEST
@ SPLINE_GENERAL_EAST
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
bool CanAIAttack(Unit const *target) const override
SummonList summons
EventMap events
void _JustDied()
void DoZoneInCombat()
Definition: CreatureAI.h:161
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool UpdateVictim()
Definition: CreatureAI.cpp:245
Creature *const me
Definition: CreatureAI.h:61
void SetImmuneToPC(bool apply) override
Definition: Creature.h:170
void SetReactState(ReactStates st)
Definition: Creature.h:160
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
void Repeat(Milliseconds time)
Definition: EventMap.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void Reset()
Definition: EventMap.cpp:21
Creature * GetCreature(uint32 type)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
TypeID GetTypeId() const
Definition: Object.h:173
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:159
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:161
Definition: Unit.h:627
MotionMaster * GetMotionMaster()
Definition: Unit.h:1652
void SetUninteractible(bool apply)
Definition: Unit.cpp:8147
bool HasUnitState(const uint32 f) const
Definition: Unit.h:732
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
#define RegisterRubySanctumCreatureAI(ai_name)
Definition: ruby_sanctum.h:138
@ DATA_GENERAL_ZARITHRIAN
Definition: ruby_sanctum.h:32
@ DATA_SAVIANA_RAGEFIRE
Definition: ruby_sanctum.h:33
@ DATA_ZARITHRIAN_SPAWN_STALKER_2
Definition: ruby_sanctum.h:42
@ DATA_ZARITHRIAN_SPAWN_STALKER_1
Definition: ruby_sanctum.h:41
@ DATA_BALTHARUS_THE_WARBORN
Definition: ruby_sanctum.h:31
constexpr float GetPositionY() const
Definition: Position.h:77
bool Is25ManRaid() const
bool CanAIAttack(Unit const *target) const override
void UpdateAI(uint32 diff) override
void JustSummoned(Creature *summon) override
void KilledUnit(Unit *victim) override
void EnterEvadeMode(EvadeReason) override
void JustEngagedWith(Unit *who) override
boss_general_zarithrian(Creature *creature)
void IsSummonedBy(WorldObject *) override
void UpdateAI(uint32 diff) override
void MovementInform(uint32 type, uint32 pointId) override
void EnterEvadeMode(EvadeReason) override
npc_onyx_flamecaller(Creature *creature)
void JustEngagedWith(Unit *) override