mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
* OutdoorPvP implementations now reside in the script library.
--HG-- branch : trunk rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPEP.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPEP.h => src/server/scripts/OutdoorPvP/OutdoorPvPEP.h rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPHP.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPHP.h => src/server/scripts/OutdoorPvP/OutdoorPvPHP.h rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPNA.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPNA.h => src/server/scripts/OutdoorPvP/OutdoorPvPNA.h rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPSI.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPSI.h => src/server/scripts/OutdoorPvP/OutdoorPvPSI.h rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPTF.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPTF.h => src/server/scripts/OutdoorPvP/OutdoorPvPTF.h rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPZM.cpp => src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp rename : src/server/game/OutdoorPvP/Zones/OutdoorPvPZM.h => src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
This commit is contained in:
@@ -17,12 +17,6 @@
|
||||
*/
|
||||
|
||||
#include "OutdoorPvPMgr.h"
|
||||
#include "OutdoorPvPHP.h"
|
||||
#include "OutdoorPvPNA.h"
|
||||
#include "OutdoorPvPTF.h"
|
||||
#include "OutdoorPvPZM.h"
|
||||
#include "OutdoorPvPSI.h"
|
||||
#include "OutdoorPvPEP.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ProgressBar.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "ScriptLoader.h"
|
||||
|
||||
#ifdef SCRIPTS
|
||||
//custom
|
||||
|
||||
//examples
|
||||
void AddSC_example_creature();
|
||||
@@ -527,6 +526,17 @@ void AddSC_shaman_spell_scripts();
|
||||
void AddSC_warlock_spell_scripts();
|
||||
void AddSC_warrior_spell_scripts();
|
||||
void AddSC_example_spell_scripts();
|
||||
|
||||
// battlegrounds
|
||||
|
||||
// outdoor pvp
|
||||
void AddSC_outdoorpvp_ep();
|
||||
void AddSC_outdoorpvp_hp();
|
||||
void AddSC_outdoorpvp_na();
|
||||
void AddSC_outdoorpvp_si();
|
||||
void AddSC_outdoorpvp_tf();
|
||||
void AddSC_outdoorpvp_zm();
|
||||
|
||||
#endif
|
||||
|
||||
void AddScripts()
|
||||
@@ -539,6 +549,8 @@ void AddScripts()
|
||||
AddKalimdorScripts();
|
||||
AddOutlandScripts();
|
||||
AddNorthrendScripts();
|
||||
AddBattlegroundScripts();
|
||||
AddOutdoorPvPScripts();
|
||||
AddCustomScripts();
|
||||
#endif
|
||||
}
|
||||
@@ -1079,9 +1091,33 @@ void AddNorthrendScripts()
|
||||
#endif
|
||||
}
|
||||
|
||||
void AddOutdoorPvPScripts()
|
||||
{
|
||||
#ifdef SCRIPTS
|
||||
AddSC_outdoorpvp_ep();
|
||||
AddSC_outdoorpvp_hp();
|
||||
AddSC_outdoorpvp_na();
|
||||
AddSC_outdoorpvp_si();
|
||||
AddSC_outdoorpvp_tf();
|
||||
AddSC_outdoorpvp_zm();
|
||||
#endif SCRIPTS
|
||||
}
|
||||
|
||||
void AddBattlegroundScripts()
|
||||
{
|
||||
#ifdef SCRIPTS
|
||||
#endif SCRIPTS
|
||||
}
|
||||
|
||||
#ifdef SCRIPTS
|
||||
/* This is where custom scripts' loading functions should be declared. */
|
||||
|
||||
#endif SCRIPTS
|
||||
|
||||
void AddCustomScripts()
|
||||
{
|
||||
#ifdef SCRIPTS
|
||||
/* This is where custom scripts should be added. */
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ void AddEasternKingdomsScripts();
|
||||
void AddKalimdorScripts();
|
||||
void AddOutlandScripts();
|
||||
void AddNorthrendScripts();
|
||||
void AddBattlegroundScripts();
|
||||
void AddOutdoorPvPScripts();
|
||||
void AddCustomScripts();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
/* Copyright (C) 2006 - 2008 TrinityScript <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software licensed under GPL version 2
|
||||
* Please see the included DOCS/LICENSE.TXT for more information */
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "ScriptPCH.h"
|
||||
#include "Config.h"
|
||||
@@ -1149,7 +1165,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
|
||||
|
||||
// See if the script is using the same memory as another script. If this happens, it means that
|
||||
// someone forgot to allocate new memory for a script.
|
||||
for (ScriptMap::iterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
|
||||
for (ScriptMapIterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
|
||||
{
|
||||
if (it->second == script)
|
||||
{
|
||||
@@ -1169,7 +1185,7 @@ void ScriptMgr::ScriptRegistry<TScript>::AddScript(TScript* const script)
|
||||
{
|
||||
// Try to find an existing script.
|
||||
bool existing = false;
|
||||
for (ScriptMap::iterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
|
||||
for (ScriptMapIterator it = ScriptPointerList.begin(); it != ScriptPointerList.end(); ++it)
|
||||
{
|
||||
// If the script names match...
|
||||
if (it->second->GetName() == script->GetName())
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
/* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Thanks to the original authors: ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software licensed under GPL version 2
|
||||
* Please see the included DOCS/LICENSE.TXT for more information */
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef SC_SCRIPTMGR_H
|
||||
#define SC_SCRIPTMGR_H
|
||||
@@ -408,7 +421,7 @@ class InstanceMapScript : public ScriptObject, public MapScript<InstanceMap>
|
||||
bool IsDatabaseBound() const { return true; }
|
||||
|
||||
// Gets an InstanceData object for this instance.
|
||||
virtual InstanceData* GetInstanceData(InstanceMap* map) { return NULL; }
|
||||
virtual InstanceData* GetInstanceData(InstanceMap* map) const { return NULL; }
|
||||
};
|
||||
|
||||
class BattlegroundMapScript : public ScriptObject, public MapScript<BattleGroundMap>
|
||||
@@ -569,7 +582,7 @@ class BattlegroundScript : public ScriptObject
|
||||
bool IsDatabaseBound() const { return true; }
|
||||
|
||||
// Should return a fully valid BattleGround object for the type ID.
|
||||
virtual BattleGround* GetBattleground() = 0;
|
||||
virtual BattleGround* GetBattleground() const = 0;
|
||||
};
|
||||
|
||||
class OutdoorPvPScript : public ScriptObject
|
||||
@@ -587,7 +600,7 @@ class OutdoorPvPScript : public ScriptObject
|
||||
bool IsDatabaseBound() const { return true; }
|
||||
|
||||
// Should return a fully valid OutdoorPvP object for the type ID.
|
||||
virtual OutdoorPvP* GetOutdoorPvP() = 0;
|
||||
virtual OutdoorPvP* GetOutdoorPvP() const = 0;
|
||||
};
|
||||
|
||||
class CommandScript : public ScriptObject
|
||||
@@ -603,7 +616,7 @@ class CommandScript : public ScriptObject
|
||||
public:
|
||||
|
||||
// Should return a pointer to a valid command table (ChatCommand array) to be used by ChatHandler.
|
||||
virtual ChatCommand* GetCommands() = 0;
|
||||
virtual ChatCommand* GetCommands() const = 0;
|
||||
};
|
||||
|
||||
class WeatherScript : public ScriptObject, public UpdatableScript<Weather>
|
||||
|
||||
@@ -15,6 +15,7 @@ file(GLOB_RECURSE scripts_outland Outland/*.cpp Outland/*.h)
|
||||
file(GLOB_RECURSE scripts_world World/*.cpp World/*.h)
|
||||
file(GLOB_RECURSE scripts_spells Spells/*.cpp Spells/*.h)
|
||||
file(GLOB_RECURSE scripts_examples Examples/*.cpp Examples/*.h)
|
||||
file(GLOB_RECURSE scripts_outdoorpvp OutdoorPvP/*.cpp OutdoorPvP/*.h)
|
||||
|
||||
# Enable precompiled headers when using the GCC compiler.
|
||||
if(PCH)
|
||||
@@ -31,6 +32,7 @@ set(scripts_STAT_SRCS
|
||||
${scripts_world}
|
||||
${scripts_spells}
|
||||
${scripts_examples}
|
||||
${scripts_outdoorpvp}
|
||||
../game/AI/ScriptedAI/ScriptedEscortAI.cpp
|
||||
../game/AI/ScriptedAI/ScriptedCreature.cpp
|
||||
../game/AI/ScriptedAI/ScriptedFollowerAI.cpp
|
||||
@@ -38,7 +40,7 @@ set(scripts_STAT_SRCS
|
||||
../game/AI/ScriptedAI/ScriptedSimpleAI.cpp
|
||||
)
|
||||
|
||||
message("-- Added Scriptengine to SCRIPTS lib")
|
||||
message("-- Added Script Library to SCRIPTS lib")
|
||||
|
||||
include_directories(
|
||||
${ACE_INCLUDE_DIR}
|
||||
|
||||
@@ -251,7 +251,7 @@ class instance_deadmines : public InstanceMapScript
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* OnGetInstanceData(InstanceMap* pMap)
|
||||
InstanceData* GetInstanceData(InstanceMap* pMap) const
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
@@ -763,3 +763,22 @@ void OutdoorPvPEP::SendRemoveWorldStates(Player *plr)
|
||||
plr->SendUpdateWorldState(EP_CGT_N_H,0);
|
||||
}
|
||||
|
||||
class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_eastern_plaguelands()
|
||||
: OutdoorPvPScript("outdoorpvp_ep")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPEP();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_ep()
|
||||
{
|
||||
new OutdoorPvP_eastern_plaguelands();
|
||||
}
|
||||
@@ -330,3 +330,23 @@ void OutdoorPvPHP::HandleKillImpl(Player *plr, Unit * killed)
|
||||
else if (plr->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
|
||||
plr->CastSpell(plr,HordePlayerKillReward,true);
|
||||
}
|
||||
|
||||
class OutdoorPvP_hellfire_peninsula : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_hellfire_peninsula()
|
||||
: OutdoorPvPScript("outdoorpvp_hp")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPHP();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_hp()
|
||||
{
|
||||
new OutdoorPvP_hellfire_peninsula();
|
||||
}
|
||||
@@ -662,3 +662,23 @@ void OPvPCapturePointNA::UpdateWyvernRoostWorldState(uint32 roost)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
class OutdoorPvP_nagrand : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_nagrand()
|
||||
: OutdoorPvPScript("outdoorpvp_na")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPNA();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_na()
|
||||
{
|
||||
new OutdoorPvP_nagrand();
|
||||
}
|
||||
@@ -225,3 +225,22 @@ bool OutdoorPvPSI::HandleCustomSpell(Player *plr, uint32 spellId, GameObject *go
|
||||
return true;
|
||||
}
|
||||
|
||||
class OutdoorPvP_silithus : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_silithus()
|
||||
: OutdoorPvPScript("outdoorpvp_si")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPSI();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_si()
|
||||
{
|
||||
new OutdoorPvP_silithus();
|
||||
}
|
||||
@@ -309,3 +309,22 @@ void OPvPCapturePointTF::SendChangePhase()
|
||||
SendUpdateWorldState(TF_UI_TOWER_SLIDER_N, m_neutralValuePct);
|
||||
}
|
||||
|
||||
class OutdoorPvP_terokkar_forest : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_terokkar_forest()
|
||||
: OutdoorPvPScript("outdoorpvp_tf")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPTF();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_tf()
|
||||
{
|
||||
new OutdoorPvP_terokkar_forest();
|
||||
}
|
||||
@@ -421,3 +421,22 @@ void OutdoorPvPZM::SendRemoveWorldStates(Player *plr)
|
||||
plr->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY,0);
|
||||
}
|
||||
|
||||
class OutdoorPvP_zangarmarsh : public OutdoorPvPScript
|
||||
{
|
||||
public:
|
||||
|
||||
OutdoorPvP_zangarmarsh()
|
||||
: OutdoorPvPScript("outdoorpvp_zm")
|
||||
{
|
||||
}
|
||||
|
||||
OutdoorPvP* GetOutdoorPvP() const
|
||||
{
|
||||
return new OutdoorPvPZM();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_outdoorpvp_zm()
|
||||
{
|
||||
new OutdoorPvP_zangarmarsh();
|
||||
}
|
||||
@@ -79,7 +79,7 @@ class instance_mechanar : public InstanceMapScript
|
||||
}
|
||||
}
|
||||
};
|
||||
InstanceData* OnGetInstanceData(InstanceMap* pMap)
|
||||
InstanceData* GetInstanceData(InstanceMap* pMap) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class instance_arcatraz : public InstanceMapScript
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* OnGetInstanceData(InstanceMap* pMap)
|
||||
InstanceData* GetInstanceData(InstanceMap* pMap) const
|
||||
{
|
||||
return new instance_arcatraz_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user