Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_anzu.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6/*
7Name: Boss_Anzu
8%Complete: 80%
9Comment:
10Category: Auchindoun, Sethekk Halls
11*/
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "sethekk_halls.h"
16
22
31
39
41{
42 { -118.1717f, 284.5299f, 121.2287f, 2.775074f },
43 { -98.15528f, 293.4469f, 109.2385f, 0.174533f },
44 { -99.70160f, 270.1699f, 98.27389f, 6.178465f },
45 { -69.25543f, 303.0768f, 97.84479f, 5.532694f },
46 { -87.59662f, 263.5181f, 92.70478f, 1.658063f },
47 { -73.54323f, 276.6267f, 94.25807f, 2.802979f },
48 { -81.70527f, 280.8776f, 44.58830f, 0.526849f }
49};
50
52{
53public:
54 boss_anzu() : CreatureScript("boss_anzu") { }
55
56 struct boss_anzuAI : public BossAI
57 {
58 boss_anzuAI(Creature* creature) : BossAI(creature, DATA_ANZU)
59 {
60 _under33Percent = false;
61 _under66Percent = false;
62 }
63
65 {
66 //_Reset();
67 events.Reset();
68 _under33Percent = false;
69 _under66Percent = false;
70 }
71
72 void EnterCombat(Unit* /*who*/) OVERRIDE
73 {
75 events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 14000);
76 events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 5000);
77 }
78
79 void JustDied(Unit* /*killer*/) OVERRIDE
80 {
81 _JustDied();
82 }
83
84 void DamageTaken(Unit* /*killer*/, uint32& damage) OVERRIDE
85 {
86 if (me->HealthBelowPctDamaged(33, damage) && !_under33Percent)
87 {
88 _under33Percent = true;
90 events.ScheduleEvent(EVENT_SUMMON, 3000);
91 }
92
93 if (me->HealthBelowPctDamaged(66, damage) && !_under66Percent)
94 {
95 _under66Percent = true;
97 events.ScheduleEvent(EVENT_SUMMON, 3000);
98 }
99 }
100
102 {
103 if (!UpdateVictim())
104 return;
105
106 events.Update(diff);
107
108 while (uint32 eventId = events.ExecuteEvent())
109 {
110 switch (eventId)
111 {
113 {
115 events.ScheduleEvent(EVENT_PARALYZING_SCREECH, 26000);
116 break;
117 }
119 {
120 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
122 events.ScheduleEvent(EVENT_CYCLONE_OF_FEATHERS, 21000);
123 break;
124 }
125 case EVENT_SUMMON:
126 {
127 // TODO: Add pathing for Brood of Anzu
128 for (uint8 i = 0; i < 7; i++)
130
132 events.ScheduleEvent(EVENT_SPELL_BOMB, 12000);
133 break;
134 }
135 case EVENT_SPELL_BOMB:
136 {
137 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
138 {
139 if (target->getPowerType() == POWER_MANA)
140 {
141 DoCast(target, SPELL_SPELL_BOMB);
142 Talk(SAY_SPELL_BOMB, target);
143 }
144 }
145 break;
146 }
147 default:
148 break;
149
150 }
151 }
152
154 }
155
156 private:
159 };
160
162 {
163 return GetSethekkHallsAI<boss_anzuAI>(creature);
164 }
165};
166
168{
169 new boss_anzu();
170}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition Object.h:71
@ POWER_MANA
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SAY_SUMMON_BROOD
Definition boss_anzu.cpp:19
@ SAY_SPELL_BOMB
Definition boss_anzu.cpp:20
Position const PosSummonBrood[7]
Definition boss_anzu.cpp:40
@ SPELL_SPELL_BOMB
Definition boss_anzu.cpp:26
@ SPELL_BANISH_SELF
Definition boss_anzu.cpp:28
@ SPELL_FLESH_RIP
Definition boss_anzu.cpp:29
@ SPELL_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:27
@ SPELL_PARALYZING_SCREECH
Definition boss_anzu.cpp:25
void AddSC_boss_anzu()
@ EVENT_CYCLONE_OF_FEATHERS
Definition boss_anzu.cpp:36
@ EVENT_PARALYZING_SCREECH
Definition boss_anzu.cpp:34
@ EVENT_SPELL_BOMB
Definition boss_anzu.cpp:35
@ EVENT_SUMMON
Definition boss_anzu.cpp:37
@ EVENT_SUMMON
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AI * GetSethekkHallsAI(Creature *creature)
@ NPC_BROOD_OF_ANZU
@ DATA_ANZU
Creature * me
void EnterCombat(Unit *) OVERRIDE
Definition boss_anzu.cpp:72
void JustDied(Unit *) OVERRIDE
Definition boss_anzu.cpp:79
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_anzuAI(Creature *creature)
Definition boss_anzu.cpp:58
void Reset() OVERRIDE
Definition boss_anzu.cpp:64
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition boss_anzu.cpp:84