Project SkyFire Core
SkyFire 5.4.8 server core API documentation
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
7SDName: Hinterlands
8SD%Complete: 100
9SDComment: Quest support: 836
10SDCategory: The Hinterlands
11EndScriptData */
12
13/* ContentData
14npc_00x09hl
15EndContentData */
16
17#include "ScriptMgr.h"
18#include "ScriptedCreature.h"
19#include "ScriptedEscortAI.h"
20#include "Player.h"
21
22/*######
23## npc_00x09hl
24######*/
25
42
44{
45public:
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
68 {
69 return new npc_00x09hlAI(creature);
70 }
71
73 {
74 npc_00x09hlAI(Creature* creature) : npc_escortAI(creature) { }
75
76 void Reset() OVERRIDE { }
77
79 {
80 switch (waypointId)
81 {
82 case 26:
84 break;
85 case 43:
87 break;
88 case 64:
90 if (Player* player = GetPlayerForEscort())
91 player->GroupEventHappens(QUEST_RESQUE_OOX_09, me);
92 break;
93 }
94 }
95
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);
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);
116 }
117 break;
118 }
119 }
120
122 {
123 if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
124 return;
125
127 }
128
130 {
131 summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
132 }
133 };
134};
135
137{
138 new npc_00x09hl();
139}
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:73
#define CAST_AI(a, b)
@ ALLIANCE
@ HORDE
@ UNIT_STAND_STATE_STAND
Definition Unit.h:162
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureScript(const char *name)
Definition Unit.h:1367
bool OnQuestAccept(Player *player, Creature *creature, const Quest *quest) OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
npc_00x09hlAI(Creature *creature)
void EnterCombat(Unit *who) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
void WaypointStart(uint32 uiPointId) OVERRIDE
void WaypointReached(uint32 waypointId) OVERRIDE
Player * GetPlayerForEscort()
npc_escortAI(Creature *creature)
void AddSC_hinterlands()
@ FACTION_ESCORTEE_A
@ FACTION_ESCORTEE_H
@ SAY_OOX_AGGRO
@ NPC_VILE_AMBUSHER
@ SAY_OOX_END
@ SAY_OOX_START
@ QUEST_RESQUE_OOX_09
@ NPC_MARAUDING_OWL
@ SAY_OOX_AMBUSH
@ SAY_OOX_AMBUSH_REPLY