Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_mother_smolderweb.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 "
blackrock_spire.h
"
9
10
enum
Spells
11
{
12
SPELL_CRYSTALIZE
= 16104,
13
SPELL_MOTHERSMILK
= 16468,
14
SPELL_SUMMON_SPIRE_SPIDERLING
= 16103,
15
};
16
17
enum
Events
18
{
19
EVENT_CRYSTALIZE
= 1,
20
EVENT_MOTHERS_MILK
= 2,
21
};
22
23
class
boss_mother_smolderweb
:
public
CreatureScript
24
{
25
public
:
26
boss_mother_smolderweb
() :
CreatureScript
(
"boss_mother_smolderweb"
) { }
27
28
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
29
{
30
return
new
boss_mothersmolderwebAI
(creature);
31
}
32
33
struct
boss_mothersmolderwebAI
:
public
BossAI
34
{
35
boss_mothersmolderwebAI
(
Creature
* creature) :
BossAI
(creature,
DATA_MOTHER_SMOLDERWEB
) { }
36
37
void
Reset
()
OVERRIDE
38
{
39
_Reset
();
40
}
41
42
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
43
{
44
_EnterCombat
();
45
events
.ScheduleEvent(
EVENT_CRYSTALIZE
, 20 *
IN_MILLISECONDS
);
46
events
.ScheduleEvent(
EVENT_MOTHERS_MILK
, 10 *
IN_MILLISECONDS
);
47
}
48
49
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
50
{
51
_JustDied
();
52
}
53
54
void
DamageTaken
(
Unit
*
/*done_by*/
,
uint32
&damage)
OVERRIDE
55
{
56
if
(
me
->GetHealth() <= damage)
57
DoCast
(
me
,
SPELL_SUMMON_SPIRE_SPIDERLING
,
true
);
58
}
59
60
void
UpdateAI
(
uint32
diff)
OVERRIDE
61
{
62
if
(!
UpdateVictim
())
63
return
;
64
65
events
.Update(diff);
66
67
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
68
return
;
69
70
while
(
uint32
eventId =
events
.ExecuteEvent())
71
{
72
switch
(eventId)
73
{
74
case
EVENT_CRYSTALIZE
:
75
DoCast
(
me
,
SPELL_CRYSTALIZE
);
76
events
.ScheduleEvent(
EVENT_CRYSTALIZE
, 15 *
IN_MILLISECONDS
);
77
break
;
78
case
EVENT_MOTHERS_MILK
:
79
DoCast
(
me
,
SPELL_MOTHERSMILK
);
80
events
.ScheduleEvent(
EVENT_MOTHERS_MILK
, std::rand() % 12500 + (5 *
IN_MILLISECONDS
));
81
break
;
82
}
83
}
84
DoMeleeAttackIfReady
();
85
}
86
};
87
};
88
89
void
AddSC_boss_mothersmolderweb
()
90
{
91
new
boss_mother_smolderweb
();
92
}
Spells
Spells
Definition
BattlegroundIC.h:645
IN_MILLISECONDS
@ IN_MILLISECONDS
Definition
Common.h:125
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
blackrock_spire.h
DATA_MOTHER_SMOLDERWEB
@ DATA_MOTHER_SMOLDERWEB
Definition
blackrock_spire.h:18
AddSC_boss_mothersmolderweb
void AddSC_boss_mothersmolderweb()
Definition
boss_mother_smolderweb.cpp:89
SPELL_CRYSTALIZE
@ SPELL_CRYSTALIZE
Definition
boss_mother_smolderweb.cpp:12
SPELL_SUMMON_SPIRE_SPIDERLING
@ SPELL_SUMMON_SPIRE_SPIDERLING
Definition
boss_mother_smolderweb.cpp:14
SPELL_MOTHERSMILK
@ SPELL_MOTHERSMILK
Definition
boss_mother_smolderweb.cpp:13
EVENT_MOTHERS_MILK
@ EVENT_MOTHERS_MILK
Definition
boss_mother_smolderweb.cpp:20
EVENT_CRYSTALIZE
@ EVENT_CRYSTALIZE
Definition
boss_mother_smolderweb.cpp:19
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::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::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
Unit
Definition
Unit.h:1367
boss_mother_smolderweb
Definition
boss_mother_smolderweb.cpp:24
boss_mother_smolderweb::boss_mother_smolderweb
boss_mother_smolderweb()
Definition
boss_mother_smolderweb.cpp:26
boss_mother_smolderweb::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_mother_smolderweb.cpp:28
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
boss_mother_smolderweb::boss_mothersmolderwebAI
Definition
boss_mother_smolderweb.cpp:34
boss_mother_smolderweb::boss_mothersmolderwebAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_mother_smolderweb.cpp:49
boss_mother_smolderweb::boss_mothersmolderwebAI::boss_mothersmolderwebAI
boss_mothersmolderwebAI(Creature *creature)
Definition
boss_mother_smolderweb.cpp:35
boss_mother_smolderweb::boss_mothersmolderwebAI::DamageTaken
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition
boss_mother_smolderweb.cpp:54
boss_mother_smolderweb::boss_mothersmolderwebAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_mother_smolderweb.cpp:42
boss_mother_smolderweb::boss_mothersmolderwebAI::Reset
void Reset() OVERRIDE
Definition
boss_mother_smolderweb.cpp:37
boss_mother_smolderweb::boss_mothersmolderwebAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_mother_smolderweb.cpp:60
src
server
scripts
EasternKingdoms
BlackrockMountain
BlackrockSpire
boss_mother_smolderweb.cpp
Generated on
for Project SkyFire Core by
1.17.0