Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_noth.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#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "naxxramas.h"
9
10enum Noth
11{
16
18
19 SPELL_CURSE_PLAGUEBRINGER = 29213, // 25-man: 54835
20 SPELL_CRIPPLE = 29212, // 25-man: 54814
22
23 NPC_WARRIOR = 16984,
24 NPC_CHAMPION = 16983,
26};
27
28#define SPELL_BLINK RAND(29208, 29209, 29210, 29211)
29
30// Teleport position of Noth on his balcony
31#define TELE_X 2631.370f
32#define TELE_Y -3529.680f
33#define TELE_Z 274.040f
34#define TELE_O 6.277f
35
36#define MAX_SUMMON_POS 5
37
38const float SummonPos[MAX_SUMMON_POS][4] =
39{
40 {2728.12f, -3544.43f, 261.91f, 6.04f},
41 {2729.05f, -3544.47f, 261.91f, 5.58f},
42 {2728.24f, -3465.08f, 264.20f, 3.56f},
43 {2704.11f, -3456.81f, 265.53f, 4.51f},
44 {2663.56f, -3464.43f, 262.66f, 5.20f},
45};
46
58
60{
61public:
62 boss_noth() : CreatureScript("boss_noth") { }
63
65 {
66 return new boss_nothAI(creature);
67 }
68
69 struct boss_nothAI : public BossAI
70 {
71 boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) { }
72
74
76 {
77 me->SetReactState(REACT_AGGRESSIVE);
79 _Reset();
80 }
81
82 void EnterCombat(Unit* /*who*/) OVERRIDE
83 {
86 balconyCount = 0;
88 }
89
91 {
92 me->SetReactState(REACT_AGGRESSIVE);
95 if (me->getThreatManager().isThreatListEmpty())
97 else
98 {
99 events.ScheduleEvent(EVENT_BALCONY, 110000);
100 events.ScheduleEvent(EVENT_CURSE, 10000+rand()%15000);
101 events.ScheduleEvent(EVENT_WARRIOR, 30000);
103 events.ScheduleEvent(EVENT_BLINK, std::rand() % 40000 + 20000);
104 }
105 }
106
107 void KilledUnit(Unit* /*victim*/) OVERRIDE
108 {
109 if (!(rand()%5))
110 Talk(SAY_SLAY);
111 }
112
114 {
115 summons.Summon(summon);
116 summon->setActive(true);
117 summon->AI()->DoZoneInCombat();
118 }
119
120 void JustDied(Unit* /*killer*/) OVERRIDE
121 {
122 _JustDied();
124 }
125
126 void SummonUndead(uint32 entry, uint32 num)
127 {
128 for (uint32 i = 0; i < num; ++i)
129 {
130 uint32 pos = rand()%MAX_SUMMON_POS;
131 me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2],
133 }
134 }
135
137 {
138 if (!UpdateVictim() || !CheckInRoom())
139 return;
140
141 events.Update(diff);
142
143 while (uint32 eventId = events.ExecuteEvent())
144 {
145 switch (eventId)
146 {
147 case EVENT_CURSE:
149 events.ScheduleEvent(EVENT_CURSE, std::rand() % 60000 + 50000);
150 return;
151 case EVENT_WARRIOR:
154 events.ScheduleEvent(EVENT_WARRIOR, 30000);
155 return;
156 case EVENT_BLINK:
160 events.ScheduleEvent(EVENT_BLINK, 40000);
161 return;
162 case EVENT_BALCONY:
163 me->SetReactState(REACT_PASSIVE);
165 me->AttackStop();
166 me->RemoveAllAuras();
167 me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O);
168 events.Reset();
169 events.ScheduleEvent(EVENT_WAVE, std::rand() % 5000 + 2000);
170 waveCount = 0;
171 return;
172 case EVENT_WAVE:
174 switch (balconyCount)
175 {
176 case 0: SummonUndead(NPC_CHAMPION, RAID_MODE(2, 4)); break;
177 case 1: SummonUndead(NPC_CHAMPION, RAID_MODE(1, 2));
178 SummonUndead(NPC_GUARDIAN, RAID_MODE(1, 2)); break;
179 case 2: SummonUndead(NPC_GUARDIAN, RAID_MODE(2, 4)); break;
180 default:SummonUndead(NPC_CHAMPION, RAID_MODE(5, 10));
181 SummonUndead(NPC_GUARDIAN, RAID_MODE(5, 10));break;
182 }
183 ++waveCount;
184 events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, std::rand() % 45000 + 30000);
185 return;
186 case EVENT_GROUND:
187 {
188 ++balconyCount;
189 float x, y, z, o;
190 me->GetHomePosition(x, y, z, o);
191 me->NearTeleportTo(x, y, z, o);
192 events.ScheduleEvent(EVENT_BALCONY, 110000);
194 return;
195 }
196 }
197 }
198
199 if (me->HasReactState(REACT_AGGRESSIVE))
201 }
202 };
203};
204
206{
207 new boss_noth();
208}
@ DIFFICULTY_25MAN_NORMAL
Definition DBCEnums.h:335
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:72
@ REACT_PASSIVE
Definition Unit.h:1156
@ REACT_AGGRESSIVE
Definition Unit.h:1158
@ UNIT_FLAG_NOT_SELECTABLE
Definition Unit.h:650
@ UNIT_FIELD_FLAGS
@ SAY_SLAY
@ SPELL_CRIPPLE
#define SAY_DEATH
#define SAY_AGGRO
@ EVENT_NONE
#define TELE_Z
Definition boss_noth.cpp:33
#define TELE_Y
Definition boss_noth.cpp:32
#define TELE_X
Definition boss_noth.cpp:31
#define SPELL_BLINK
Definition boss_noth.cpp:28
#define MAX_SUMMON_POS
Definition boss_noth.cpp:36
#define TELE_O
Definition boss_noth.cpp:34
const float SummonPos[MAX_SUMMON_POS][4]
Definition boss_noth.cpp:38
void AddSC_boss_noth()
Noth
Definition boss_noth.cpp:11
@ SAY_DEATH
Definition boss_noth.cpp:15
@ NPC_GUARDIAN
Definition boss_noth.cpp:25
@ SAY_AGGRO
Definition boss_noth.cpp:12
@ NPC_CHAMPION
Definition boss_noth.cpp:24
@ SPELL_CRIPPLE
Definition boss_noth.cpp:20
@ SAY_SLAY
Definition boss_noth.cpp:14
@ SPELL_CURSE_PLAGUEBRINGER
Definition boss_noth.cpp:19
@ NPC_WARRIOR
Definition boss_noth.cpp:23
@ SAY_SUMMON
Definition boss_noth.cpp:13
@ EVENT_CURSE
Definition boss_noth.cpp:51
@ EVENT_BLINK
Definition boss_noth.cpp:52
@ EVENT_GROUND
Definition boss_noth.cpp:56
@ EVENT_WAVE
Definition boss_noth.cpp:55
@ EVENT_BALCONY
Definition boss_noth.cpp:54
@ EVENT_WARRIOR
Definition boss_noth.cpp:53
@ EVENT_BERSERK
@ NPC_WARRIOR
#define SOUND_DEATH
@ EVENT_BLINK
bool CheckInRoom()
SummonList summons
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition boss_noth.cpp:64
@ BOSS_NOTH
Definition naxxramas.h:16
DifficultyID GetDifficulty() const
Creature * me
const T & RAID_MODE(const T &normal10, const T &normal25) const
void JustSummoned(Creature *summon) OVERRIDE
void SummonUndead(uint32 entry, uint32 num)
void KilledUnit(Unit *) OVERRIDE
void EnterCombat(Unit *) OVERRIDE
Definition boss_noth.cpp:82
boss_nothAI(Creature *creature)
Definition boss_noth.cpp:71
void JustDied(Unit *) OVERRIDE
void Reset() OVERRIDE
Definition boss_noth.cpp:75
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================