TrinityCore
Loading...
Searching...
No Matches
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
59
66
67// 39746 - General Zarithrian
69{
71
81
82 bool CanAIAttack(Unit const* target) const override
83 {
85 }
86
97
98 // Override to not set adds in combat yet.
99 void JustSummoned(Creature* summon) override
100 {
101 summons.Summon(summon);
102 }
103
104 void JustDied(Unit* /*killer*/) override
105 {
106 _JustDied();
108 }
109
110 void EnterEvadeMode(EvadeReason /*why*/) override
111 {
114 }
115
116 void KilledUnit(Unit* victim) override
117 {
118 if (victim->GetTypeId() == TYPEID_PLAYER)
119 Talk(SAY_KILL);
120 }
121
122 void UpdateAI(uint32 diff) override
123 {
124 if (!UpdateVictim())
125 return;
126
127 events.Update(diff);
128
130 return;
131
132 while (uint32 eventId = events.ExecuteEvent())
133 {
134 switch (eventId)
135 {
137 Talk(SAY_ADDS);
138 [[fallthrough]];
140 {
142 stalker1->CastSpell(stalker1, SPELL_SUMMON_FLAMECALLER, true);
143
145 stalker2->CastSpell(stalker2, SPELL_SUMMON_FLAMECALLER, true);
146
147 events.Repeat(45s);
148 break;
149 }
152 events.Repeat(35s, 40s);
153 break;
154 case EVENT_CLEAVE:
157 break;
158 default:
159 break;
160 }
161
163 return;
164 }
165
167 }
168};
169
170// 39814 - Onyx Flamecaller
172{
173 npc_onyx_flamecaller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
174
175 void Reset() override
176 {
177 _events.Reset();
178 _lavaGoutCount = 0;
181 }
182
183 void JustEngagedWith(Unit* /*who*/) override
184 {
187 }
188
189 void EnterEvadeMode(EvadeReason /*why*/) override { }
190
191 void IsSummonedBy(WorldObject* /*summoner*/) override
192 {
193 // Let Zarithrian count as summoner.
195 zarithrian->AI()->JustSummoned(me);
196 }
197
198 void MovementInform(uint32 type, uint32 pointId) override
199 {
200 if (type != SPLINE_CHAIN_MOTION_TYPE && pointId != POINT_GENERAL_ROOM)
201 return;
202
204 }
205
213
214 void UpdateAI(uint32 diff) override
215 {
216 if (!UpdateVictim())
217 return;
218
220 return;
221
222 _events.Update(diff);
223
224 while (uint32 eventId = _events.ExecuteEvent())
225 {
226 switch (eventId)
227 {
228 case EVENT_BLAST_NOVA:
230 _events.Repeat(15s, 20s);
231 break;
232 case EVENT_LAVA_GOUT:
233 if (_lavaGoutCount >= 3)
234 {
235 _lavaGoutCount = 0;
236 _events.Repeat(8s);
237 break;
238 }
241 _events.Repeat(1s);
242 break;
243 default:
244 break;
245 }
246 }
247
249 }
250
251private:
255};
256
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ DONE
@ SPLINE_CHAIN_MOTION_TYPE
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ REACT_DEFENSIVE
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_STATE_CASTING
Definition Unit.h:235
@ SPELL_SUMMON_FLAMECALLER
@ SPELL_INTIMIDATING_ROAR
void AddSC_boss_general_zarithrian()
@ EVENT_INTIDMDATING_ROAR
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 DoZoneInCombat(Creature *creature=nullptr)
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetImmuneToPC(bool apply) override
Definition Creature.h:129
void SetReactState(ReactStates st)
Definition Creature.h:119
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
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:93
void Summon(Creature const *summon)
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
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:243
Definition Unit.h:769
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:955
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
#define RegisterRubySanctumCreatureAI(ai_name)
@ DATA_GENERAL_ZARITHRIAN
@ DATA_SAVIANA_RAGEFIRE
@ DATA_ZARITHRIAN_SPAWN_STALKER_2
@ DATA_ZARITHRIAN_SPAWN_STALKER_1
@ DATA_BALTHARUS_THE_WARBORN
float GetPositionY() const
Definition Position.h:80
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