2009-02-17 18:08:26 +01:00
|
|
|
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
2008-10-21 13:19:26 -05: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-10-21 13:19:26 -05:00
|
|
|
/* ScriptData
|
|
|
|
|
SDName: Areatrigger_Scripts
|
|
|
|
|
SD%Complete: 100
|
|
|
|
|
SDComment: Scripts for areatriggers
|
|
|
|
|
SDCategory: Areatrigger
|
|
|
|
|
EndScriptData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
/* ContentData
|
2009-11-21 05:01:03 -08:00
|
|
|
at_coilfang_waterfall 4591
|
|
|
|
|
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
|
|
|
|
|
at_ravenholdt
|
|
|
|
|
at_warsong_slaughterhouse
|
|
|
|
|
at_warsong_grainery
|
|
|
|
|
at_torp_farm
|
2008-10-21 13:19:26 -05:00
|
|
|
EndContentData */
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
#include "ScriptedPch.h"
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-11-21 05:01:03 -08:00
|
|
|
/*######
|
|
|
|
|
## at_coilfang_waterfall
|
|
|
|
|
######*/
|
|
|
|
|
|
|
|
|
|
enum eCoilfangGOs
|
|
|
|
|
{
|
|
|
|
|
GO_COILFANG_WATERFALL = 184212
|
|
|
|
|
};
|
|
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
bool AreaTrigger_at_coilfang_waterfall(Player *pPlayer, const AreaTriggerEntry *pAt)
|
2009-11-21 05:01:03 -08:00
|
|
|
{
|
|
|
|
|
if (GameObject* pGo = GetClosestGameObjectWithEntry(pPlayer, GO_COILFANG_WATERFALL, 35.0f))
|
|
|
|
|
if (pGo->getLootState() == GO_READY)
|
|
|
|
|
pGo->UseDoorOrButton();
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-20 19:10:00 +01:00
|
|
|
/*#####
|
|
|
|
|
## at_legion_teleporter
|
|
|
|
|
#####*/
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-10-17 07:42:48 -07:00
|
|
|
enum eLegionTeleporter
|
2009-08-13 05:47:23 +02:00
|
|
|
{
|
|
|
|
|
SPELL_TELE_A_TO = 37387,
|
|
|
|
|
QUEST_GAINING_ACCESS_A = 10589,
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-13 05:47:23 +02:00
|
|
|
SPELL_TELE_H_TO = 37389,
|
|
|
|
|
QUEST_GAINING_ACCESS_H = 10604
|
|
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
bool AreaTrigger_at_legion_teleporter(Player *pPlayer, const AreaTriggerEntry *pAt)
|
2008-12-20 19:10:00 +01:00
|
|
|
{
|
2009-08-13 05:47:23 +02:00
|
|
|
if (pPlayer->isAlive() && !pPlayer->isInCombat())
|
2009-02-09 08:16:34 -05:00
|
|
|
{
|
2009-11-21 05:01:03 -08:00
|
|
|
if (pPlayer->GetTeam() == ALLIANCE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_A))
|
2009-02-09 08:16:34 -05:00
|
|
|
{
|
2009-11-21 05:01:03 -08:00
|
|
|
pPlayer->CastSpell(pPlayer, SPELL_TELE_A_TO, false);
|
2009-02-09 08:16:34 -05:00
|
|
|
return true;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-11-21 05:01:03 -08:00
|
|
|
if (pPlayer->GetTeam() == HORDE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_H))
|
2009-02-09 08:16:34 -05:00
|
|
|
{
|
2009-11-21 05:01:03 -08:00
|
|
|
pPlayer->CastSpell(pPlayer, SPELL_TELE_H_TO, false);
|
2009-02-09 08:16:34 -05:00
|
|
|
return true;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-02-09 08:16:34 -05:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
2008-12-20 19:10:00 +01:00
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-10-17 07:42:48 -07:00
|
|
|
enum eRavenholdt
|
2009-08-13 05:47:23 +02:00
|
|
|
{
|
|
|
|
|
QUEST_MANOR_RAVENHOLDT = 6681,
|
|
|
|
|
NPC_RAVENHOLDT = 13936
|
|
|
|
|
};
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2010-01-19 11:36:05 +01:00
|
|
|
bool AreaTrigger_at_ravenholdt(Player* pPlayer, const AreaTriggerEntry* pAt)
|
2009-08-13 05:47:23 +02:00
|
|
|
{
|
|
|
|
|
if (pPlayer->GetQuestStatus(QUEST_MANOR_RAVENHOLDT) == QUEST_STATUS_INCOMPLETE)
|
|
|
|
|
pPlayer->KilledMonsterCredit(NPC_RAVENHOLDT, 0);
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-13 05:47:23 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2008-10-21 13:19:26 -05:00
|
|
|
void AddSC_areatrigger_scripts()
|
|
|
|
|
{
|
|
|
|
|
Script *newscript;
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-11-21 05:01:03 -08:00
|
|
|
newscript = new Script;
|
|
|
|
|
newscript->Name = "at_coilfang_waterfall";
|
|
|
|
|
newscript->pAreaTrigger = &AreaTrigger_at_coilfang_waterfall;
|
|
|
|
|
newscript->RegisterSelf();
|
|
|
|
|
|
2009-02-09 08:16:34 -05:00
|
|
|
newscript = new Script;
|
|
|
|
|
newscript->Name = "at_legion_teleporter";
|
|
|
|
|
newscript->pAreaTrigger = &AreaTrigger_at_legion_teleporter;
|
|
|
|
|
newscript->RegisterSelf();
|
2009-10-17 15:51:44 -07:00
|
|
|
|
2009-08-13 05:47:23 +02:00
|
|
|
newscript = new Script;
|
|
|
|
|
newscript->Name = "at_ravenholdt";
|
|
|
|
|
newscript->pAreaTrigger = &AreaTrigger_at_ravenholdt;
|
|
|
|
|
newscript->RegisterSelf();
|
2008-10-21 13:19:26 -05:00
|
|
|
}
|
2009-02-17 20:07:49 -06:00
|
|
|
|