Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
boss_ancient_stone_keeper.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_Ancient_Stone_Keeper
8
SD%Complete: 100
9
SDComment:
10
SDCategory: Uldaman
11
EndScriptData */
12
13
#include "
ScriptMgr.h
"
14
#include "
ScriptedCreature.h
"
15
16
enum
AncientStoneKeeper
17
{
18
SPELL_SAND_STORM
= 10094
19
};
20
21
class
boss_ancient_stone_keeper
:
public
CreatureScript
22
{
23
public
:
24
boss_ancient_stone_keeper
() :
CreatureScript
(
"boss_ancient_stone_keeper"
) { }
25
26
struct
boss_ancient_stone_keeperAI
:
public
ScriptedAI
27
{
28
uint32
uiSandStormTimer
;
29
30
boss_ancient_stone_keeperAI
(
Creature
* creature) :
ScriptedAI
(creature) { }
31
32
void
Reset
()
OVERRIDE
33
{
34
uiSandStormTimer
= 10000;
35
}
36
37
void
UpdateAI
(
uint32
uiDiff)
OVERRIDE
38
{
39
//Return since we have no target
40
if
(!
UpdateVictim
())
41
return
;
42
43
//uiSandStormTimer
44
if
(
uiSandStormTimer
<= uiDiff)
45
{
46
float
x = 0.0f, y = 0.0f;
47
GetPositionWithDistInOrientation
(
me
, 10.0f,
me
->GetOrientation() +
frand
(-
M_PI
,
M_PI
), x, y);
48
49
if
(
Creature
* sandStorm =
me
->SummonCreature(7226, x, y,
me
->GetPositionZ(),
me
->GetOrientation(),
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 10000))
50
{
51
sandStorm->CastSpell(sandStorm, 10092,
true
);
52
sandStorm->SetSpeed(
UnitMoveType::MOVE_RUN
, 0.1f,
true
);
53
54
if
(
Unit
* target =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 10.0f,
true
))
55
sandStorm->GetMotionMaster()->MoveChase(target, 1.0f, 1.0f);
56
}
57
58
GetPositionWithDistInOrientation
(
me
, 10.0f,
me
->GetOrientation() -
frand
(-
M_PI
,
M_PI
), x, y);
59
60
if
(
Creature
* sandStorm2 =
me
->SummonCreature(7226, x, y,
me
->GetPositionZ(),
me
->GetOrientation(),
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
, 10000))
61
{
62
sandStorm2->CastSpell(sandStorm2, 10092,
true
);
63
sandStorm2->SetSpeed(
UnitMoveType::MOVE_RUN
, 0.1f,
true
);
64
65
if
(
Unit
* target2 =
SelectTarget
(
SELECT_TARGET_RANDOM
, 0, 10.0f,
true
))
66
sandStorm2->GetMotionMaster()->MoveChase(target2, 1.0f, 1.0f);
67
}
68
69
uiSandStormTimer
= 11000;
70
}
71
else
uiSandStormTimer
-= uiDiff;
72
73
DoMeleeAttackIfReady
();
74
}
75
};
76
77
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
78
{
79
return
new
boss_ancient_stone_keeperAI
(creature);
80
}
81
};
82
83
void
AddSC_boss_ancient_stone_keeper
()
84
{
85
new
boss_ancient_stone_keeper
();
86
}
M_PI
#define M_PI
Definition
Common.h:192
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
Definition
Object.h:70
ScriptMgr.h
GetPositionWithDistInOrientation
void GetPositionWithDistInOrientation(Unit *pUnit, float dist, float orientation, float &x, float &y)
Definition
ScriptedCreature.cpp:687
ScriptedCreature.h
MOVE_RUN
@ MOVE_RUN
Definition
Unit.h:556
SELECT_TARGET_RANDOM
@ SELECT_TARGET_RANDOM
Definition
UnitAI.h:23
frand
float frand(float min, float max)
Definition
Util.cpp:39
AncientStoneKeeper
AncientStoneKeeper
Definition
boss_ancient_stone_keeper.cpp:17
SPELL_SAND_STORM
@ SPELL_SAND_STORM
Definition
boss_ancient_stone_keeper.cpp:18
AddSC_boss_ancient_stone_keeper
void AddSC_boss_ancient_stone_keeper()
Definition
boss_ancient_stone_keeper.cpp:83
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::SelectTarget
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition
UnitAI.cpp:66
Unit
Definition
Unit.h:1367
boss_ancient_stone_keeper
Definition
boss_ancient_stone_keeper.cpp:22
boss_ancient_stone_keeper::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
boss_ancient_stone_keeper.cpp:77
boss_ancient_stone_keeper::boss_ancient_stone_keeper
boss_ancient_stone_keeper()
Definition
boss_ancient_stone_keeper.cpp:24
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
ScriptedAI::ScriptedAI
ScriptedAI(Creature *creature)
Definition
ScriptedCreature.cpp:85
boss_ancient_stone_keeper::boss_ancient_stone_keeperAI
Definition
boss_ancient_stone_keeper.cpp:27
boss_ancient_stone_keeper::boss_ancient_stone_keeperAI::uiSandStormTimer
uint32 uiSandStormTimer
Definition
boss_ancient_stone_keeper.cpp:28
boss_ancient_stone_keeper::boss_ancient_stone_keeperAI::Reset
void Reset() OVERRIDE
Definition
boss_ancient_stone_keeper.cpp:32
boss_ancient_stone_keeper::boss_ancient_stone_keeperAI::UpdateAI
void UpdateAI(uint32 uiDiff) OVERRIDE
== Triggered Actions Requested ==================
Definition
boss_ancient_stone_keeper.cpp:37
boss_ancient_stone_keeper::boss_ancient_stone_keeperAI::boss_ancient_stone_keeperAI
boss_ancient_stone_keeperAI(Creature *creature)
Definition
boss_ancient_stone_keeper.cpp:30
src
server
scripts
EasternKingdoms
Uldaman
boss_ancient_stone_keeper.cpp
Generated on
for Project SkyFire Core by
1.17.0