Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_silverpine_forest.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: Silverpine_Forest
8
SD%Complete: 100
9
SDComment: Quest support: 435
10
SDCategory: Silverpine Forest
11
EndScriptData */
12
13
/* ContentData
14
npc_deathstalker_erland
15
EndContentData */
16
17
#include "
ScriptMgr.h
"
18
#include "
ScriptedCreature.h
"
19
#include "
ScriptedEscortAI.h
"
20
#include "
Player.h
"
21
22
/*######
23
## npc_deathstalker_erland
24
######*/
25
26
enum
eErland
27
{
28
SAY_QUESTACCEPT
= 0,
29
SAY_START
= 1,
30
SAY_AGGRO
= 2,
31
SAY_PROGRESS
= 3,
32
SAY_LAST
= 4,
33
34
SAY_RANE
= 0,
35
SAY_RANE_ANSWER
= 5,
36
SAY_MOVE_QUINN
= 6,
37
38
SAY_QUINN
= 7,
39
SAY_QUINN_ANSWER
= 0,
40
SAY_BYE
= 8,
41
42
QUEST_ESCORTING
= 435,
43
NPC_RANE
= 1950,
44
NPC_QUINN
= 1951
45
};
46
47
class
npc_deathstalker_erland
:
public
CreatureScript
48
{
49
public
:
50
npc_deathstalker_erland
() :
CreatureScript
(
"npc_deathstalker_erland"
) { }
51
52
struct
npc_deathstalker_erlandAI
:
public
npc_escortAI
53
{
54
npc_deathstalker_erlandAI
(
Creature
* creature) :
npc_escortAI
(creature) { }
55
56
void
WaypointReached
(
uint32
waypointId)
OVERRIDE
57
{
58
Player
* player =
GetPlayerForEscort
();
59
if
(!player)
60
return
;
61
62
switch
(waypointId)
63
{
64
case
1:
65
Talk
(
SAY_START
, player);
66
break
;
67
case
10:
68
Talk
(
SAY_PROGRESS
);
69
break
;
70
case
13:
71
Talk
(
SAY_LAST
, player);
72
player->
GroupEventHappens
(
QUEST_ESCORTING
,
me
);
73
break
;
74
case
15:
75
if
(
Creature
* rane =
me
->FindNearestCreature(
NPC_RANE
, 20.0f))
76
rane->AI()->Talk(
SAY_RANE
);
77
break
;
78
case
16:
79
Talk
(
SAY_RANE_ANSWER
);
80
break
;
81
case
17:
82
Talk
(
SAY_MOVE_QUINN
);
83
break
;
84
case
24:
85
Talk
(
SAY_QUINN
);
86
break
;
87
case
25:
88
if
(
Creature
* quinn =
me
->FindNearestCreature(
NPC_QUINN
, 20.0f))
89
quinn->AI()->Talk(
SAY_QUINN_ANSWER
);
90
break
;
91
case
26:
92
Talk
(
SAY_BYE
);
93
break
;
94
}
95
}
96
97
void
Reset
()
OVERRIDE
{ }
98
99
void
EnterCombat
(
Unit
* who)
OVERRIDE
100
{
101
Talk
(
SAY_AGGRO
, who);
102
}
103
};
104
105
bool
OnQuestAccept
(
Player
* player,
Creature
* creature,
Quest
const
* quest)
OVERRIDE
106
{
107
if
(quest->GetQuestId() ==
QUEST_ESCORTING
)
108
{
109
creature->AI()->Talk(
SAY_QUESTACCEPT
, player);
110
111
if
(
npc_escortAI
* pEscortAI =
CAST_AI
(
npc_deathstalker_erland::npc_deathstalker_erlandAI
, creature->AI()))
112
pEscortAI->Start(
true
,
false
, player->GetGUID());
113
}
114
115
return
true
;
116
}
117
118
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
119
{
120
return
new
npc_deathstalker_erlandAI
(creature);
121
}
122
};
123
124
/*######
125
## AddSC
126
######*/
127
128
void
AddSC_silverpine_forest
()
129
{
130
new
npc_deathstalker_erland
();
131
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
Player.h
ScriptMgr.h
ScriptedCreature.h
CAST_AI
#define CAST_AI(a, b)
Definition
ScriptedCreature.h:14
ScriptedEscortAI.h
SAY_AGGRO
#define SAY_AGGRO
Definition
boss_commander_kolurg.cpp:28
CreatureAI
Definition
CreatureAI.h:54
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
Player::GroupEventHappens
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition
PlayerQuestState.cpp:1593
Quest
Definition
QuestDef.h:255
Unit
Definition
Unit.h:1367
npc_deathstalker_erland
Definition
zone_silverpine_forest.cpp:48
npc_deathstalker_erland::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_silverpine_forest.cpp:118
npc_deathstalker_erland::OnQuestAccept
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
Definition
zone_silverpine_forest.cpp:105
npc_deathstalker_erland::npc_deathstalker_erland
npc_deathstalker_erland()
Definition
zone_silverpine_forest.cpp:50
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
npc_deathstalker_erland::npc_deathstalker_erlandAI
Definition
zone_silverpine_forest.cpp:53
npc_deathstalker_erland::npc_deathstalker_erlandAI::EnterCombat
void EnterCombat(Unit *who) OVERRIDE
Definition
zone_silverpine_forest.cpp:99
npc_deathstalker_erland::npc_deathstalker_erlandAI::npc_deathstalker_erlandAI
npc_deathstalker_erlandAI(Creature *creature)
Definition
zone_silverpine_forest.cpp:54
npc_deathstalker_erland::npc_deathstalker_erlandAI::WaypointReached
void WaypointReached(uint32 waypointId) OVERRIDE
Definition
zone_silverpine_forest.cpp:56
npc_deathstalker_erland::npc_deathstalker_erlandAI::Reset
void Reset() OVERRIDE
Definition
zone_silverpine_forest.cpp:97
npc_escortAI
Definition
ScriptedEscortAI.h:41
npc_escortAI::GetPlayerForEscort
Player * GetPlayerForEscort()
Definition
ScriptedEscortAI.h:97
npc_escortAI::npc_escortAI
npc_escortAI(Creature *creature)
Definition
ScriptedEscortAI.cpp:24
SAY_START
@ SAY_START
Definition
zone_ghostlands.cpp:66
AddSC_silverpine_forest
void AddSC_silverpine_forest()
Definition
zone_silverpine_forest.cpp:128
eErland
eErland
Definition
zone_silverpine_forest.cpp:27
SAY_PROGRESS
@ SAY_PROGRESS
Definition
zone_silverpine_forest.cpp:31
SAY_START
@ SAY_START
Definition
zone_silverpine_forest.cpp:29
SAY_LAST
@ SAY_LAST
Definition
zone_silverpine_forest.cpp:32
SAY_AGGRO
@ SAY_AGGRO
Definition
zone_silverpine_forest.cpp:30
SAY_QUINN_ANSWER
@ SAY_QUINN_ANSWER
Definition
zone_silverpine_forest.cpp:39
SAY_MOVE_QUINN
@ SAY_MOVE_QUINN
Definition
zone_silverpine_forest.cpp:36
QUEST_ESCORTING
@ QUEST_ESCORTING
Definition
zone_silverpine_forest.cpp:42
NPC_QUINN
@ NPC_QUINN
Definition
zone_silverpine_forest.cpp:44
SAY_RANE
@ SAY_RANE
Definition
zone_silverpine_forest.cpp:34
SAY_RANE_ANSWER
@ SAY_RANE_ANSWER
Definition
zone_silverpine_forest.cpp:35
SAY_BYE
@ SAY_BYE
Definition
zone_silverpine_forest.cpp:40
NPC_RANE
@ NPC_RANE
Definition
zone_silverpine_forest.cpp:43
SAY_QUESTACCEPT
@ SAY_QUESTACCEPT
Definition
zone_silverpine_forest.cpp:28
SAY_QUINN
@ SAY_QUINN
Definition
zone_silverpine_forest.cpp:38
src
server
scripts
EasternKingdoms
zone_silverpine_forest.cpp
Generated on
for Project SkyFire Core by
1.17.0