Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Scripts/Battlefields: moved scripts into their respective namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovahlord committed Dec 8, 2023
1 parent c494ec1 commit 714d93c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/server/scripts/Battlefield/BattlefieldTB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "World.h"
#include "WorldStateMgr.h"

namespace Battlefields::TB
{
const uint32 TBFactions[BG_TEAMS_COUNT] = { 1610, 1732 };

// Stalker
Expand Down Expand Up @@ -984,8 +986,10 @@ class Battlefield_tol_barad : public BattlefieldScript
return new BattlefieldTB(map);
}
};
}

void AddSC_BF_tol_barad()
{
using namespace Battlefields::TB;
new Battlefield_tol_barad();
}
9 changes: 6 additions & 3 deletions src/server/scripts/Battlefield/BattlefieldTB.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

#include "Battlefield.h"

class BattlefieldTB;
class TolBaradCapturePoint;

namespace WorldPackets
{
namespace WorldState
Expand All @@ -31,6 +28,11 @@ namespace WorldPackets
}
}

namespace Battlefields::TB
{
class BattlefieldTB;
class TolBaradCapturePoint;

enum TolBaradInfo
{
BATTLEFIELD_TB_MAPID = 732, // Tol Barad
Expand Down Expand Up @@ -416,5 +418,6 @@ class BattlefieldTB : public Battlefield
ObjectGuid m_gateDBlockGUID;
ObjectGuid m_gateCursedDepthsGUID;
};
}

#endif
4 changes: 4 additions & 0 deletions src/server/scripts/Battlefield/BattlefieldWG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "WorldSession.h"
#include "WorldStateMgr.h"

namespace Battlefields::WG
{
struct BfWGCoordGY
{
Position Pos;
Expand Down Expand Up @@ -1801,9 +1803,11 @@ class npc_wg_give_promotion_credit : public CreatureScript
return new npc_wg_give_promotion_creditAI(creature);
}
};
}

void AddSC_BF_wintergrasp()
{
using namespace Battlefields::WG;
new Battlefield_wintergrasp();
new npc_wg_give_promotion_credit();
}
20 changes: 12 additions & 8 deletions src/server/scripts/Battlefield/BattlefieldWG.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
#include "Battlefield.h"

class Group;
class BattlefieldWG;
class WintergraspCapturePoint;

struct BfWGGameObjectBuilding;
struct WintergraspWorkshop;
struct StaticWintergraspTowerInfo;
struct StaticWintergraspWorkshopInfo;
struct WintergraspObjectPositionData;

namespace WorldPackets
{
Expand All @@ -39,6 +31,17 @@ namespace WorldPackets
}


namespace Battlefields::WG
{
class BattlefieldWG;
class WintergraspCapturePoint;
struct BfWGGameObjectBuilding;
struct WintergraspWorkshop;
struct StaticWintergraspTowerInfo;
struct StaticWintergraspWorkshopInfo;
struct WintergraspObjectPositionData;


typedef std::vector<BfWGGameObjectBuilding*> GameObjectBuildingVect;
typedef std::vector<WintergraspWorkshop*> WorkshopVect;

Expand Down Expand Up @@ -555,5 +558,6 @@ struct WintergraspWorkshop

void UpdateGraveyardAndWorkshop();
};
}

#endif
6 changes: 6 additions & 0 deletions src/server/scripts/EasternKingdoms/zone_tol_barad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include "ScriptedGossip.h"
#include "SpellScript.h"

namespace TolBarad
{
using namespace Battlefields::TB;

enum TBSpiritGuide
{
SPELL_CHANNEL_SPIRIT_HEAL = 22011,
Expand Down Expand Up @@ -144,9 +148,11 @@ class spell_tb_scrap_master_summon : public SpellScript
OnEffectHitTarget.Register(&spell_tb_scrap_master_summon::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
}

void AddSC_tol_barad()
{
using namespace TolBarad;
new npc_tb_spirit_guide();
new spell_siege_cannon();
RegisterSpellScript(spell_tb_scrap_master_summon);
Expand Down
6 changes: 6 additions & 0 deletions src/server/scripts/Northrend/zone_wintergrasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
#include "Vehicle.h"
#include "WorldSession.h"

namespace Wintergrasp
{
using namespace Battlefields::WG;

#define GOSSIP_HELLO_DEMO1 "Build catapult."
#define GOSSIP_HELLO_DEMO2 "Build demolisher."
#define GOSSIP_HELLO_DEMO3 "Build siege engine."
Expand Down Expand Up @@ -575,9 +579,11 @@ class condition_is_wintergrasp_alliance : public ConditionScript
return false;
}
};
}

void AddSC_wintergrasp()
{
using namespace Wintergrasp;
new npc_wg_queue();
new npc_wg_spirit_guide();
new npc_wg_demolisher_engineer();
Expand Down

0 comments on commit 714d93c

Please sign in to comment.