Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_moragg.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 "
violet_hold.h
"
9
10
//Spells
11
enum
Spells
12
{
13
SPELL_CORROSIVE_SALIVA
= 54527,
14
SPELL_OPTIC_LINK
= 54396
15
};
16
17
class
boss_moragg
:
public
CreatureScript
18
{
19
public
:
20
boss_moragg
() :
CreatureScript
(
"boss_moragg"
) { }
21
22
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
23
{
24
return
new
boss_moraggAI
(creature);
25
}
26
27
struct
boss_moraggAI
:
public
ScriptedAI
28
{
29
boss_moraggAI
(
Creature
* creature) :
ScriptedAI
(creature)
30
{
31
instance
= creature->
GetInstanceScript
();
32
}
33
34
uint32
uiOpticLinkTimer
;
35
uint32
uiCorrosiveSalivaTimer
;
36
37
InstanceScript
*
instance
;
38
39
void
Reset
()
OVERRIDE
40
{
41
uiOpticLinkTimer
= 10000;
42
uiCorrosiveSalivaTimer
= 5000;
43
44
if
(
instance
)
45
{
46
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
47
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
NOT_STARTED
);
48
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
49
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
NOT_STARTED
);
50
}
51
}
52
53
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
54
{
55
if
(
instance
)
56
{
57
if
(
GameObject
* pDoor =
instance
->instance->GetGameObject(
instance
->GetData64(
DATA_MORAGG_CELL
)))
58
if
(pDoor->GetGoState() ==
GOState::GO_STATE_READY
)
59
{
60
EnterEvadeMode
();
61
return
;
62
}
63
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
64
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
IN_PROGRESS
);
65
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
66
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
IN_PROGRESS
);
67
}
68
}
69
70
void
AttackStart
(
Unit
* who)
OVERRIDE
71
{
72
if
(
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_IMMUNE_TO_PC
) ||
me
->HasFlag(
UNIT_FIELD_FLAGS
,
UNIT_FLAG_NON_ATTACKABLE
))
73
return
;
74
75
if
(
me
->Attack(who,
true
))
76
{
77
me
->AddThreat(who, 0.0f);
78
me
->SetInCombatWith(who);
79
who->SetInCombatWith(
me
);
80
DoStartMovement
(who);
81
}
82
}
83
84
void
MoveInLineOfSight
(
Unit
*
/*who*/
)
OVERRIDE
{ }
85
86
87
void
UpdateAI
(
uint32
diff)
OVERRIDE
88
{
89
//Return since we have no target
90
if
(!
UpdateVictim
())
91
return
;
92
93
if
(
uiOpticLinkTimer
<= diff)
94
{
95
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 100,
true
))
96
DoCast
(target,
SPELL_OPTIC_LINK
);
97
uiOpticLinkTimer
= 15000;
98
}
else
uiOpticLinkTimer
-= diff;
99
100
if
(
uiCorrosiveSalivaTimer
<= diff)
101
{
102
DoCastVictim
(
SPELL_CORROSIVE_SALIVA
);
103
uiCorrosiveSalivaTimer
= 10000;
104
}
else
uiCorrosiveSalivaTimer
-= diff;
105
106
DoMeleeAttackIfReady
();
107
}
108
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
109
{
110
if
(
instance
)
111
{
112
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 6)
113
{
114
instance
->SetData(
DATA_1ST_BOSS_EVENT
,
DONE
);
115
instance
->SetData(
DATA_WAVE_COUNT
, 7);
116
}
117
else
if
(
instance
->GetData(
DATA_WAVE_COUNT
) == 12)
118
{
119
instance
->SetData(
DATA_2ND_BOSS_EVENT
,
DONE
);
120
instance
->SetData(
DATA_WAVE_COUNT
, 13);
121
}
122
}
123
}
124
};
125
};
126
127
void
AddSC_boss_moragg
()
128
{
129
new
boss_moragg
();
130
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
GOState::GO_STATE_READY
@ GO_STATE_READY
Definition
GameObject.h:577
IN_PROGRESS
@ IN_PROGRESS
Definition
InstanceScript.h:47
DONE
@ DONE
Definition
InstanceScript.h:49
NOT_STARTED
@ NOT_STARTED
Definition
InstanceScript.h:46
ScriptMgr.h
ScriptedCreature.h
UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NON_ATTACKABLE
Definition
Unit.h:626
UNIT_FLAG_IMMUNE_TO_PC
@ UNIT_FLAG_IMMUNE_TO_PC
Definition
Unit.h:633
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
UNIT_FIELD_FLAGS
@ UNIT_FIELD_FLAGS
Definition
UpdateFields.h:82
SPELL_OPTIC_LINK
@ SPELL_OPTIC_LINK
Definition
boss_moragg.cpp:14
SPELL_CORROSIVE_SALIVA
@ SPELL_CORROSIVE_SALIVA
Definition
boss_moragg.cpp:13
AddSC_boss_moragg
void AddSC_boss_moragg()
Definition
boss_moragg.cpp:127
CreatureAI
Definition
CreatureAI.h:54
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
GameObject
Definition
GameObject.h:629
InstanceScript
Definition
InstanceScript.h:123
UnitAI::DoMeleeAttackIfReady
void DoMeleeAttackIfReady()
Definition
UnitAI.cpp:28
UnitAI::DoCast
void DoCast(uint32 spellId)
Definition
UnitAI.cpp:110
UnitAI::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
UnitAI::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
WorldObject::GetInstanceScript
InstanceScript * GetInstanceScript()
Definition
Object.cpp:1612
boss_moragg
Definition
boss_moragg.cpp:18
boss_moragg::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_moragg.cpp:22
boss_moragg::boss_moragg
boss_moragg()
Definition
boss_moragg.cpp:20
DATA_WAVE_COUNT
@ DATA_WAVE_COUNT
Definition
halls_of_reflection.h:26
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
ScriptedAI::DoStartMovement
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition
ScriptedCreature.cpp:135
boss_moragg::boss_moraggAI
Definition
boss_moragg.cpp:28
boss_moragg::boss_moraggAI::boss_moraggAI
boss_moraggAI(Creature *creature)
Definition
boss_moragg.cpp:29
boss_moragg::boss_moraggAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_moragg.cpp:53
boss_moragg::boss_moraggAI::uiOpticLinkTimer
uint32 uiOpticLinkTimer
Definition
boss_moragg.cpp:34
boss_moragg::boss_moraggAI::AttackStart
void AttackStart(Unit *who) OVERRIDE
Definition
boss_moragg.cpp:70
boss_moragg::boss_moraggAI::MoveInLineOfSight
void MoveInLineOfSight(Unit *) OVERRIDE
Definition
boss_moragg.cpp:84
boss_moragg::boss_moraggAI::uiCorrosiveSalivaTimer
uint32 uiCorrosiveSalivaTimer
Definition
boss_moragg.cpp:35
boss_moragg::boss_moraggAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_moragg.cpp:108
boss_moragg::boss_moraggAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_moragg.cpp:87
boss_moragg::boss_moraggAI::Reset
void Reset() OVERRIDE
Definition
boss_moragg.cpp:39
boss_moragg::boss_moraggAI::instance
InstanceScript * instance
Definition
boss_moragg.cpp:37
violet_hold.h
DATA_MORAGG_CELL
@ DATA_MORAGG_CELL
Definition
violet_hold.h:40
DATA_1ST_BOSS_EVENT
@ DATA_1ST_BOSS_EVENT
Definition
violet_hold.h:11
DATA_2ND_BOSS_EVENT
@ DATA_2ND_BOSS_EVENT
Definition
violet_hold.h:12
src
server
scripts
Northrend
VioletHold
boss_moragg.cpp
Generated on
for Project SkyFire Core by
1.17.0