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

139 lines
4.2 KiB
C++
Raw Normal View History

/*
2012-01-01 00:32:13 +01:00
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
2008-12-27 21:29:09 +01: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.
2008-12-27 21:29:09 +01: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/>.
2008-12-27 21:29:09 +01:00
*/
2009-10-17 15:51:44 -07:00
2008-12-27 21:29:09 +01:00
/* ScriptData
SDName: Arathi Highlands
SD%Complete: 100
SDComment: Quest support: 665
SDCategory: Arathi Highlands
EndScriptData */
2009-10-17 15:51:44 -07:00
2008-12-27 21:29:09 +01:00
/* ContentData
npc_professor_phizzlethorpe
EndContentData */
2009-10-17 15:51:44 -07:00
#include "ScriptPCH.h"
2010-01-19 11:36:05 +01:00
#include "ScriptedEscortAI.h"
2009-10-17 15:51:44 -07:00
2008-12-27 21:29:09 +01:00
/*######
## npc_professor_phizzlethorpe
######*/
2009-10-17 15:51:44 -07:00
2009-10-17 07:42:48 -07:00
enum eEnums
2009-08-14 15:58:37 +02:00
{
SAY_PROGRESS_1 = 0,
SAY_PROGRESS_2 = 1,
SAY_PROGRESS_3 = 2,
EMOTE_PROGRESS_4 = 3,
SAY_AGGRO = 4,
SAY_PROGRESS_5 = 5,
SAY_PROGRESS_6 = 6,
SAY_PROGRESS_7 = 7,
EMOTE_PROGRESS_8 = 8,
SAY_PROGRESS_9 = 9,
2009-10-17 15:51:44 -07:00
2009-08-14 15:58:37 +02:00
QUEST_SUNKEN_TREASURE = 665,
MOB_VENGEFUL_SURGE = 2776
};
2009-10-17 15:51:44 -07:00
2010-08-08 13:48:01 +02:00
class npc_professor_phizzlethorpe : public CreatureScript
2008-12-27 21:29:09 +01:00
{
2010-08-08 13:48:01 +02:00
public:
2009-10-17 15:51:44 -07:00
2010-08-08 13:48:01 +02:00
npc_professor_phizzlethorpe()
: CreatureScript("npc_professor_phizzlethorpe")
{
}
2009-10-17 15:51:44 -07:00
2010-08-08 13:48:01 +02:00
struct npc_professor_phizzlethorpeAI : public npc_escortAI
2009-02-12 09:23:56 -05:00
{
npc_professor_phizzlethorpeAI(Creature* c) : npc_escortAI(c) {}
2010-08-08 13:48:01 +02:00
void WaypointReached(uint32 uiPointId)
{
Player* player = GetPlayerForEscort();
2010-08-08 13:48:01 +02:00
if (!player)
2010-08-08 13:48:01 +02:00
return;
2011-09-29 12:43:05 +02:00
switch (uiPointId)
2010-08-08 13:48:01 +02:00
{
case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break;
case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break;
case 8:Talk(EMOTE_PROGRESS_4);break;
2010-08-08 13:48:01 +02:00
case 9:
{
2010-08-22 23:46:40 +06:00
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
2010-08-08 13:48:01 +02:00
break;
}
case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break;
2010-08-08 13:48:01 +02:00
case 11:
Talk(SAY_PROGRESS_6, player->GetGUID());
2010-08-08 13:48:01 +02:00
SetRun();
break;
case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break;
2010-08-08 13:48:01 +02:00
case 20:
Talk(EMOTE_PROGRESS_8);
Talk(SAY_PROGRESS_9, player->GetGUID());
if (player)
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
2010-08-08 13:48:01 +02:00
break;
}
}
void JustSummoned(Creature* summoned)
2010-08-08 13:48:01 +02:00
{
summoned->AI()->AttackStart(me);
2010-08-08 13:48:01 +02:00
}
void EnterCombat(Unit* /*who*/)
2010-08-08 13:48:01 +02:00
{
Talk(SAY_AGGRO);
2010-08-08 13:48:01 +02:00
}
void UpdateAI(const uint32 diff)
2009-02-12 09:23:56 -05:00
{
2010-08-08 13:48:01 +02:00
npc_escortAI::UpdateAI(diff);
2009-02-12 09:23:56 -05:00
}
2010-08-08 13:48:01 +02:00
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_professor_phizzlethorpeAI(creature);
2009-02-12 09:23:56 -05:00
}
2009-10-17 15:51:44 -07:00
2010-08-08 13:48:01 +02:00
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
{
creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID());
2010-08-08 13:48:01 +02:00
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
pEscortAI->Start(false, false, player->GetGUID(), quest);
2009-10-17 15:51:44 -07:00
2010-08-08 13:48:01 +02:00
creature->setFaction(113);
}
return true;
}
};
2009-10-17 15:51:44 -07:00
2008-12-27 21:29:09 +01:00
void AddSC_arathi_highlands()
{
2010-08-08 13:48:01 +02:00
new npc_professor_phizzlethorpe();
2009-02-09 14:28:01 -05:00
}