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/*
19Name: Boss_Anzu
20%Complete: 80%
21Comment:
22Category: Auchindoun, Sethekk Halls
23*/
24
25#include "ScriptMgr.h"
26#include "ScriptedCreature.h"
27#include "sethekk_halls.h"
28
34
43
51
53{
54 { -118.1717f, 284.5299f, 121.2287f, 2.775074f },
55 { -98.15528f, 293.4469f, 109.2385f, 0.174533f },
56 { -99.70160f, 270.1699f, 98.27389f, 6.178465f },
57 { -69.25543f, 303.0768f, 97.84479f, 5.532694f },
58 { -87.59662f, 263.5181f, 92.70478f, 1.658063f },
59 { -73.54323f, 276.6267f, 94.25807f, 2.802979f },
60 { -81.70527f, 280.8776f, 44.58830f, 0.526849f }
61};
62
63struct boss_anzu : public BossAI
64{
65 boss_anzu(Creature* creature) : BossAI(creature, DATA_ANZU)
66 {
67 Initialize();
68 }
69
71 {
72 _under33Percent = false;
73 _under66Percent = false;
74 }
75
76 void Reset() override
77 {
78 //_Reset();
79 events.Reset();
80 Initialize();
81 }
82
89
90 void JustDied(Unit* /*killer*/) override
91 {
92 _JustDied();
93 }
94
95 void DamageTaken(Unit* /*killer*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
96 {
97 if (me->HealthBelowPctDamaged(33, damage) && !_under33Percent)
98 {
99 _under33Percent = true;
102 }
103
104 if (me->HealthBelowPctDamaged(66, damage) && !_under66Percent)
105 {
106 _under66Percent = true;
109 }
110 }
111
112 void UpdateAI(uint32 diff) override
113 {
114 if (!UpdateVictim())
115 return;
116
117 events.Update(diff);
118
119 while (uint32 eventId = events.ExecuteEvent())
120 {
121 switch (eventId)
122 {
126 break;
131 break;
132 case EVENT_SUMMON:
133 // TODO: Add pathing for Brood of Anzu
134 for (uint8 i = 0; i < 7; i++)
136
139 break;
140 case EVENT_SPELL_BOMB:
142 {
143 if (target->GetPowerType() == POWER_MANA)
144 {
145 DoCast(target, SPELL_SPELL_BOMB);
146 Talk(SAY_SPELL_BOMB, target);
147 }
148 }
149 break;
150 default:
151 break;
152 }
153 }
154 }
155
156 private:
159};
160
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Spells
Definition PlayerAI.cpp:32
@ POWER_MANA
DamageEffectType
@ SAY_SUMMON_BROOD
Definition boss_anzu.cpp:31
@ SAY_SPELL_BOMB
Definition boss_anzu.cpp:32
Position const PosSummonBrood[7]
Definition boss_anzu.cpp:52
@ SPELL_SPELL_BOMB
Definition boss_anzu.cpp:38
@ SPELL_BANISH_SELF
Definition boss_anzu.cpp:40
@ SPELL_FLESH_RIP
Definition boss_anzu.cpp:41
@ SPELL_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:39
@ SPELL_PARALYZING_SCREECH
Definition boss_anzu.cpp:37
void AddSC_boss_anzu()
@ EVENT_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:48
@ EVENT_PARALYZING_SCREECH
Definition boss_anzu.cpp:46
@ EVENT_SPELL_BOMB
Definition boss_anzu.cpp:47
@ EVENT_SUMMON
Definition boss_anzu.cpp:49
void JustEngagedWith(Unit *who) override
EventMap events
bool UpdateVictim()
Creature *const me
Definition CreatureAI.h:63
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void Reset()
Definition EventMap.cpp:25
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:635
bool HealthBelowPctDamaged(float pct, uint32 damage) const
Definition Unit.h:793
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:1398
@ DATA_ANZU
#define RegisterSethekkHallsCreatureAI(ai_name)
@ NPC_BROOD_OF_ANZU
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *who) override
Definition boss_anzu.cpp:83
void Initialize()
Definition boss_anzu.cpp:70
void DamageTaken(Unit *, uint32 &damage, DamageEffectType, SpellInfo const *) override
Definition boss_anzu.cpp:95
void Reset() override
Definition boss_anzu.cpp:76
void JustDied(Unit *) override
Definition boss_anzu.cpp:90
bool _under33Percent
boss_anzu(Creature *creature)
Definition boss_anzu.cpp:65
bool _under66Percent