Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
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
10
enum
Noth
11
{
12
SAY_AGGRO
= 0,
13
SAY_SUMMON
= 1,
14
SAY_SLAY
= 2,
15
SAY_DEATH
= 3,
16
17
SOUND_DEATH
= 8848,
18
19
SPELL_CURSE_PLAGUEBRINGER
= 29213,
// 25-man: 54835
20
SPELL_CRIPPLE
= 29212,
// 25-man: 54814
21
SPELL_TELEPORT
= 29216,
22
23
NPC_WARRIOR
= 16984,
24
NPC_CHAMPION
= 16983,
25
NPC_GUARDIAN
= 16981
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
38
const
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
47
enum
Events
48
{
49
EVENT_NONE
,
50
EVENT_BERSERK
,
51
EVENT_CURSE
,
52
EVENT_BLINK
,
53
EVENT_WARRIOR
,
54
EVENT_BALCONY
,
55
EVENT_WAVE
,
56
EVENT_GROUND
,
57
};
58
59
class
boss_noth
:
public
CreatureScript
60
{
61
public
:
62
boss_noth
() :
CreatureScript
(
"boss_noth"
) { }
63
64
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
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
73
uint32
waveCount
,
balconyCount
;
74
75
void
Reset
()
OVERRIDE
76
{
77
me
->SetReactState(
REACT_AGGRESSIVE
);
78
me
->RemoveFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
79
_Reset
();
80
}
81
82
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
83
{
84
_EnterCombat
();
85
Talk
(
SAY_AGGRO
);
86
balconyCount
= 0;
87
EnterPhaseGround
();
88
}
89
90
void
EnterPhaseGround
()
91
{
92
me
->SetReactState(
REACT_AGGRESSIVE
);
93
me
->RemoveFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
94
DoZoneInCombat
();
95
if
(
me
->getThreatManager().isThreatListEmpty())
96
EnterEvadeMode
();
97
else
98
{
99
events
.ScheduleEvent(
EVENT_BALCONY
, 110000);
100
events
.ScheduleEvent(
EVENT_CURSE
, 10000+rand()%15000);
101
events
.ScheduleEvent(
EVENT_WARRIOR
, 30000);
102
if
(
GetDifficulty
() ==
DIFFICULTY_25MAN_NORMAL
)
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
113
void
JustSummoned
(
Creature
* summon)
OVERRIDE
114
{
115
summons
.Summon(summon);
116
summon->setActive(
true
);
117
summon->AI()->DoZoneInCombat();
118
}
119
120
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
121
{
122
_JustDied
();
123
Talk
(
SAY_DEATH
);
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],
132
SummonPos
[pos][3],
TempSummonType::TEMPSUMMON_CORPSE_DESPAWN
, 60000);
133
}
134
}
135
136
void
UpdateAI
(
uint32
diff)
OVERRIDE
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
:
148
DoCastAOE
(
SPELL_CURSE_PLAGUEBRINGER
);
149
events
.ScheduleEvent(
EVENT_CURSE
, std::rand() % 60000 + 50000);
150
return
;
151
case
EVENT_WARRIOR
:
152
Talk
(
SAY_SUMMON
);
153
SummonUndead
(
NPC_WARRIOR
,
RAID_MODE
(2, 3));
154
events
.ScheduleEvent(
EVENT_WARRIOR
, 30000);
155
return
;
156
case
EVENT_BLINK
:
157
DoCastAOE
(
SPELL_CRIPPLE
,
true
);
158
DoCastAOE
(
SPELL_BLINK
);
159
DoResetThreat
();
160
events
.ScheduleEvent(
EVENT_BLINK
, 40000);
161
return
;
162
case
EVENT_BALCONY
:
163
me
->SetReactState(
REACT_PASSIVE
);
164
me
->SetFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NOT_SELECTABLE
);
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
:
173
Talk
(
SAY_SUMMON
);
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);
193
EnterPhaseGround
();
194
return
;
195
}
196
}
197
}
198
199
if
(
me
->HasReactState(
REACT_AGGRESSIVE
))
200
DoMeleeAttackIfReady
();
201
}
202
};
203
};
204
205
void
AddSC_boss_noth
()
206
{
207
new
boss_noth
();
208
}
DIFFICULTY_25MAN_NORMAL
@ DIFFICULTY_25MAN_NORMAL
Definition
DBCEnums.h:335
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_CORPSE_DESPAWN
@ TEMPSUMMON_CORPSE_DESPAWN
Definition
Object.h:72
ScriptMgr.h
ScriptedCreature.h
REACT_PASSIVE
@ REACT_PASSIVE
Definition
Unit.h:1156
REACT_AGGRESSIVE
@ REACT_AGGRESSIVE
Definition
Unit.h:1158
UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_SELECTABLE
Definition
Unit.h:650
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
Events
Events
Definition
alterac_valley.cpp:40
SAY_SLAY
@ SAY_SLAY
Definition
boss_alizabal.cpp:20
SPELL_CRIPPLE
@ SPELL_CRIPPLE
Definition
boss_azgalor.cpp:20
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
EVENT_NONE
@ EVENT_NONE
Definition
boss_felmyst.cpp:84
SPELL_TELEPORT
@ SPELL_TELEPORT
Definition
boss_majordomo_executus.cpp:38
TELE_Z
#define TELE_Z
Definition
boss_noth.cpp:33
TELE_Y
#define TELE_Y
Definition
boss_noth.cpp:32
TELE_X
#define TELE_X
Definition
boss_noth.cpp:31
SPELL_BLINK
#define SPELL_BLINK
Definition
boss_noth.cpp:28
MAX_SUMMON_POS
#define MAX_SUMMON_POS
Definition
boss_noth.cpp:36
TELE_O
#define TELE_O
Definition
boss_noth.cpp:34
SummonPos
const float SummonPos[MAX_SUMMON_POS][4]
Definition
boss_noth.cpp:38
AddSC_boss_noth
void AddSC_boss_noth()
Definition
boss_noth.cpp:205
Noth
Noth
Definition
boss_noth.cpp:11
SAY_DEATH
@ SAY_DEATH
Definition
boss_noth.cpp:15
NPC_GUARDIAN
@ NPC_GUARDIAN
Definition
boss_noth.cpp:25
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_noth.cpp:12
NPC_CHAMPION
@ NPC_CHAMPION
Definition
boss_noth.cpp:24
SPELL_CRIPPLE
@ SPELL_CRIPPLE
Definition
boss_noth.cpp:20
SAY_SLAY
@ SAY_SLAY
Definition
boss_noth.cpp:14
SPELL_CURSE_PLAGUEBRINGER
@ SPELL_CURSE_PLAGUEBRINGER
Definition
boss_noth.cpp:19
NPC_WARRIOR
@ NPC_WARRIOR
Definition
boss_noth.cpp:23
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_noth.cpp:13
EVENT_CURSE
@ EVENT_CURSE
Definition
boss_noth.cpp:51
EVENT_BLINK
@ EVENT_BLINK
Definition
boss_noth.cpp:52
EVENT_GROUND
@ EVENT_GROUND
Definition
boss_noth.cpp:56
EVENT_WAVE
@ EVENT_WAVE
Definition
boss_noth.cpp:55
EVENT_BALCONY
@ EVENT_BALCONY
Definition
boss_noth.cpp:54
EVENT_WARRIOR
@ EVENT_WARRIOR
Definition
boss_noth.cpp:53
EVENT_BERSERK
@ EVENT_BERSERK
Definition
boss_occuthar.cpp:31
NPC_WARRIOR
@ NPC_WARRIOR
Definition
boss_razorgore.cpp:36
SOUND_DEATH
#define SOUND_DEATH
Definition
boss_razuvious.cpp:27
EVENT_BLINK
@ EVENT_BLINK
Definition
boss_shazzrah.cpp:32
SAY_SUMMON
@ SAY_SUMMON
Definition
boss_urok_doomhowl.cpp:19
BossAI::CheckInRoom
bool CheckInRoom()
Definition
ScriptedCreature.h:427
BossAI::summons
SummonList summons
Definition
ScriptedCreature.h:440
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
BossAI::_JustDied
void _JustDied()
Definition
ScriptedCreature.cpp:474
BossAI::_Reset
void _Reset()
Definition
ScriptedCreature.cpp:462
BossAI::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::DoZoneInCombat
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition
CreatureAI.cpp:33
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
CreatureAI::EnterEvadeMode
virtual void EnterEvadeMode()
Definition
CreatureAI.cpp:130
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCastAOE
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:176
Unit
Definition
Unit.h:1367
boss_noth
Definition
boss_noth.cpp:60
boss_noth::boss_noth
boss_noth()
Definition
boss_noth.cpp:62
boss_noth::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_noth.cpp:64
naxxramas.h
BOSS_NOTH
@ BOSS_NOTH
Definition
naxxramas.h:16
ScriptedAI::GetDifficulty
DifficultyID GetDifficulty() const
Definition
ScriptedCreature.h:285
ScriptedAI::DoResetThreat
void DoResetThreat()
Definition
ScriptedCreature.cpp:260
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::RAID_MODE
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition
ScriptedCreature.h:310
boss_noth::boss_nothAI
Definition
boss_noth.cpp:70
boss_noth::boss_nothAI::JustSummoned
void JustSummoned(Creature *summon) OVERRIDE
Definition
boss_noth.cpp:113
boss_noth::boss_nothAI::SummonUndead
void SummonUndead(uint32 entry, uint32 num)
Definition
boss_noth.cpp:126
boss_noth::boss_nothAI::waveCount
uint32 waveCount
Definition
boss_noth.cpp:73
boss_noth::boss_nothAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_noth.cpp:107
boss_noth::boss_nothAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_noth.cpp:82
boss_noth::boss_nothAI::boss_nothAI
boss_nothAI(Creature *creature)
Definition
boss_noth.cpp:71
boss_noth::boss_nothAI::EnterPhaseGround
void EnterPhaseGround()
Definition
boss_noth.cpp:90
boss_noth::boss_nothAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_noth.cpp:120
boss_noth::boss_nothAI::Reset
void Reset() OVERRIDE
Definition
boss_noth.cpp:75
boss_noth::boss_nothAI::balconyCount
uint32 balconyCount
Definition
boss_noth.cpp:73
boss_noth::boss_nothAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_noth.cpp:136
src
server
scripts
Northrend
Naxxramas
boss_noth.cpp
Generated on
for Project SkyFire Core by
1.17.0