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

133 lines
3.9 KiB
C++
Raw Normal View History

2009-02-17 18:08:26 +01:00
/* 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.
*
* 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
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
2010-01-19 11:36:05 +01:00
#include "ScriptedPch.h"
#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 = -1000264,
SAY_PROGRESS_2 = -1000265,
SAY_PROGRESS_3 = -1000266,
EMOTE_PROGRESS_4 = -1000267,
SAY_AGGRO = -1000268,
SAY_PROGRESS_5 = -1000269,
SAY_PROGRESS_6 = -1000270,
SAY_PROGRESS_7 = -1000271,
EMOTE_PROGRESS_8 = -1000272,
SAY_PROGRESS_9 = -1000273,
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-02-05 00:31:28 +01:00
struct npc_professor_phizzlethorpeAI : public npc_escortAI
2008-12-27 21:29:09 +01:00
{
npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {}
2009-10-17 15:51:44 -07:00
2009-08-14 15:58:37 +02:00
void WaypointReached(uint32 uiPointId)
2009-02-12 09:23:56 -05:00
{
2009-08-17 00:29:53 +02:00
Player* pPlayer = GetPlayerForEscort();
2009-10-17 15:51:44 -07:00
2009-08-17 00:29:53 +02:00
if (!pPlayer)
return;
2009-10-17 15:51:44 -07:00
2009-08-14 15:58:37 +02:00
switch(uiPointId)
2009-02-12 09:23:56 -05:00
{
2010-04-14 23:07:41 +02:00
case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break;
case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
2009-02-12 09:23:56 -05:00
case 9:
{
2010-04-14 23:07:41 +02:00
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
2009-02-12 09:23:56 -05:00
break;
}
2010-04-14 23:07:41 +02:00
case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break;
2009-08-14 15:58:37 +02:00
case 11:
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_PROGRESS_6, me, pPlayer);
2009-08-14 15:58:37 +02:00
SetRun();
break;
2010-04-14 23:07:41 +02:00
case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break;
2009-02-12 09:23:56 -05:00
case 20:
2010-04-14 23:07:41 +02:00
DoScriptText(EMOTE_PROGRESS_8, me);
DoScriptText(SAY_PROGRESS_9, me, pPlayer);
2009-08-14 00:02:13 +02:00
if (pPlayer)
2010-04-14 23:07:41 +02:00
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
2009-02-12 09:23:56 -05:00
break;
}
}
2009-10-17 15:51:44 -07:00
2009-08-14 15:58:37 +02:00
void JustSummoned(Creature* pSummoned)
{
2010-04-14 23:07:41 +02:00
pSummoned->AI()->AttackStart(me);
}
2009-10-17 15:51:44 -07:00
2010-04-19 09:26:37 +02:00
void EnterCombat(Unit* /*pWho*/)
2009-02-12 09:23:56 -05:00
{
2010-04-14 23:07:41 +02:00
DoScriptText(SAY_AGGRO, me);
2009-02-12 09:23:56 -05:00
}
2009-10-17 15:51:44 -07:00
2009-02-12 09:23:56 -05:00
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
2008-12-27 21:29:09 +01:00
};
2009-10-17 15:51:44 -07:00
2009-08-14 15:58:37 +02:00
bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest)
2008-12-27 21:29:09 +01:00
{
2009-08-14 15:58:37 +02:00
if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE)
2008-12-27 21:29:09 +01:00
{
2009-08-14 04:21:52 +02:00
DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer);
if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI())))
2009-08-14 15:58:37 +02:00
pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest);
2009-10-17 15:51:44 -07:00
2009-08-14 04:21:52 +02:00
pCreature->setFaction(113);
2008-12-27 21:29:09 +01:00
}
return true;
}
2009-10-17 15:51:44 -07:00
2009-08-14 00:39:07 +02:00
CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature)
2008-12-27 21:29:09 +01:00
{
2009-08-16 02:12:14 +02:00
return new npc_professor_phizzlethorpeAI(pCreature);
2008-12-27 21:29:09 +01:00
}
2009-10-17 15:51:44 -07:00
2008-12-27 21:29:09 +01:00
void AddSC_arathi_highlands()
{
2009-02-12 09:23:56 -05:00
Script * newscript;
2009-10-17 15:51:44 -07:00
2009-02-12 09:23:56 -05:00
newscript = new Script;
newscript->Name = "npc_professor_phizzlethorpe";
newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI;
newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe;
newscript->RegisterSelf();
2009-02-09 14:28:01 -05:00
}