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
72 void Reset() override
73 {
74 _Reset();
76 {
77 me->SetUninteractible(false);
78 me->SetImmuneToPC(false);
79 }
80 }
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 }
166};
167
168// 39814 - Onyx Flamecaller
170{
171 npc_onyx_flamecaller(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _lavaGoutCount(0) { }
172
173 void Reset() override
174 {
175 _events.Reset();
176 _lavaGoutCount = 0;
179 }
180
181 void JustEngagedWith(Unit* /*who*/) override
182 {
185 }
186
187 void EnterEvadeMode(EvadeReason /*why*/) override { }
188
189 void IsSummonedBy(WorldObject* /*summoner*/) override
190 {
191 // Let Zarithrian count as summoner.
193 zarithrian->AI()->JustSummoned(me);
194 }
195
196 void MovementInform(uint32 type, uint32 pointId) override
197 {
198 if (type != SPLINE_CHAIN_MOTION_TYPE && pointId != POINT_GENERAL_ROOM)
199 return;
200
202 }
203
211
212 void UpdateAI(uint32 diff) override
213 {
214 if (!UpdateVictim())
215 return;
216
218 return;
219
220 _events.Update(diff);
221
222 while (uint32 eventId = _events.ExecuteEvent())
223 {
224 switch (eventId)
225 {
226 case EVENT_BLAST_NOVA:
228 _events.Repeat(15s, 20s);
229 break;
230 case EVENT_LAVA_GOUT:
231 if (_lavaGoutCount >= 3)
232 {
233 _lavaGoutCount = 0;
234 _events.Repeat(8s);
235 break;
236 }
239 _events.Repeat(1s);
240 break;
241 default:
242 break;
243 }
244 }
245 }
246
247private:
251};
252
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ DONE
@ SPLINE_CHAIN_MOTION_TYPE
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
EvadeReason
@ REACT_DEFENSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:290
@ SPELL_SUMMON_FLAMECALLER
@ SPELL_INTIMIDATING_ROAR
void AddSC_boss_general_zarithrian()
@ EVENT_INTIDMDATING_ROAR
TypeID GetTypeId() const
Definition BaseEntity.h:166
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()
Definition CreatureAI.h:169
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
void SetImmuneToPC(bool apply) override
Definition Creature.h:190
void SetReactState(ReactStates st)
Definition Creature.h:180
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
Creature * GetCreature(uint32 type)
virtual ObjectGuid GetGuidData(uint32 type) const override
EncounterState GetBossState(uint32 id) const
void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk)
void Summon(Creature const *summon)
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.cpp:172
SpellCastResult DoCastAOE(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:162
Definition Unit.h:647
MotionMaster * GetMotionMaster()
Definition Unit.h:1750
void SetUninteractible(bool apply)
Definition Unit.cpp:8583
bool HasUnitState(const uint32 f) const
Definition Unit.h:755
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
constexpr float GetPositionY() const
Definition Position.h:88
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