Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_thorngrin_the_tender.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 "
the_botanica.h
"
9
10
enum
Says
11
{
12
SAY_AGGRO
= 0,
13
SAY_20_PERCENT_HP
= 1,
14
SAY_KILL
= 2,
15
SAY_CAST_SACRIFICE
= 3,
16
SAY_50_PERCENT_HP
= 4,
17
SAY_CAST_HELLFIRE
= 5,
18
SAY_DEATH
= 6,
19
EMOTE_ENRAGE
= 7
20
};
21
22
enum
Spells
23
{
24
SPELL_SACRIFICE
= 34661,
25
SPELL_HELLFIRE_NORMAL
= 34659,
26
SPELL_HELLFIRE_HEROIC
= 39131,
27
SPELL_ENRAGE
= 34670
28
};
29
30
enum
Events
31
{
32
EVENT_SACRIFICE
= 1,
33
EVENT_HELLFIRE
= 2,
34
EVENT_ENRAGE
= 3
35
};
36
37
class
boss_thorngrin_the_tender
:
public
CreatureScript
38
{
39
public
:
40
boss_thorngrin_the_tender
() :
CreatureScript
(
"thorngrin_the_tender"
) { }
41
42
struct
boss_thorngrin_the_tenderAI
:
public
BossAI
43
{
44
boss_thorngrin_the_tenderAI
(
Creature
* creature) :
BossAI
(creature,
DATA_THORNGRIN_THE_TENDER
) { }
45
46
void
Reset
()
OVERRIDE
47
{
48
_Reset
();
49
_phase1
=
true
;
50
_phase2
=
true
;
51
}
52
53
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
54
{
55
_EnterCombat
();
56
Talk
(
SAY_AGGRO
);
57
events
.ScheduleEvent(
EVENT_SACRIFICE
, 5700);
58
events
.ScheduleEvent(
EVENT_HELLFIRE
,
IsHeroic
() ? std::rand() % 19300 + 17400 : 18000);
59
events
.ScheduleEvent(
EVENT_ENRAGE
, 12000);
60
}
61
62
void
KilledUnit
(
Unit
*
/*victim*/
)
OVERRIDE
63
{
64
Talk
(
SAY_KILL
);
65
}
66
67
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
68
{
69
_JustDied
();
70
Talk
(
SAY_DEATH
);
71
}
72
73
void
DamageTaken
(
Unit
*
/*killer*/
,
uint32
& damage)
OVERRIDE
74
{
75
if
(
me
->HealthBelowPctDamaged(50, damage) &&
_phase1
)
76
{
77
_phase1
=
false
;
78
Talk
(
SAY_50_PERCENT_HP
);
79
}
80
if
(
me
->HealthBelowPctDamaged(20, damage) &&
_phase2
)
81
{
82
_phase2
=
false
;
83
Talk
(
SAY_20_PERCENT_HP
);
84
}
85
}
86
87
void
UpdateAI
(
uint32
diff)
OVERRIDE
88
{
89
if
(!
UpdateVictim
())
90
return
;
91
92
events
.Update(diff);
93
94
if
(
me
->HasUnitState(
UNIT_STATE_CASTING
))
95
return
;
96
97
while
(
uint32
eventId =
events
.ExecuteEvent())
98
{
99
switch
(eventId)
100
{
101
case
EVENT_SACRIFICE
:
102
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 1, 0.0f,
true
))
103
{
104
Talk
(
SAY_CAST_SACRIFICE
);
105
DoCast
(target,
SPELL_SACRIFICE
,
true
);
106
}
107
events
.ScheduleEvent(
EVENT_SACRIFICE
, 29400);
108
break
;
109
case
EVENT_HELLFIRE
:
110
Talk
(
SAY_CAST_HELLFIRE
);
111
DoCastVictim
(
DUNGEON_MODE
(
SPELL_HELLFIRE_NORMAL
,
SPELL_HELLFIRE_HEROIC
),
true
);
112
events
.ScheduleEvent(
EVENT_HELLFIRE
,
IsHeroic
() ? std::rand() % 19300 + 17400 : 18000);
113
break
;
114
case
EVENT_ENRAGE
:
115
Talk
(
EMOTE_ENRAGE
);
116
DoCast
(
me
,
SPELL_ENRAGE
);
117
events
.ScheduleEvent(
EVENT_ENRAGE
, 33000);
118
break
;
119
default
:
120
break
;
121
}
122
}
123
124
DoMeleeAttackIfReady
();
125
}
126
127
private
:
128
bool
_phase1
;
129
bool
_phase2
;
130
};
131
132
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
133
{
134
return
new
boss_thorngrin_the_tenderAI
(creature);
135
}
136
};
137
138
void
AddSC_boss_thorngrin_the_tender
()
139
{
140
new
boss_thorngrin_the_tender
();
141
}
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
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
alterac_valley.cpp:14
Events
Events
Definition
alterac_valley.cpp:40
EVENT_ENRAGE
@ EVENT_ENRAGE
Definition
alterac_valley.cpp:45
SAY_DEATH
#define SAY_DEATH
Definition
boss_commander_kolurg.cpp:30
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
SAY_KILL
#define SAY_KILL
Definition
boss_commander_kolurg.cpp:29
EVENT_HELLFIRE
@ EVENT_HELLFIRE
Definition
boss_faction_champions.cpp:238
Says
Says
Definition
boss_halycon.cpp:17
EMOTE_ENRAGE
@ EMOTE_ENRAGE
Definition
boss_herod.cpp:23
SPELL_SACRIFICE
@ SPELL_SACRIFICE
Definition
boss_terestian_illhoof.cpp:33
SAY_DEATH
@ SAY_DEATH
Definition
boss_thorngrin_the_tender.cpp:18
SAY_AGGRO
@ SAY_AGGRO
Definition
boss_thorngrin_the_tender.cpp:12
SAY_20_PERCENT_HP
@ SAY_20_PERCENT_HP
Definition
boss_thorngrin_the_tender.cpp:13
SAY_KILL
@ SAY_KILL
Definition
boss_thorngrin_the_tender.cpp:14
EMOTE_ENRAGE
@ EMOTE_ENRAGE
Definition
boss_thorngrin_the_tender.cpp:19
SAY_CAST_HELLFIRE
@ SAY_CAST_HELLFIRE
Definition
boss_thorngrin_the_tender.cpp:17
SAY_CAST_SACRIFICE
@ SAY_CAST_SACRIFICE
Definition
boss_thorngrin_the_tender.cpp:15
SAY_50_PERCENT_HP
@ SAY_50_PERCENT_HP
Definition
boss_thorngrin_the_tender.cpp:16
SPELL_HELLFIRE_HEROIC
@ SPELL_HELLFIRE_HEROIC
Definition
boss_thorngrin_the_tender.cpp:26
SPELL_ENRAGE
@ SPELL_ENRAGE
Definition
boss_thorngrin_the_tender.cpp:27
SPELL_HELLFIRE_NORMAL
@ SPELL_HELLFIRE_NORMAL
Definition
boss_thorngrin_the_tender.cpp:25
SPELL_SACRIFICE
@ SPELL_SACRIFICE
Definition
boss_thorngrin_the_tender.cpp:24
AddSC_boss_thorngrin_the_tender
void AddSC_boss_thorngrin_the_tender()
Definition
boss_thorngrin_the_tender.cpp:138
EVENT_ENRAGE
@ EVENT_ENRAGE
Definition
boss_thorngrin_the_tender.cpp:34
EVENT_HELLFIRE
@ EVENT_HELLFIRE
Definition
boss_thorngrin_the_tender.cpp:33
EVENT_SACRIFICE
@ EVENT_SACRIFICE
Definition
boss_thorngrin_the_tender.cpp:32
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::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::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
boss_thorngrin_the_tender
Definition
boss_thorngrin_the_tender.cpp:38
boss_thorngrin_the_tender::boss_thorngrin_the_tender
boss_thorngrin_the_tender()
Definition
boss_thorngrin_the_tender.cpp:40
boss_thorngrin_the_tender::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:132
ScriptedAI::IsHeroic
bool IsHeroic() const
Definition
ScriptedCreature.h:279
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::DUNGEON_MODE
const T & DUNGEON_MODE(const T &normal5, const T &heroic5) const
Definition
ScriptedCreature.h:294
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI
Definition
boss_thorngrin_the_tender.cpp:43
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:53
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::Reset
void Reset() OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:46
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::DamageTaken
void DamageTaken(Unit *, uint32 &damage) OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:73
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:67
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::boss_thorngrin_the_tenderAI
boss_thorngrin_the_tenderAI(Creature *creature)
Definition
boss_thorngrin_the_tender.cpp:44
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::_phase2
bool _phase2
Definition
boss_thorngrin_the_tender.cpp:129
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_thorngrin_the_tender.cpp:87
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::KilledUnit
void KilledUnit(Unit *) OVERRIDE
Definition
boss_thorngrin_the_tender.cpp:62
boss_thorngrin_the_tender::boss_thorngrin_the_tenderAI::_phase1
bool _phase1
Definition
boss_thorngrin_the_tender.cpp:128
the_botanica.h
DATA_THORNGRIN_THE_TENDER
@ DATA_THORNGRIN_THE_TENDER
Definition
the_botanica.h:15
src
server
scripts
Outland
TempestKeep
botanica
boss_thorngrin_the_tender.cpp
Generated on
for Project SkyFire Core by
1.17.0