Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_hinterlands.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: Hinterlands
8
SD%Complete: 100
9
SDComment: Quest support: 836
10
SDCategory: The Hinterlands
11
EndScriptData */
12
13
/* ContentData
14
npc_00x09hl
15
EndContentData */
16
17
#include "
ScriptMgr.h
"
18
#include "
ScriptedCreature.h
"
19
#include "
ScriptedEscortAI.h
"
20
#include "
Player.h
"
21
22
/*######
23
## npc_00x09hl
24
######*/
25
26
enum
eOOX
27
{
28
SAY_OOX_START
= 0,
29
SAY_OOX_AGGRO
= 1,
30
SAY_OOX_AMBUSH
= 3,
31
SAY_OOX_AMBUSH_REPLY
= 4,
32
SAY_OOX_END
= 5,
33
34
QUEST_RESQUE_OOX_09
= 836,
35
36
NPC_MARAUDING_OWL
= 7808,
37
NPC_VILE_AMBUSHER
= 7809,
38
39
FACTION_ESCORTEE_A
= 774,
40
FACTION_ESCORTEE_H
= 775
41
};
42
43
class
npc_00x09hl
:
public
CreatureScript
44
{
45
public
:
46
npc_00x09hl
() :
CreatureScript
(
"npc_00x09hl"
) { }
47
48
bool
OnQuestAccept
(
Player
* player,
Creature
* creature,
const
Quest
* quest)
OVERRIDE
49
{
50
if
(quest->GetQuestId() ==
QUEST_RESQUE_OOX_09
)
51
{
52
creature->SetStandState(
UNIT_STAND_STATE_STAND
);
53
54
if
(player->GetTeam() ==
ALLIANCE
)
55
creature->setFaction(
FACTION_ESCORTEE_A
);
56
else
if
(player->GetTeam() ==
HORDE
)
57
creature->setFaction(
FACTION_ESCORTEE_H
);
58
59
creature->AI()->Talk(
SAY_OOX_START
, player);
60
61
if
(
npc_00x09hlAI
* pEscortAI =
CAST_AI
(
npc_00x09hl::npc_00x09hlAI
, creature->AI()))
62
pEscortAI->Start(
false
,
false
, player->GetGUID(), quest);
63
}
64
return
true
;
65
}
66
67
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
68
{
69
return
new
npc_00x09hlAI
(creature);
70
}
71
72
struct
npc_00x09hlAI
:
public
npc_escortAI
73
{
74
npc_00x09hlAI
(
Creature
* creature) :
npc_escortAI
(creature) { }
75
76
void
Reset
()
OVERRIDE
{ }
77
78
void
WaypointReached
(
uint32
waypointId)
OVERRIDE
79
{
80
switch
(waypointId)
81
{
82
case
26:
83
Talk
(
SAY_OOX_AMBUSH
);
84
break
;
85
case
43:
86
Talk
(
SAY_OOX_AMBUSH
);
87
break
;
88
case
64:
89
Talk
(
SAY_OOX_END
);
90
if
(
Player
* player =
GetPlayerForEscort
())
91
player->GroupEventHappens(
QUEST_RESQUE_OOX_09
,
me
);
92
break
;
93
}
94
}
95
96
void
WaypointStart
(
uint32
uiPointId)
OVERRIDE
97
{
98
switch
(uiPointId)
99
{
100
case
27:
101
for
(
uint8
i = 0; i < 3; ++i)
102
{
103
const
Position
src = {147.927444f, -3851.513428f, 130.893f, 0};
104
Position
dst;
105
me
->GetRandomPoint(src, 7.0f, dst);
106
DoSummon
(
NPC_MARAUDING_OWL
, dst, 25000,
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
);
107
}
108
break
;
109
case
44:
110
for
(
uint8
i = 0; i < 3; ++i)
111
{
112
const
Position
src = {-141.151581f, -4291.213867f, 120.130f, 0};
113
Position
dst;
114
me
->GetRandomPoint(src, 7.0f, dst);
115
me
->SummonCreature(
NPC_VILE_AMBUSHER
, dst,
TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN
, 25000);
116
}
117
break
;
118
}
119
}
120
121
void
EnterCombat
(
Unit
* who)
OVERRIDE
122
{
123
if
(who->GetEntry() ==
NPC_MARAUDING_OWL
|| who->GetEntry() ==
NPC_VILE_AMBUSHER
)
124
return
;
125
126
Talk
(
SAY_OOX_AGGRO
);
127
}
128
129
void
JustSummoned
(
Creature
* summoned)
OVERRIDE
130
{
131
summoned->GetMotionMaster()->MovePoint(0,
me
->GetPositionX(),
me
->GetPositionY(),
me
->GetPositionZ());
132
}
133
};
134
};
135
136
void
AddSC_hinterlands
()
137
{
138
new
npc_00x09hl
();
139
}
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
CAST_AI
#define CAST_AI(a, b)
Definition
ScriptedCreature.h:14
ScriptedEscortAI.h
ALLIANCE
@ ALLIANCE
Definition
SharedDefines.h:877
HORDE
@ HORDE
Definition
SharedDefines.h:876
UNIT_STAND_STATE_STAND
@ UNIT_STAND_STATE_STAND
Definition
Unit.h:162
CreatureAI
Definition
CreatureAI.h:54
CreatureAI::DoSummon
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition
CreatureAI.cpp:235
CreatureAI::Talk
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
Definition
CreatureAI.cpp:28
Creature
Definition
Creature.h:427
CreatureScript::CreatureScript
CreatureScript(const char *name)
Definition
ScriptMgr.cpp:1436
Player
Definition
Player.h:1289
Quest
Definition
QuestDef.h:255
Unit
Definition
Unit.h:1367
npc_00x09hl
Definition
zone_hinterlands.cpp:44
npc_00x09hl::OnQuestAccept
bool OnQuestAccept(Player *player, Creature *creature, const Quest *quest) OVERRIDE
Definition
zone_hinterlands.cpp:48
npc_00x09hl::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_hinterlands.cpp:67
npc_00x09hl::npc_00x09hl
npc_00x09hl()
Definition
zone_hinterlands.cpp:46
Position
Definition
Object.h:274
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
npc_00x09hl::npc_00x09hlAI
Definition
zone_hinterlands.cpp:73
npc_00x09hl::npc_00x09hlAI::npc_00x09hlAI
npc_00x09hlAI(Creature *creature)
Definition
zone_hinterlands.cpp:74
npc_00x09hl::npc_00x09hlAI::EnterCombat
void EnterCombat(Unit *who) OVERRIDE
Definition
zone_hinterlands.cpp:121
npc_00x09hl::npc_00x09hlAI::JustSummoned
void JustSummoned(Creature *summoned) OVERRIDE
Definition
zone_hinterlands.cpp:129
npc_00x09hl::npc_00x09hlAI::WaypointStart
void WaypointStart(uint32 uiPointId) OVERRIDE
Definition
zone_hinterlands.cpp:96
npc_00x09hl::npc_00x09hlAI::Reset
void Reset() OVERRIDE
Definition
zone_hinterlands.cpp:76
npc_00x09hl::npc_00x09hlAI::WaypointReached
void WaypointReached(uint32 waypointId) OVERRIDE
Definition
zone_hinterlands.cpp:78
npc_escortAI::GetPlayerForEscort
Player * GetPlayerForEscort()
Definition
ScriptedEscortAI.h:97
npc_escortAI::npc_escortAI
npc_escortAI(Creature *creature)
Definition
ScriptedEscortAI.cpp:24
AddSC_hinterlands
void AddSC_hinterlands()
Definition
zone_hinterlands.cpp:136
eOOX
eOOX
Definition
zone_hinterlands.cpp:27
FACTION_ESCORTEE_A
@ FACTION_ESCORTEE_A
Definition
zone_hinterlands.cpp:39
FACTION_ESCORTEE_H
@ FACTION_ESCORTEE_H
Definition
zone_hinterlands.cpp:40
SAY_OOX_AGGRO
@ SAY_OOX_AGGRO
Definition
zone_hinterlands.cpp:29
NPC_VILE_AMBUSHER
@ NPC_VILE_AMBUSHER
Definition
zone_hinterlands.cpp:37
SAY_OOX_END
@ SAY_OOX_END
Definition
zone_hinterlands.cpp:32
SAY_OOX_START
@ SAY_OOX_START
Definition
zone_hinterlands.cpp:28
QUEST_RESQUE_OOX_09
@ QUEST_RESQUE_OOX_09
Definition
zone_hinterlands.cpp:34
NPC_MARAUDING_OWL
@ NPC_MARAUDING_OWL
Definition
zone_hinterlands.cpp:36
SAY_OOX_AMBUSH
@ SAY_OOX_AMBUSH
Definition
zone_hinterlands.cpp:30
SAY_OOX_AMBUSH_REPLY
@ SAY_OOX_AMBUSH_REPLY
Definition
zone_hinterlands.cpp:31
src
server
scripts
EasternKingdoms
zone_hinterlands.cpp
Generated on
for Project SkyFire Core by
1.17.0