Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: Arathi Highlands
8SD%Complete: 100
9SDComment: Quest support: 665
10SDCategory: Arathi Highlands
11EndScriptData */
12
13/* ContentData
14npc_professor_phizzlethorpe
15EndContentData */
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
51
53{
54public:
55 npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { }
56
58 {
60
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:
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
90 {
91 summoned->AI()->AttackStart(me);
92 }
93
94 void EnterCombat(Unit* /*who*/) OVERRIDE
95 {
97 }
98
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:
120 Talk(SAY_PROGRESS_9, player);
122 break;
123 }
124 }
126 }
127
129 };
130
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
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_CORPSE_DESPAWN
Definition Object.h:72
#define CAST_AI(a, b)
#define SAY_AGGRO
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureScript(const char *name)
void GroupEventHappens(uint32 questId, WorldObject const *pEventObject)
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
bool OnQuestAccept(Player *player, Creature *creature, Quest const *quest) OVERRIDE
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
Player * GetPlayerForEscort()
void SetRun(bool on=true)
npc_escortAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void AddSC_arathi_highlands()
@ QUEST_GOGGLE_BOGGLE
@ QUEST_SUNKEN_TREASURE
@ NPC_VENGEFUL_SURGE