Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
zone_arathi_highlands.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: Arathi Highlands
8
SD%Complete: 100
9
SDComment: Quest support: 665
10
SDCategory: Arathi Highlands
11
EndScriptData */
12
13
/* ContentData
14
npc_professor_phizzlethorpe
15
EndContentData */
16
17
#include "
ScriptMgr.h
"
18
#include "
ScriptedCreature.h
"
19
#include "
ScriptedEscortAI.h
"
20
#include "
Player.h
"
21
22
/*######
23
## npc_professor_phizzlethorpe
24
######*/
25
26
enum
ProfessorPhizzlethorpe
27
{
28
// Yells
29
SAY_PROGRESS_1
= 0,
30
SAY_PROGRESS_2
= 1,
31
SAY_PROGRESS_3
= 2,
32
EMOTE_PROGRESS_4
= 3,
33
SAY_AGGRO
= 4,
34
SAY_PROGRESS_5
= 5,
35
SAY_PROGRESS_6
= 6,
36
SAY_PROGRESS_7
= 7,
37
EMOTE_PROGRESS_8
= 8,
38
SAY_PROGRESS_9
= 9,
39
40
EVENT_SAY_3
= 1,
41
EVENT_SAY_6
= 2,
42
EVENT_SAY_8
= 3,
43
44
// Quests
45
QUEST_SUNKEN_TREASURE
= 665,
46
QUEST_GOGGLE_BOGGLE
= 26050,
47
48
// Creatures
49
NPC_VENGEFUL_SURGE
= 2776
50
};
51
52
class
npc_professor_phizzlethorpe
:
public
CreatureScript
53
{
54
public
:
55
npc_professor_phizzlethorpe
() :
CreatureScript
(
"npc_professor_phizzlethorpe"
) { }
56
57
struct
npc_professor_phizzlethorpeAI
:
public
npc_escortAI
58
{
59
npc_professor_phizzlethorpeAI
(
Creature
* creature) :
npc_escortAI
(creature) { }
60
61
void
WaypointReached
(
uint32
waypointId)
OVERRIDE
62
{
63
Player
* player =
GetPlayerForEscort
();
64
if
(!player)
65
return
;
66
67
switch
(waypointId)
68
{
69
case
6:
70
Talk
(
SAY_PROGRESS_2
, player);
71
events
.ScheduleEvent(
EVENT_SAY_3
, 3000);
72
break
;
73
case
8:
74
Talk
(
EMOTE_PROGRESS_4
);
75
me
->SummonCreature(
NPC_VENGEFUL_SURGE
, -2065.505f, -2136.88f, 22.20362f, 1.0f,
TempSummonType::TEMPSUMMON_CORPSE_DESPAWN
, 0);
76
me
->SummonCreature(
NPC_VENGEFUL_SURGE
, -2059.249f, -2134.88f, 21.51582f, 1.0f,
TempSummonType::TEMPSUMMON_CORPSE_DESPAWN
, 0);
77
break
;
78
case
11:
79
Talk
(
SAY_PROGRESS_5
, player);
80
events
.ScheduleEvent(
EVENT_SAY_6
, 11000);
81
break
;
82
case
17:
83
Talk
(
SAY_PROGRESS_7
, player);
84
events
.ScheduleEvent(
EVENT_SAY_8
, 6000);
85
break
;
86
}
87
}
88
89
void
JustSummoned
(
Creature
* summoned)
OVERRIDE
90
{
91
summoned->AI()->AttackStart(
me
);
92
}
93
94
void
EnterCombat
(
Unit
*
/*who*/
)
OVERRIDE
95
{
96
Talk
(
SAY_AGGRO
);
97
}
98
99
void
UpdateAI
(
uint32
diff)
OVERRIDE
100
{
101
Player
* player =
GetPlayerForEscort
();
102
if
(!player)
103
return
;
104
105
events
.Update(diff);
106
107
while
(
uint32
event =
events
.ExecuteEvent())
108
{
109
switch
(event)
110
{
111
case
EVENT_SAY_3
:
112
Talk
(
SAY_PROGRESS_3
, player);
113
break
;
114
case
EVENT_SAY_6
:
115
Talk
(
SAY_PROGRESS_6
, player);
116
SetRun
();
117
break
;
118
case
EVENT_SAY_8
:
119
Talk
(
EMOTE_PROGRESS_8
);
120
Talk
(
SAY_PROGRESS_9
, player);
121
player->
GroupEventHappens
(
QUEST_GOGGLE_BOGGLE
,
me
);
122
break
;
123
}
124
}
125
npc_escortAI::UpdateAI
(diff);
126
}
127
128
EventMap
events
;
129
};
130
131
CreatureAI
*
GetAI
(
Creature
* creature)
const
OVERRIDE
132
{
133
return
new
npc_professor_phizzlethorpeAI
(creature);
134
}
135
136
bool
OnQuestAccept
(
Player
* player,
Creature
* creature,
Quest
const
* quest)
OVERRIDE
137
{
138
if
(quest->GetQuestId() ==
QUEST_GOGGLE_BOGGLE
)
139
{
140
creature->AI()->Talk(
SAY_PROGRESS_1
, player);
141
if
(
npc_escortAI
* pEscortAI =
CAST_AI
(
npc_professor_phizzlethorpeAI
, (creature->AI())))
142
pEscortAI->Start(
false
,
false
, player->GetGUID(), quest);
143
144
creature->setFaction(42);
145
}
146
return
true
;
147
}
148
};
149
150
void
AddSC_arathi_highlands
()
151
{
152
new
npc_professor_phizzlethorpe
();
153
}
uint32
std::uint32_t uint32
Definition
Define.h:77
OVERRIDE
#define OVERRIDE
Definition
Define.h:60
TempSummonType::TEMPSUMMON_CORPSE_DESPAWN
@ TEMPSUMMON_CORPSE_DESPAWN
Definition
Object.h:72
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
EventMap
Definition
CreatureAIImpl.h:304
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_professor_phizzlethorpe
Definition
zone_arathi_highlands.cpp:53
npc_professor_phizzlethorpe::GetAI
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Definition
zone_arathi_highlands.cpp:131
npc_professor_phizzlethorpe::OnQuestAccept
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
Definition
zone_arathi_highlands.cpp:136
npc_professor_phizzlethorpe::npc_professor_phizzlethorpe
npc_professor_phizzlethorpe()
Definition
zone_arathi_highlands.cpp:55
ScriptedAI::me
Creature * me
Definition
ScriptedCreature.h:182
npc_escortAI
Definition
ScriptedEscortAI.h:41
npc_escortAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
ScriptedEscortAI.cpp:209
npc_escortAI::GetPlayerForEscort
Player * GetPlayerForEscort()
Definition
ScriptedEscortAI.h:97
npc_escortAI::SetRun
void SetRun(bool on=true)
Definition
ScriptedEscortAI.cpp:399
npc_escortAI::npc_escortAI
npc_escortAI(Creature *creature)
Definition
ScriptedEscortAI.cpp:24
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI
Definition
zone_arathi_highlands.cpp:58
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::WaypointReached
void WaypointReached(uint32 waypointId) OVERRIDE
Definition
zone_arathi_highlands.cpp:61
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::events
EventMap events
Definition
zone_arathi_highlands.cpp:128
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::EnterCombat
void EnterCombat(Unit *) OVERRIDE
Definition
zone_arathi_highlands.cpp:94
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::npc_professor_phizzlethorpeAI
npc_professor_phizzlethorpeAI(Creature *creature)
Definition
zone_arathi_highlands.cpp:59
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::UpdateAI
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Definition
zone_arathi_highlands.cpp:99
npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::JustSummoned
void JustSummoned(Creature *summoned) OVERRIDE
Definition
zone_arathi_highlands.cpp:89
AddSC_arathi_highlands
void AddSC_arathi_highlands()
Definition
zone_arathi_highlands.cpp:150
ProfessorPhizzlethorpe
ProfessorPhizzlethorpe
Definition
zone_arathi_highlands.cpp:27
EVENT_SAY_3
@ EVENT_SAY_3
Definition
zone_arathi_highlands.cpp:40
EMOTE_PROGRESS_8
@ EMOTE_PROGRESS_8
Definition
zone_arathi_highlands.cpp:37
SAY_PROGRESS_9
@ SAY_PROGRESS_9
Definition
zone_arathi_highlands.cpp:38
EVENT_SAY_6
@ EVENT_SAY_6
Definition
zone_arathi_highlands.cpp:41
SAY_PROGRESS_3
@ SAY_PROGRESS_3
Definition
zone_arathi_highlands.cpp:31
EMOTE_PROGRESS_4
@ EMOTE_PROGRESS_4
Definition
zone_arathi_highlands.cpp:32
SAY_PROGRESS_6
@ SAY_PROGRESS_6
Definition
zone_arathi_highlands.cpp:35
SAY_AGGRO
@ SAY_AGGRO
Definition
zone_arathi_highlands.cpp:33
QUEST_GOGGLE_BOGGLE
@ QUEST_GOGGLE_BOGGLE
Definition
zone_arathi_highlands.cpp:46
EVENT_SAY_8
@ EVENT_SAY_8
Definition
zone_arathi_highlands.cpp:42
QUEST_SUNKEN_TREASURE
@ QUEST_SUNKEN_TREASURE
Definition
zone_arathi_highlands.cpp:45
SAY_PROGRESS_2
@ SAY_PROGRESS_2
Definition
zone_arathi_highlands.cpp:30
SAY_PROGRESS_7
@ SAY_PROGRESS_7
Definition
zone_arathi_highlands.cpp:36
NPC_VENGEFUL_SURGE
@ NPC_VENGEFUL_SURGE
Definition
zone_arathi_highlands.cpp:49
SAY_PROGRESS_1
@ SAY_PROGRESS_1
Definition
zone_arathi_highlands.cpp:29
SAY_PROGRESS_5
@ SAY_PROGRESS_5
Definition
zone_arathi_highlands.cpp:34
src
server
scripts
EasternKingdoms
zone_arathi_highlands.cpp
Generated on
for Project SkyFire Core by
1.17.0