TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
boss_rezan.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 "AreaTrigger.h"
19#include "AreaTriggerAI.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "ScriptMgr.h"
23#include "ScriptedCreature.h"
24#include "SpellAuraEffects.h"
25#include "SpellScript.h"
26#include "atal_dazar.h"
27
29{
33 SPELL_DEVOUR = 255421,
36 SPELL_PURSUIT = 257407,
43};
44
46{
51};
52
54{
58 SAY_PURSUIT = 3
59};
60
62{
63 { -814.344f, 2241.63f, 641.538f },
64 { -868.391f, 2245.54f, 642.03f },
65 { -887.726f, 2242.22f, 642.04f },
66 { -846.66f, 2247.46f, 641.774f },
67 { -902.443f, 2238.86f, 642.331f },
68 { -829.602f, 2247.23f, 641.842f },
69 { -793.8f, 2239.09f, 641.832f },
70 { -859.222f, 2256.25f, 643.136f },
71 { -871.375f, 2258.77f, 643.438f },
72 { -804.901f, 2254.52f, 641.964f },
73 { -884.057f, 2257.15f, 642.643f },
74 { -818.212f, 2259.57f, 642.465f },
75 { -830.214f, 2265.17f, 642.486f },
76 { -897.104f, 2259.22f, 641.901f },
77 { -874.649f, 2273.9f, 642.642f },
78 { -809.342f, 2272.22f, 641.905f },
79 { -821.203f, 2279.28f, 642.488f },
80 { -893.123f, 2276.57f, 642.583f },
81 { -848.333f, 2288.46f, 642.486f },
82 { -797.328f, 2282.58f, 641.182f },
83 { -900.995f, 2285.5f, 641.773f },
84 { -804.385f, 2293.2f, 641.488f },
85 { -895.255f, 2298.0f, 642.486f },
86 { -880.141f, 2301.81f, 642.501f },
87 { -826.514f, 2306.46f, 642.699f },
88 { -871.58f, 2311.03f, 642.487f },
89 { -803.264f, 2310.29f, 641.707f },
90 { -817.41f, 2313.88f, 641.638f },
91 { -889.821f, 2315.4f, 642.486f },
92 { -834.929f, 2321.18f, 643.028f },
93 { -861.599f, 2322.33f, 642.5f },
94 { -872.771f, 2324.00f, 642.77f },
95 { -825.752f, 2329.17f, 642.247f },
96 { -810.163f, 2327.19f, 641.401f },
97 { -884.835f, 2331.72f, 642.487f },
98 { -843.49f, 2335.39f, 642.765f },
99 { -895.611f, 2334.97f, 642.425f },
100 { -874.451f, 2340.77f, 643.405f },
101 { -817.785f, 2342.43f, 641.914f },
102 { -861.078f, 2344.69f, 642.685f },
103 { -838.155f, 2345.16f, 642.733f },
104 { -869.793f, 2352.61f, 642.515f }
105};
106
107// 122963 - Rezan
108struct boss_rezan : public BossAI
109{
110 boss_rezan(Creature* creature) : BossAI(creature, DATA_REZAN) { }
111
112 void JustAppeared() override
113 {
114 for (Position const& spawnPoint : PilesOfBonesPosition)
115 {
118 }
119 }
120
121 void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
122 {
123 if (apply && who->ToPlayer())
125 }
126
127 void EnterEvadeMode(EvadeReason /*why*/) override
128 {
131
134 }
135
136 void JustEngagedWith(Unit* who) override
137 {
140
145 }
146
147 void JustDied(Unit* /*killer*/) override
148 {
149 _JustDied();
151 }
152
153 void ExecuteEvent(uint32 eventId) override
154 {
155 switch (eventId)
156 {
158 {
161 events.Repeat(35500ms);
162 break;
163 }
164 case EVENT_TAIL:
165 {
167 events.Repeat(15800ms, 18200ms);
168 break;
169 }
171 {
173 events.Repeat(34100ms);
174 break;
175 }
176 case EVENT_PURSUIT:
177 {
179 {
182 }
183 events.Repeat(35200ms);
184 break;
185 }
186 default:
187 break;
188 }
189 }
190};
191
192// 255372 - Tail
194{
195 bool Validate(SpellInfo const* /*spellInfo*/) override
196 {
198 }
199
200 void HandleHitTarget(SpellEffIndex /*effIndex*/) const
201 {
204 .TriggeringSpell = GetSpell()
205 });
206 }
207
208 void Register() override
209 {
211 }
212};
213
214// 255421 - Devour
216{
217 bool Validate(SpellInfo const* /*spellInfo*/) override
218 {
220 }
221
222 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
223 {
224 if (Unit* caster = GetCaster())
225 caster->RemoveAura(SPELL_RIDE_VEHICLE);
226 }
227
228 void Register() override
229 {
231 }
232};
233
234// 257407 - Pursuit
236{
237 bool Validate(SpellInfo const* /*spellInfo*/) override
238 {
240 }
241
242 void HandlePeriodic(AuraEffect const* aurEff) const
243 {
244 if (Unit* caster = GetCaster())
247 .TriggeringAura = aurEff
248 });
249 }
250
251 void Register() override
252 {
254 }
255};
256
257// 255600 - Boss Emote Passed Points 0 @ Target
259{
260 void HandleHitTarget(SpellEffIndex /*effIndex*/) const
261 {
262 if (Creature* casterCreature = GetCaster()->ToCreature())
263 casterCreature->AI()->Talk(SAY_PURSUIT, GetHitUnit());
264 }
265
266 void Register() override
267 {
269 }
270};
271
272// 257483 - Pile of Bones
274{
275 void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude) const
276 {
277 isPeriodic = true;
278 amplitude = GetDuration();
279 }
280
281 void OnUpdate(AuraEffect* /*aurEff*/)
282 {
283 if (!ModStackAmount(-1))
285 }
286
287 void Register() override
288 {
291 }
292};
293
294// 255371 - Terrifying Visage
296{
297 void FilterTargets(std::list<WorldObject*>& targets) const
298 {
299 targets.remove_if([this](WorldObject* target) -> bool
300 {
301 return !GetCaster()->IsWithinLOSInMap(target);
302 });
303 }
304
305 void Register() override
306 {
308 }
309};
310
311// 256608 - Pile of Bones
313{
315
316 void OnUnitEnter(Unit* unit) override
317 {
318 InstanceScript* instance = at->GetInstanceScript();
319 if (!instance)
320 return;
321
322 Creature* rezan = instance->GetCreature(DATA_REZAN);
323 if (!rezan || !rezan->IsInCombat())
324 return;
325
326 if (unit == rezan && !rezan->GetMap()->IsHeroicOrHigher())
327 return;
328
329 if (!unit->IsPlayer() && unit != rezan)
330 return;
331
334 rezan->AI()->Talk(SAY_REANIMATED_RAPTOR_SUMMONER, unit);
335 at->Remove();
336 }
337};
338
339// 256606 - Pile of Bones
341{
343
344 void OnUnitEnter(Unit* unit) override
345 {
346 InstanceScript* instance = at->GetInstanceScript();
347 if (!instance)
348 return;
349
350 Creature* rezan = instance->GetCreature(DATA_REZAN);
351 if (!rezan || !rezan->IsInCombat())
352 return;
353
354 if (!unit->IsPlayer())
355 return;
356
357 if (unit->GetMap()->IsHeroicOrHigher())
358 {
361 unit->CastSpell(unit, SPELL_PILE_OF_BONES_SLOW, args);
362 }
363 else
365
366 at->Remove();
367 }
368};
369
371{
373
380
383}
int8_t int8
Definition: Define.h:146
int32_t int32
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:148
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
#define RegisterAreaTriggerAI(ai_name)
Definition: ScriptMgr.h:1409
#define RegisterSpellScript(spell_script)
Definition: ScriptMgr.h:1364
SpellEffIndex
Definition: SharedDefines.h:29
@ EFFECT_1
Definition: SharedDefines.h:31
@ EFFECT_0
Definition: SharedDefines.h:30
@ TARGET_UNIT_SRC_AREA_ENEMY
@ SPELL_EFFECT_DUMMY
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELLVALUE_AURA_STACK
Definition: SpellDefines.h:235
@ TRIGGERED_IGNORE_CAST_IN_PROGRESS
Will not check if a current cast is in progress.
Definition: SpellDefines.h:263
@ TRIGGERED_DONT_REPORT_CAST_ERROR
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:276
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:896
#define SpellObjectAreaTargetSelectFn(F, I, N)
Definition: SpellScript.h:918
#define AuraEffectPeriodicFn(F, I, N)
Definition: SpellScript.h:2171
#define AuraEffectUpdatePeriodicFn(F, I, N)
Definition: SpellScript.h:2177
#define AuraEffectCalcPeriodicFn(F, I, N)
Definition: SpellScript.h:2189
#define AuraEffectRemoveFn(F, I, N, M)
Definition: SpellScript.h:2165
EvadeReason
Definition: UnitAICommon.h:30
@ DATA_REZAN
Definition: atal_dazar.h:33
#define RegisterAtalDazarCreatureAI(ai_name)
Definition: atal_dazar.h:60
void AddSC_boss_rezan()
Definition: boss_rezan.cpp:370
RezanTexts
Definition: boss_rezan.cpp:54
@ SAY_PURSUIT
Definition: boss_rezan.cpp:58
@ SAY_TERRIFYING_VISAGE
Definition: boss_rezan.cpp:57
@ SAY_REANIMATED_RAPTOR_SUMMONER
Definition: boss_rezan.cpp:56
@ SAY_REANIMATED_RAPTOR_WARNING
Definition: boss_rezan.cpp:55
RezanSpells
Definition: boss_rezan.cpp:29
@ SPELL_TAIL_DAMAGE
Definition: boss_rezan.cpp:31
@ SPELL_PILE_OF_BONES_TRIGGER_SPAWN
Definition: boss_rezan.cpp:40
@ SPELL_PURSUIT
Definition: boss_rezan.cpp:36
@ SPELL_REVERSE_CAST_RIDE_VEHICLE
Definition: boss_rezan.cpp:35
@ SPELL_PILE_OF_BONES_AT_SPAWN
Definition: boss_rezan.cpp:38
@ SPELL_SERRATED_TEETH
Definition: boss_rezan.cpp:32
@ SPELL_DEVOUR
Definition: boss_rezan.cpp:33
@ SPELL_RIDE_VEHICLE
Definition: boss_rezan.cpp:37
@ SPELL_PILE_OF_BONES_AT_SLOW
Definition: boss_rezan.cpp:39
@ SPELL_TAIL_SELECTOR
Definition: boss_rezan.cpp:30
@ SPELL_BOSS_EMOTE_AT_TARGET
Definition: boss_rezan.cpp:42
@ SPELL_PILE_OF_BONES_SLOW
Definition: boss_rezan.cpp:41
@ SPELL_TERRIFYING_VISAGE
Definition: boss_rezan.cpp:34
RezanEvents
Definition: boss_rezan.cpp:46
@ EVENT_TERRIFYING_VISAGE
Definition: boss_rezan.cpp:47
@ EVENT_PURSUIT
Definition: boss_rezan.cpp:50
@ EVENT_TAIL
Definition: boss_rezan.cpp:48
@ EVENT_SERRATED_TEETH
Definition: boss_rezan.cpp:49
constexpr Position PilesOfBonesPosition[]
Definition: boss_rezan.cpp:62
AreaTrigger *const at
Definition: AreaTriggerAI.h:33
HookList< EffectCalcPeriodicHandler > DoEffectCalcPeriodic
Definition: SpellScript.h:2188
int32 GetDuration() const
HookList< EffectApplyHandler > AfterEffectRemove
Definition: SpellScript.h:2164
HookList< EffectPeriodicHandler > OnEffectPeriodic
Definition: SpellScript.h:2170
Unit * GetCaster() const
HookList< EffectUpdatePeriodicHandler > OnEffectUpdatePeriodic
Definition: SpellScript.h:2176
Unit * GetTarget() const
void RefreshDuration()
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
InstanceScript *const instance
void JustEngagedWith(Unit *who) override
void _DespawnAtEvade(Seconds delayToRespawn=30s, Creature *who=nullptr)
SummonList summons
EventMap events
void _JustDied()
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:56
bool _EnterEvadeMode(EvadeReason why=EvadeReason::Other)
Definition: CreatureAI.cpp:298
Creature *const me
Definition: CreatureAI.h:61
CreatureAI * AI() const
Definition: Creature.h:228
void Repeat(Milliseconds time)
Definition: EventMap.cpp:67
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:40
Creature * GetCreature(uint32 type)
void SendEncounterUnit(EncounterFrameType type, Unit const *unit, Optional< int32 > param1={}, Optional< int32 > param2={})
bool IsHeroicOrHigher() const
Definition: Map.cpp:3296
bool IsPlayer() const
Definition: Object.h:248
static Player * ToPlayer(Object *o)
Definition: Object.h:249
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition: SpellScript.h:170
Unit * GetCaster() const
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Definition: SpellScript.h:894
Spell * GetSpell() const
Definition: SpellScript.h:1053
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Definition: SpellScript.h:917
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.h:160
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:180
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:79
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:89
Definition: Unit.h:632
bool IsInCombat() const
Definition: Unit.h:1054
Map * GetMap() const
Definition: Object.h:773
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1103
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2990
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
Definition: Object.cpp:1242
void HandleHitTarget(SpellEffIndex) const
Definition: boss_rezan.cpp:260
bool Validate(SpellInfo const *) override
Definition: boss_rezan.cpp:217
void OnRemove(AuraEffect const *, AuraEffectHandleModes) const
Definition: boss_rezan.cpp:222
void Register() override
Definition: boss_rezan.cpp:228
void CalcPeriodic(AuraEffect const *, bool &isPeriodic, int32 &amplitude) const
Definition: boss_rezan.cpp:275
void OnUpdate(AuraEffect *)
Definition: boss_rezan.cpp:281
void HandlePeriodic(AuraEffect const *aurEff) const
Definition: boss_rezan.cpp:242
bool Validate(SpellInfo const *) override
Definition: boss_rezan.cpp:237
void Register() override
Definition: boss_rezan.cpp:251
void Register() override
Definition: boss_rezan.cpp:208
bool Validate(SpellInfo const *) override
Definition: boss_rezan.cpp:195
void HandleHitTarget(SpellEffIndex) const
Definition: boss_rezan.cpp:200
void FilterTargets(std::list< WorldObject * > &targets) const
Definition: boss_rezan.cpp:297
void apply(T *val)
Definition: ByteConverter.h:41
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:465
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
Definition: SpellDefines.h:519
constexpr void GetPosition(float &x, float &y) const
Definition: Position.h:91
void OnUnitEnter(Unit *unit) override
Definition: boss_rezan.cpp:344
at_rezan_pile_of_bones_slow(AreaTrigger *areatrigger)
Definition: boss_rezan.cpp:342
at_rezan_pile_of_bones_spawn_raptor(AreaTrigger *areatrigger)
Definition: boss_rezan.cpp:314
void OnUnitEnter(Unit *unit) override
Definition: boss_rezan.cpp:316
void JustAppeared() override
Definition: boss_rezan.cpp:112
void JustDied(Unit *) override
Definition: boss_rezan.cpp:147
void JustEngagedWith(Unit *who) override
Definition: boss_rezan.cpp:136
void ExecuteEvent(uint32 eventId) override
Definition: boss_rezan.cpp:153
void EnterEvadeMode(EvadeReason) override
Definition: boss_rezan.cpp:127
boss_rezan(Creature *creature)
Definition: boss_rezan.cpp:110
void PassengerBoarded(Unit *who, int8, bool apply) override
== Fields =======================================
Definition: boss_rezan.cpp:121