Files
TCPlayerbotCore/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
T

142 lines
4.2 KiB
C++
Raw Normal View History

/*
2014-01-01 00:07:53 +01:00
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2009-08-14 17:14:08 +02:00
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
2009-08-14 17:14:08 +02:00
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
2009-08-14 17:14:08 +02:00
*/
2009-10-17 15:51:44 -07:00
2009-08-14 17:14:08 +02:00
/* ScriptData
SDName: Hinterlands
SD%Complete: 100
SDComment: Quest support: 836
2009-08-14 17:14:08 +02:00
SDCategory: The Hinterlands
EndScriptData */
2009-10-17 15:51:44 -07:00
2009-08-14 17:14:08 +02:00
/* ContentData
2013-12-24 17:56:38 -03:30
npc_oox09hl
2009-08-14 17:14:08 +02:00
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
2010-01-19 11:36:05 +01:00
#include "ScriptedEscortAI.h"
#include "Player.h"
2009-10-17 15:51:44 -07:00
2009-08-16 22:21:57 +02:00
/*######
2013-12-24 17:56:38 -03:30
## npc_oox09hl
2009-08-16 22:21:57 +02:00
######*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eOOX
2009-08-16 22:21:57 +02:00
{
SAY_OOX_START = 0,
SAY_OOX_AGGRO = 1,
SAY_OOX_AMBUSH = 2,
SAY_OOX_AMBUSH_REPLY = 3,
SAY_OOX_END = 4,
2009-08-16 22:21:57 +02:00
QUEST_RESQUE_OOX_09 = 836,
NPC_MARAUDING_OWL = 7808,
NPC_VILE_AMBUSHER = 7809,
FACTION_ESCORTEE_A = 774,
FACTION_ESCORTEE_H = 775
};
2013-12-24 17:56:38 -03:30
class npc_oox09hl : public CreatureScript
2009-08-16 22:21:57 +02:00
{
2010-08-08 22:54:58 +06:00
public:
2013-12-24 17:56:38 -03:30
npc_oox09hl() : CreatureScript("npc_oox09hl") { }
2009-10-17 15:51:44 -07:00
2013-12-24 17:56:38 -03:30
struct npc_oox09hlAI : public npc_escortAI
2009-08-16 22:21:57 +02:00
{
2013-12-24 17:56:38 -03:30
npc_oox09hlAI(Creature* creature) : npc_escortAI(creature) { }
2010-08-08 22:54:58 +06:00
2013-12-24 13:40:27 -03:30
void Reset() OVERRIDE { }
2010-08-08 22:54:58 +06:00
2013-12-24 13:40:27 -03:30
void EnterCombat(Unit* who) OVERRIDE
{
if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER)
return;
2010-08-08 22:54:58 +06:00
2013-12-24 13:40:27 -03:30
Talk(SAY_OOX_AGGRO);
2009-08-16 22:21:57 +02:00
}
2009-10-17 15:51:44 -07:00
2013-12-24 13:40:27 -03:30
void JustSummoned(Creature* summoned) OVERRIDE
{
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
2009-10-17 15:51:44 -07:00
2013-12-24 13:40:27 -03:30
void sQuestAccept(Player* player, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
me->SetStandState(UNIT_STAND_STATE_STAND);
me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
2013-12-24 13:40:27 -03:30
Talk(SAY_OOX_START, player);
npc_escortAI::Start(false, false, player->GetGUID(), quest);
}
}
2009-10-17 15:51:44 -07:00
2012-03-29 15:44:24 +08:00
void WaypointReached(uint32 waypointId)
2010-08-08 22:54:58 +06:00
{
2012-03-29 15:44:24 +08:00
switch (waypointId)
2010-08-08 22:54:58 +06:00
{
case 26:
Talk(SAY_OOX_AMBUSH);
2010-08-08 22:54:58 +06:00
break;
case 43:
Talk(SAY_OOX_AMBUSH);
2010-08-08 22:54:58 +06:00
break;
case 64:
Talk(SAY_OOX_END);
if (Player* player = GetPlayerForEscort())
player->GroupEventHappens(QUEST_RESQUE_OOX_09, me);
2010-08-08 22:54:58 +06:00
break;
}
}
2009-10-17 15:51:44 -07:00
2013-12-24 13:40:27 -03:30
void WaypointStart(uint32 pointId) OVERRIDE
2010-08-08 22:54:58 +06:00
{
2013-12-24 13:40:27 -03:30
switch (pointId)
2010-08-08 22:54:58 +06:00
{
case 27:
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {147.927444f, -3851.513428f, 130.893f, 0};
Position dst;
me->GetRandomPoint(src, 7.0f, dst);
DoSummon(NPC_MARAUDING_OWL, dst, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
}
break;
case 44:
for (uint8 i = 0; i < 3; ++i)
{
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
Position dst;
me->GetRandomPoint(src, 7.0f, dst);
me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
}
}
};
2013-12-24 13:40:27 -03:30
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
2013-12-24 17:56:38 -03:30
return new npc_oox09hlAI(creature);
2013-12-24 13:40:27 -03:30
}
2010-08-08 22:54:58 +06:00
};
2009-10-17 15:51:44 -07:00
2009-08-14 17:14:08 +02:00
void AddSC_hinterlands()
{
2013-12-24 17:56:38 -03:30
new npc_oox09hl();
2009-08-14 17:14:08 +02:00
}