Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_hoptallus.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 "
stormstout_brewery.h
"
9
#include "
Player.h
"
10
#include "
SpellScript.h
"
11
12
enum
Spells
13
{
14
SPELL_FURLWIND
= 112992,
15
SPELL_CARROT_BREATH
= 112944,
16
SPELL_HOPTALLUS_SCREECH
= 114367,
17
};
18
static
const
uint32
hoppers
[2] = { 56718, 59426 };
19
static
const
Position
hopperSpawnPos
[] =
20
{
21
{ -726.7f, 1257.9f, 166.8f, 0.24f },
22
{ -720.86f, 1253.44f, 166.8f, 0.24f },
23
{ -726.86f, 1247.41f, 166.8f, 0.25f },
24
{ -719.38f, 1255.37f, 166.8f, 0.25f}
25
};
26
27
static
const
uint32
hoplings
[5] = { 59461, 56631, 59459, 59458, 59460 };
28
static
const
Position
hoplingSpawnPos
[] =
29
{
30
{ -719.31f, 1248.27f, 166.8f, 0.24f },
31
{ -719.95f, 1250.89f, 166.8f, 0.24f },
32
{ -720.66f, 1253.79f, 166.8f, 0.24f },
33
{ -721.25f, 1256.18f, 166.8f, 0.24f },
34
{ -721.94f, 1259.02f, 166.8f, 0.24f }
35
};
36
37
class
boss_hoptallus
:
public
CreatureScript
38
{
39
enum
hoptalusEvents
40
{
41
EVENT_FURLWIND
= 1,
42
EVENT_CARROT_BREATH
= 2,
43
EVENT_SCREECH
= 3,
44
};
45
public
:
46
boss_hoptallus
() :
CreatureScript
(
"boss_hoptallus"
) { }
47
48
struct
boss_hoptallusAI
:
public
BossAI
49
{
50
boss_hoptallusAI
(
Creature
* creature) :
BossAI
(creature,
DATA_HOPTALLUS
) { }
51
52
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
53
{
54
_EnterCombat
();
55
56
//Talk(SAY_AGGRO);
57
58
events
.ScheduleEvent(
EVENT_SCREECH
, 30000);
59
events
.ScheduleEvent(
EVENT_FURLWIND
,
DUNGEON_MODE
(16000, 10000));
60
events
.ScheduleEvent(
EVENT_CARROT_BREATH
,
DUNGEON_MODE
(30000, 15000));
61
}
62
63
void
JustDied
(
Unit
*
/*killer*/
)
OVERRIDE
64
{
65
_JustDied
();
66
67
//Talk(SAY_DEATH);
68
}
69
70
void
UpdateAI
(
uint32
diff)
OVERRIDE
71
{
72
if
(
me
->HasAura(
SPELL_FURLWIND
) ||
me
->HasAura(
SPELL_CARROT_BREATH
) ||
me
->HasUnitState(
UNIT_STATE_CASTING
))
73
return
;
74
75
events
.Update(diff);
76
77
while
(
uint32
eventId =
events
.ExecuteEvent())
78
{
79
switch
(eventId)
80
{
81
case
EVENT_FURLWIND
:
82
{
83
DoCastVictim
(
SPELL_FURLWIND
);
84
events
.ScheduleEvent(
EVENT_FURLWIND
,
DUNGEON_MODE
(50000, 40000));
85
break
;
86
}
87
case
EVENT_CARROT_BREATH
:
88
{
89
// Carrot Breath crashing server after 1st tick knockback
90
// DoCastVictim(SPELL_CARROT_BREATH);
91
events
.ScheduleEvent(
EVENT_CARROT_BREATH
,
DUNGEON_MODE
(27000, 25000));
92
break
;
93
}
94
case
EVENT_SCREECH
:
95
{
96
for
(
uint8
i = 0; i < 5; i++)
97
{
98
if
(
Creature
* creature =
me
->SummonCreature(
hoplings
[i],
hoplingSpawnPos
[i],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 15000))
99
{
100
creature->setFaction(14);
101
creature->AddAura(114284, creature);
102
103
Position
pos;
104
me
->GetRandomNearPosition(pos, 10.f);
105
creature->GetMotionMaster()->MoveJump(pos.
GetPositionX
(), pos.
GetPositionY
(), pos.
GetPositionZ
(), 15.f, 15.f,
EVENT_JUMP
);
106
}
107
}
108
109
for
(
uint8
j = 0; j < 4; j++)
110
{
111
if
(
Creature
* creature =
me
->SummonCreature(
hoppers
[j],
hopperSpawnPos
[j],
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 15000))
112
{
113
creature->setFaction(14);
114
Position
pos;
115
me
->GetRandomNearPosition(pos, 10.f);
116
creature->GetMotionMaster()->MoveJump(pos.
GetPositionX
(), pos.
GetPositionY
(), pos.
GetPositionZ
(), 15.f, 15.f,
EVENT_JUMP
);
117
}
118
}
119
120
DoCast
(
SPELL_HOPTALLUS_SCREECH
);
121
events
.ScheduleEvent(
EVENT_SCREECH
, 30000);
122
break
;
123
}
124
default
:
125
break
;
126
}
127
}
128
DoMeleeAttackIfReady
();
129
}
130
};
131
132
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
133
{
134
return
GetStormstoutBreweryAI<boss_hoptallusAI>
(creature);
135
}
136
};
137
138
void
AddSC_boss_hoptallus
()
139
{
140
new
boss_hoptallus
();
141
}
Spells
Spells
Definition
BattlegroundIC.h:645
uint8
std::uint8_t uint8
Definition
Define.h:79
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition
Object.h:73
Player.h
ScriptMgr.h
ScriptedCreature.h
EVENT_JUMP
@ EVENT_JUMP
Definition
SharedDefines.h:3855
SpellScript.h
UNIT_STATE_CASTING
@ UNIT_STATE_CASTING
Definition
Unit.h:527
hoppers
static const uint32 hoppers[2]
Definition
boss_hoptallus.cpp:18
hopperSpawnPos
static const Position hopperSpawnPos[]
Definition
boss_hoptallus.cpp:19
hoplingSpawnPos
static const Position hoplingSpawnPos[]
Definition
boss_hoptallus.cpp:28
SPELL_FURLWIND
@ SPELL_FURLWIND
Definition
boss_hoptallus.cpp:14
SPELL_CARROT_BREATH
@ SPELL_CARROT_BREATH
Definition
boss_hoptallus.cpp:15
SPELL_HOPTALLUS_SCREECH
@ SPELL_HOPTALLUS_SCREECH
Definition
boss_hoptallus.cpp:16
hoplings
static const uint32 hoplings[5]
Definition
boss_hoptallus.cpp:27
AddSC_boss_hoptallus
void AddSC_boss_hoptallus()
Definition
boss_hoptallus.cpp:138
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::_EnterCombat
void _EnterCombat()
Definition
ScriptedCreature.cpp:485
CreatureAI
Definition
CreatureAI.h:54
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::DoCastVictim
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition
UnitAI.cpp:168
Unit
Definition
Unit.h:1367
boss_hoptallus
Definition
boss_hoptallus.cpp:38
boss_hoptallus::hoptalusEvents
hoptalusEvents
Definition
boss_hoptallus.cpp:40
boss_hoptallus::EVENT_SCREECH
@ EVENT_SCREECH
Definition
boss_hoptallus.cpp:43
boss_hoptallus::EVENT_CARROT_BREATH
@ EVENT_CARROT_BREATH
Definition
boss_hoptallus.cpp:42
boss_hoptallus::EVENT_FURLWIND
@ EVENT_FURLWIND
Definition
boss_hoptallus.cpp:41
boss_hoptallus::boss_hoptallus
boss_hoptallus()
Definition
boss_hoptallus.cpp:46
boss_hoptallus::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_hoptallus.cpp:132
stormstout_brewery.h
GetStormstoutBreweryAI
AI * GetStormstoutBreweryAI(Creature *creature)
Definition
stormstout_brewery.h:44
DATA_HOPTALLUS
@ DATA_HOPTALLUS
Definition
stormstout_brewery.h:19
Position
Definition
Object.h:274
Position::GetPositionZ
float GetPositionZ() const
Definition
Object.h:330
Position::GetPositionX
float GetPositionX() const
Definition
Object.h:328
Position::GetPositionY
float GetPositionY() const
Definition
Object.h:329
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_hoptallus::boss_hoptallusAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
boss_hoptallus.cpp:52
boss_hoptallus::boss_hoptallusAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_hoptallus.cpp:70
boss_hoptallus::boss_hoptallusAI::JustDied
void JustDied(Unit *) OVERRIDE
Definition
boss_hoptallus.cpp:63
boss_hoptallus::boss_hoptallusAI::boss_hoptallusAI
boss_hoptallusAI(Creature *creature)
Definition
boss_hoptallus.cpp:50
src
server
scripts
Pandaria
StormstoutBrewery
boss_hoptallus.cpp
Generated on
for Project SkyFire Core by
1.17.0