Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_postmaster_malown.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
/* ScriptData
7
SDName: boss_postmaster_malown
8
SD%Complete: 50
9
SDComment:
10
SDCategory: Stratholme
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
#include "
stratholme.h
"
16
17
//Spell ID to summon this guy is 24627 "Summon Postmaster Malown"
18
//He should be spawned along with three other elites once the third postbox has been opened
19
20
enum
Says
21
{
22
SAY_KILL
= 0
23
};
24
25
enum
Spells
26
{
27
SPELL_WAILINGDEAD
= 7713,
28
SPELL_BACKHAND
= 6253,
29
SPELL_CURSEOFWEAKNESS
= 8552,
30
SPELL_CURSEOFTONGUES
= 12889,
31
SPELL_CALLOFTHEGRAVE
= 17831
32
};
33
34
enum
Events
35
{
36
EVENT_WAILINGDEAD
= 1,
37
EVENT_BACKHAND
= 2,
38
EVENT_CURSEOFWEAKNESS
= 3,
39
EVENT_CURSEOFTONGUES
= 4,
40
EVENT_CALLOFTHEGRAVE
= 5
41
};
42
43
class
boss_postmaster_malown
:
public
CreatureScript
44
{
45
public
:
46
boss_postmaster_malown
() :
CreatureScript
(
"boss_postmaster_malown"
) { }
47
48
struct
boss_postmaster_malownAI
:
public
BossAI
49
{
50
boss_postmaster_malownAI
(
Creature
* creature) :
BossAI
(creature,
TYPE_MALOWN
) { }
51
52
void
Reset
()
OVERRIDE
{ }
53
54
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
55
{
56
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 19000);
// lasts 6 sec
57
events
.ScheduleEvent(
EVENT_BACKHAND
, 8000);
// 2 sec stun
58
events
.ScheduleEvent(
EVENT_CURSEOFWEAKNESS
, 20000);
// lasts 2 mins
59
events
.ScheduleEvent(
EVENT_CURSEOFTONGUES
, 22000);
60
events
.ScheduleEvent(
EVENT_CALLOFTHEGRAVE
, 25000);
61
}
62
63
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
64
{
65
Talk
(
SAY_KILL
);
66
}
67
68
void
UpdateAI
(
uint32
diff)
OVERRIDE
69
{
70
if
(!
UpdateVictim
())
71
return
;
72
73
events
.Update(diff);
74
75
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
76
return
;
77
78
while
(
uint32
eventId =
events
.ExecuteEvent())
79
{
80
switch
(eventId)
81
{
82
case
EVENT_WAILINGDEAD
:
83
if
(rand()%100 < 65)
//65% chance to cast
84
DoCastVictim
(
SPELL_WAILINGDEAD
,
true
);
85
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 19000);
86
break
;
87
case
EVENT_BACKHAND
:
88
if
(rand()%100 < 45)
//45% chance to cast
89
DoCastVictim
(
SPELL_BACKHAND
,
true
);
90
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 8000);
91
break
;
92
case
EVENT_CURSEOFWEAKNESS
:
93
if
(rand()%100 < 3)
//3% chance to cast
94
DoCastVictim
(
SPELL_CURSEOFWEAKNESS
,
true
);
95
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 20000);
96
break
;
97
case
EVENT_CURSEOFTONGUES
:
98
if
(rand()%100 < 3)
//3% chance to cast
99
DoCastVictim
(
SPELL_CURSEOFTONGUES
,
true
);
100
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 22000);
101
break
;
102
case
EVENT_CALLOFTHEGRAVE
:
103
if
(rand()%100 < 5)
//5% chance to cast
104
DoCastVictim
(
SPELL_CALLOFTHEGRAVE
,
true
);
105
events
.ScheduleEvent(
EVENT_WAILINGDEAD
, 25000);
106
break
;
107
default
:
108
break
;
109
}
110
}
111
DoMeleeAttackIfReady
();
112
}
113
};
114
115
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
116
{
117
return
new
boss_postmaster_malownAI
(creature);
118
}
119
};
120
121
void
AddSC_boss_postmaster_malown
()
122
{
123
new
boss_postmaster_malown
();
124
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
ScriptMgr.h
ScriptedCreature.h
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
Events
Events
Definition
alterac_valley.cpp:40
SPELL_CURSEOFWEAKNESS
@ SPELL_CURSEOFWEAKNESS
Definition
boss_anubshiah.cpp:13
SPELL_CURSEOFTONGUES
@ SPELL_CURSEOFTONGUES
Definition
boss_anubshiah.cpp:12
SPELL_CALLOFTHEGRAVE
@ SPELL_CALLOFTHEGRAVE
Definition
boss_azshir_the_sleepless.cpp:18
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
Says
Says
Definition
boss_halycon.cpp:17
SAY_KILL
@ SAY_KILL
Definition
boss_postmaster_malown.cpp:22
SPELL_WAILINGDEAD
@ SPELL_WAILINGDEAD
Definition
boss_postmaster_malown.cpp:27
SPELL_CURSEOFWEAKNESS
@ SPELL_CURSEOFWEAKNESS
Definition
boss_postmaster_malown.cpp:29
SPELL_CALLOFTHEGRAVE
@ SPELL_CALLOFTHEGRAVE
Definition
boss_postmaster_malown.cpp:31
SPELL_CURSEOFTONGUES
@ SPELL_CURSEOFTONGUES
Definition
boss_postmaster_malown.cpp:30
SPELL_BACKHAND
@ SPELL_BACKHAND
Definition
boss_postmaster_malown.cpp:28
AddSC_boss_postmaster_malown
void AddSC_boss_postmaster_malown()
Definition
boss_postmaster_malown.cpp:121
EVENT_BACKHAND
@ EVENT_BACKHAND
Definition
boss_postmaster_malown.cpp:37
EVENT_CALLOFTHEGRAVE
@ EVENT_CALLOFTHEGRAVE
Definition
boss_postmaster_malown.cpp:40
EVENT_WAILINGDEAD
@ EVENT_WAILINGDEAD
Definition
boss_postmaster_malown.cpp:36
EVENT_CURSEOFTONGUES
@ EVENT_CURSEOFTONGUES
Definition
boss_postmaster_malown.cpp:39
EVENT_CURSEOFWEAKNESS
@ EVENT_CURSEOFWEAKNESS
Definition
boss_postmaster_malown.cpp:38
BossAI::events
EventMap events
Definition
ScriptedCreature.h:439
BossAI::BossAI
BossAI(Creature *creature, uint32 bossId)
Definition
ScriptedCreature.cpp:456
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
CreatureAI::UpdateVictim
bool UpdateVictim()
Definition
CreatureAI.cpp:192
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_postmaster_malown
Definition
boss_postmaster_malown.cpp:44
boss_postmaster_malown::boss_postmaster_malown
boss_postmaster_malown()
Definition
boss_postmaster_malown.cpp:46
boss_postmaster_malown::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_postmaster_malown.cpp:115
stratholme.h
TYPE_MALOWN
@ TYPE_MALOWN
Definition
stratholme.h:18
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_postmaster_malown::boss_postmaster_malownAI
Definition
boss_postmaster_malown.cpp:49
boss_postmaster_malown::boss_postmaster_malownAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_postmaster_malown.cpp:54
boss_postmaster_malown::boss_postmaster_malownAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_postmaster_malown.cpp:68
boss_postmaster_malown::boss_postmaster_malownAI::Reset
void Reset() OVERRIDE
Definition
boss_postmaster_malown.cpp:52
boss_postmaster_malown::boss_postmaster_malownAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_postmaster_malown.cpp:63
boss_postmaster_malown::boss_postmaster_malownAI::boss_postmaster_malownAI
boss_postmaster_malownAI(Creature *creature)
Definition
boss_postmaster_malown.cpp:50
src
server
scripts
EasternKingdoms
Stratholme
boss_postmaster_malown.cpp
Generated on
for Project SkyFire Core by
1.17.0