TrinityCore
Loading...
Searching...
No Matches
boss_anzu.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/*
19 * Pathing for Brood of Anzu is NYI (try to remove extra flag to ignore pathfinding when paths will be implemented)
20 * Birds-helpers are NYI
21 */
22
23#include "ScriptMgr.h"
24#include "ScriptedCreature.h"
25#include "sethekk_halls.h"
26
34
44
57
64
66{
67 NPC_BROOD_OF_ANZU = 23132
68};
69
70static Position const PosSummonBrood[] =
71{
72 { -118.1717f, 284.5299f, 121.2287f, 2.775074f },
73 { -98.15528f, 293.4469f, 109.2385f, 0.174533f },
74 { -99.70160f, 270.1699f, 98.27389f, 6.178465f },
75 { -69.25543f, 303.0768f, 97.84479f, 5.532694f },
76 { -87.59662f, 263.5181f, 92.70478f, 1.658063f },
77 { -73.54323f, 276.6267f, 94.25807f, 2.802979f },
78 { -81.70527f, 280.8776f, 44.58830f, 0.526849f }
79};
80
81// 23035 - Anzu
82struct boss_anzu : public BossAI
83{
85
86 void JustAppeared() override
87 {
89 }
90
91 void Reset() override
92 {
93 _Reset();
97 }
98
106
107 void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
108 {
109 if (_phase < PHASE_HEALTH_66 && me->HealthBelowPctDamaged(66, damage))
110 {
111 _phase++;
113 }
114
115 if (_phase < PHASE_HEALTH_33 && me->HealthBelowPctDamaged(33, damage))
116 {
117 _phase++;
119 }
120 }
121
122 void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/) override
123 {
125
126 if (_deadBroodCount == std::size(PosSummonBrood))
127 {
129 _deadBroodCount = 0;
130 }
131 }
132
133 void UpdateAI(uint32 diff) override
134 {
135 if (!UpdateVictim())
136 {
137 events.Update(diff);
138
139 while (uint32 eventId = events.ExecuteEvent())
140 {
141 switch (eventId)
142 {
143 case EVENT_INTRO_1:
147 break;
148 case EVENT_INTRO_2:
151 break;
152 case EVENT_INTRO_3:
154 me->SetImmuneToAll(false);
155 break;
156 default:
157 break;
158 }
159 }
160 return;
161 }
162
163 events.Update(diff);
164
166 return;
167
168 while (uint32 eventId = events.ExecuteEvent())
169 {
170 switch (eventId)
171 {
174 events.Repeat(25s, 35s);
175 break;
176 case EVENT_SPELL_BOMB:
178 {
179 if (target->GetPowerType() == POWER_MANA)
180 {
181 DoCast(target, SPELL_SPELL_BOMB);
182 Talk(SAY_BOMB, target);
183 }
184 }
185 events.Repeat(20s, 30s);
186 break;
190 events.Repeat(20s, 25s);
191 break;
192 case EVENT_SUMMON_1:
195
196 _deadBroodCount = 0;
197 for (Position const& summonPos : PosSummonBrood)
199
201 break;
202 case EVENT_SUMMON_2:
205 break;
206 default:
207 break;
208 }
209
211 return;
212 }
213
215 }
216
217private:
220};
221
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
@ POWER_MANA
@ REACT_PASSIVE
@ REACT_AGGRESSIVE
@ UNIT_STATE_CASTING
Definition Unit.h:235
DamageEffectType
Definition Unit.h:352
AnzuPhases
Definition boss_anzu.cpp:59
@ PHASE_NONE
Definition boss_anzu.cpp:60
@ PHASE_HEALTH_66
Definition boss_anzu.cpp:61
@ PHASE_HEALTH_33
Definition boss_anzu.cpp:62
AnzuEvents
Definition boss_anzu.cpp:46
@ EVENT_INTRO_1
Definition boss_anzu.cpp:53
@ EVENT_INTRO_2
Definition boss_anzu.cpp:54
@ EVENT_SUMMON_2
Definition boss_anzu.cpp:51
@ EVENT_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:49
@ EVENT_PARALYZING_SCREECH
Definition boss_anzu.cpp:47
@ EVENT_SPELL_BOMB
Definition boss_anzu.cpp:48
@ EVENT_SUMMON_1
Definition boss_anzu.cpp:50
@ EVENT_INTRO_3
Definition boss_anzu.cpp:55
static Position const PosSummonBrood[]
Definition boss_anzu.cpp:70
AnzuTexts
Definition boss_anzu.cpp:28
@ SAY_INTRO_2
Definition boss_anzu.cpp:30
@ SAY_INTRO_1
Definition boss_anzu.cpp:29
@ SAY_BOMB
Definition boss_anzu.cpp:32
@ SAY_SUMMON
Definition boss_anzu.cpp:31
AnzuMisc
Definition boss_anzu.cpp:66
@ NPC_BROOD_OF_ANZU
Definition boss_anzu.cpp:67
void AddSC_boss_anzu()
AnzuSpells
Definition boss_anzu.cpp:36
@ SPELL_SPELL_BOMB
Definition boss_anzu.cpp:40
@ SPELL_SHADOWFORM
Definition boss_anzu.cpp:37
@ SPELL_BANISH_SELF
Definition boss_anzu.cpp:42
@ SPELL_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:41
@ SPELL_PARALYZING_SCREECH
Definition boss_anzu.cpp:39
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:82
void SetReactState(ReactStates st)
Definition Creature.h:119
void SetImmuneToAll(bool apply) override
Definition Creature.h:126
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 DoMeleeAttackIfReady()
Definition UnitAI.cpp:54
SpellCastResult DoCastSelf(uint32 spellId, CastSpellExtraArgs const &args={})
Definition UnitAI.h:241
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:96
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:106
Definition Unit.h:769
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
bool HasUnitState(const uint32 f) const
Definition Unit.h:876
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1992
@ DATA_ANZU
#define RegisterSethekkHallsCreatureAI(ai_name)
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
Definition boss_anzu.cpp:99
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
void Reset() override
Definition boss_anzu.cpp:91
void SummonedCreatureDies(Creature *, Unit *) override
void JustAppeared() override
Definition boss_anzu.cpp:86
uint8 _deadBroodCount
boss_anzu(Creature *creature)
Definition boss_anzu.cpp:84
uint8 _phase