* Rename: BattleGround -> Battleground.
--HG-- branch : trunk
This commit is contained in:
@@ -18,12 +18,12 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAA.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAA.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
|
||||
BattleGroundAA::BattleGroundAA()
|
||||
BattlegroundAA::BattlegroundAA()
|
||||
{
|
||||
|
||||
m_StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
|
||||
@@ -37,47 +37,47 @@ BattleGroundAA::BattleGroundAA()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundAA::~BattleGroundAA()
|
||||
BattlegroundAA::~BattlegroundAA()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundAA::Update(uint32 diff)
|
||||
void BattlegroundAA::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
}
|
||||
|
||||
void BattleGroundAA::StartingEventCloseDoors()
|
||||
void BattlegroundAA::StartingEventCloseDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundAA::StartingEventOpenDoors()
|
||||
void BattlegroundAA::StartingEventOpenDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundAA::AddPlayer(Player *plr)
|
||||
void BattlegroundAA::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundAAScore* sc = new BattleGroundAAScore;
|
||||
BattlegroundAAScore* sc = new BattlegroundAAScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundAA::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundAA::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundAA::HandleKillPlayer(Player* player, Player* killer)
|
||||
void BattlegroundAA::HandleKillPlayer(Player* player, Player* killer)
|
||||
{
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
}
|
||||
|
||||
void BattleGroundAA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundAA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
}
|
||||
|
||||
bool BattleGroundAA::SetupBattleGround()
|
||||
bool BattlegroundAA::SetupBattleground()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,23 +20,23 @@
|
||||
#ifndef __BATTLEGROUNDAA_H
|
||||
#define __BATTLEGROUNDAA_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
class BattleGroundAAScore : public BattleGroundScore
|
||||
class BattlegroundAAScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundAAScore() {};
|
||||
virtual ~BattleGroundAAScore() {};
|
||||
BattlegroundAAScore() {};
|
||||
virtual ~BattlegroundAAScore() {};
|
||||
//TODO fix me
|
||||
};
|
||||
|
||||
class BattleGroundAA : public BattleGround
|
||||
class BattlegroundAA : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundAA();
|
||||
~BattleGroundAA();
|
||||
BattlegroundAA();
|
||||
~BattlegroundAA();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -46,7 +46,7 @@ class BattleGroundAA : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAB.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAB.h"
|
||||
#include "Creature.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
@@ -41,7 +41,7 @@ uint32 BG_AB_ReputationScoreTicks[BG_HONOR_MODE_NUM] = {
|
||||
150 // holiday
|
||||
};
|
||||
|
||||
BattleGroundAB::BattleGroundAB()
|
||||
BattlegroundAB::BattlegroundAB()
|
||||
{
|
||||
m_BuffChange = true;
|
||||
m_BgObjects.resize(BG_AB_OBJECT_MAX);
|
||||
@@ -53,13 +53,13 @@ BattleGroundAB::BattleGroundAB()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_AB_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundAB::~BattleGroundAB()
|
||||
BattlegroundAB::~BattlegroundAB()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundAB::Update(uint32 diff)
|
||||
void BattlegroundAB::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -168,13 +168,13 @@ void BattleGroundAB::Update(uint32 diff)
|
||||
|
||||
// Test win condition
|
||||
if (m_TeamScores[BG_TEAM_ALLIANCE] >= BG_AB_MAX_TEAM_SCORE)
|
||||
EndBattleGround(ALLIANCE);
|
||||
EndBattleground(ALLIANCE);
|
||||
if (m_TeamScores[BG_TEAM_HORDE] >= BG_AB_MAX_TEAM_SCORE)
|
||||
EndBattleGround(HORDE);
|
||||
EndBattleground(HORDE);
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAB::StartingEventCloseDoors()
|
||||
void BattlegroundAB::StartingEventCloseDoors()
|
||||
{
|
||||
// despawn banners, auras and buffs
|
||||
for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
|
||||
@@ -193,7 +193,7 @@ void BattleGroundAB::StartingEventCloseDoors()
|
||||
_NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE);
|
||||
}
|
||||
|
||||
void BattleGroundAB::StartingEventOpenDoors()
|
||||
void BattlegroundAB::StartingEventOpenDoors()
|
||||
{
|
||||
// spawn neutral banners
|
||||
for (int banner = BG_AB_OBJECT_BANNER_NEUTRAL, i = 0; i < 5; banner += 8, ++i)
|
||||
@@ -208,21 +208,21 @@ void BattleGroundAB::StartingEventOpenDoors()
|
||||
DoorOpen(BG_AB_OBJECT_GATE_H);
|
||||
}
|
||||
|
||||
void BattleGroundAB::AddPlayer(Player *plr)
|
||||
void BattlegroundAB::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in the constructor
|
||||
BattleGroundABScore* sc = new BattleGroundABScore;
|
||||
BattlegroundABScore* sc = new BattlegroundABScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -258,7 +258,7 @@ void BattleGroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
|
||||
/* type: 0-neutral, 1-contested, 3-occupied
|
||||
teamIndex: 0-ally, 1-horde */
|
||||
void BattleGroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
|
||||
void BattlegroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool delay)
|
||||
{
|
||||
// Just put it into the queue
|
||||
if (delay)
|
||||
@@ -280,7 +280,7 @@ void BattleGroundAB::_CreateBanner(uint8 node, uint8 type, uint8 teamIndex, bool
|
||||
SpawnBGObject(obj, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundAB::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
|
||||
void BattlegroundAB::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
|
||||
{
|
||||
uint8 obj = node*8 + type + teamIndex;
|
||||
SpawnBGObject(obj, RESPAWN_ONE_DAY);
|
||||
@@ -292,7 +292,7 @@ void BattleGroundAB::_DelBanner(uint8 node, uint8 type, uint8 teamIndex)
|
||||
SpawnBGObject(obj, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
int32 BattleGroundAB::_GetNodeNameId(uint8 node)
|
||||
int32 BattlegroundAB::_GetNodeNameId(uint8 node)
|
||||
{
|
||||
switch (node)
|
||||
{
|
||||
@@ -307,7 +307,7 @@ int32 BattleGroundAB::_GetNodeNameId(uint8 node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundAB::FillInitialWorldStates(WorldPacket& data)
|
||||
{
|
||||
const uint8 plusArray[] = {0, 2, 3, 0, 1};
|
||||
|
||||
@@ -341,7 +341,7 @@ void BattleGroundAB::FillInitialWorldStates(WorldPacket& data)
|
||||
data << uint32(0x745) << uint32(0x2); // 37 1861 unk
|
||||
}
|
||||
|
||||
void BattleGroundAB::_SendNodeUpdate(uint8 node)
|
||||
void BattlegroundAB::_SendNodeUpdate(uint8 node)
|
||||
{
|
||||
// Send node owner state update to refresh map icons on client
|
||||
const uint8 plusArray[] = {0, 2, 3, 0, 1};
|
||||
@@ -365,7 +365,7 @@ void BattleGroundAB::_SendNodeUpdate(uint8 node)
|
||||
UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_HORDE, horde);
|
||||
}
|
||||
|
||||
void BattleGroundAB::_NodeOccupied(uint8 node,Team team)
|
||||
void BattlegroundAB::_NodeOccupied(uint8 node,Team team)
|
||||
{
|
||||
if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
|
||||
sLog.outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team);
|
||||
@@ -397,7 +397,7 @@ void BattleGroundAB::_NodeOccupied(uint8 node,Team team)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAB::_NodeDeOccupied(uint8 node)
|
||||
void BattlegroundAB::_NodeDeOccupied(uint8 node)
|
||||
{
|
||||
if (node >= BG_AB_DYNAMIC_NODES_COUNT)
|
||||
return;
|
||||
@@ -432,7 +432,7 @@ void BattleGroundAB::_NodeDeOccupied(uint8 node)
|
||||
}
|
||||
|
||||
/* Invoked if a player used a banner as a gameobject */
|
||||
void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/)
|
||||
void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -451,7 +451,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGroundTeamId teamIndex = GetTeamIndexByTeamId(source->GetTeam());
|
||||
BattlegroundTeamId teamIndex = GetTeamIndexByTeamId(source->GetTeam());
|
||||
|
||||
// Check if player really could use this banner, not cheated
|
||||
if (!(m_Nodes[node] == 0 || teamIndex == m_Nodes[node]%2))
|
||||
@@ -559,7 +559,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ
|
||||
PlaySoundToAll(sound);
|
||||
}
|
||||
|
||||
bool BattleGroundAB::SetupBattleGround()
|
||||
bool BattlegroundAB::SetupBattleground()
|
||||
{
|
||||
for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
{
|
||||
@@ -573,7 +573,7 @@ bool BattleGroundAB::SetupBattleGround()
|
||||
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i,BG_AB_OBJECTID_AURA_C,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn some object BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ bool BattleGroundAB::SetupBattleGround()
|
||||
|| !AddObject(BG_AB_OBJECT_GATE_H,BG_AB_OBJECTID_GATE_H,BG_AB_DoorPositions[1][0],BG_AB_DoorPositions[1][1],BG_AB_DoorPositions[1][2],BG_AB_DoorPositions[1][3],BG_AB_DoorPositions[1][4],BG_AB_DoorPositions[1][5],BG_AB_DoorPositions[1][6],BG_AB_DoorPositions[1][7],RESPAWN_IMMEDIATELY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn door object BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
//buffs
|
||||
@@ -597,10 +597,10 @@ bool BattleGroundAB::SetupBattleGround()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundAB::Reset()
|
||||
void BattlegroundAB::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
|
||||
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
|
||||
m_TeamScores[BG_TEAM_HORDE] = 0;
|
||||
@@ -611,7 +611,7 @@ void BattleGroundAB::Reset()
|
||||
m_ReputationScoreTics[BG_TEAM_ALLIANCE] = 0;
|
||||
m_ReputationScoreTics[BG_TEAM_HORDE] = 0;
|
||||
m_IsInformedNearVictory = false;
|
||||
bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
|
||||
bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID());
|
||||
m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks;
|
||||
m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks;
|
||||
m_TeamScores500Disadvantage[BG_TEAM_ALLIANCE] = false;
|
||||
@@ -630,7 +630,7 @@ void BattleGroundAB::Reset()
|
||||
DelCreature(i);
|
||||
}
|
||||
|
||||
void BattleGroundAB::EndBattleGround(uint32 winner)
|
||||
void BattlegroundAB::EndBattleground(uint32 winner)
|
||||
{
|
||||
//win reward
|
||||
if (winner == ALLIANCE)
|
||||
@@ -641,12 +641,12 @@ void BattleGroundAB::EndBattleGround(uint32 winner)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
|
||||
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
|
||||
WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
BattleGroundTeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
|
||||
BattlegroundTeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
|
||||
|
||||
// Is there any occupied node for this team?
|
||||
std::vector<uint8> nodes;
|
||||
@@ -683,29 +683,29 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
|
||||
return good_entry;
|
||||
}
|
||||
|
||||
void BattleGroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case SCORE_BASES_ASSAULTED:
|
||||
((BattleGroundABScore*)itr->second)->BasesAssaulted += value;
|
||||
((BattlegroundABScore*)itr->second)->BasesAssaulted += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_ASSAULT_BASE);
|
||||
break;
|
||||
case SCORE_BASES_DEFENDED:
|
||||
((BattleGroundABScore*)itr->second)->BasesDefended += value;
|
||||
((BattlegroundABScore*)itr->second)->BasesDefended += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE);
|
||||
break;
|
||||
default:
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool BattleGroundAB::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
bool BattlegroundAB::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef __BATTLEGROUNDAB_H
|
||||
#define __BATTLEGROUNDAB_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BG_AB_WorldStates
|
||||
{
|
||||
@@ -135,7 +135,7 @@ enum BG_AB_Score
|
||||
};
|
||||
|
||||
/* do NOT change the order, else wrong behaviour */
|
||||
enum BG_AB_BattleGroundNodes
|
||||
enum BG_AB_BattlegroundNodes
|
||||
{
|
||||
BG_AB_NODE_STABLES = 0,
|
||||
BG_AB_NODE_BLACKSMITH = 1,
|
||||
@@ -232,22 +232,22 @@ struct BG_AB_BannerTimer
|
||||
uint8 teamIndex;
|
||||
};
|
||||
|
||||
class BattleGroundABScore : public BattleGroundScore
|
||||
class BattlegroundABScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundABScore(): BasesAssaulted(0), BasesDefended(0) {};
|
||||
virtual ~BattleGroundABScore() {};
|
||||
BattlegroundABScore(): BasesAssaulted(0), BasesDefended(0) {};
|
||||
virtual ~BattlegroundABScore() {};
|
||||
uint32 BasesAssaulted;
|
||||
uint32 BasesDefended;
|
||||
};
|
||||
|
||||
class BattleGroundAB : public BattleGround
|
||||
class BattlegroundAB : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundAB();
|
||||
~BattleGroundAB();
|
||||
BattlegroundAB();
|
||||
~BattlegroundAB();
|
||||
|
||||
void Update(uint32 diff);
|
||||
void AddPlayer(Player *plr);
|
||||
@@ -255,9 +255,9 @@ class BattleGroundAB : public BattleGround
|
||||
virtual void StartingEventOpenDoors();
|
||||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
virtual bool SetupBattleGround();
|
||||
virtual bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
/* Scorekeeping */
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAV.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "Miscellaneous/Formulas.h"
|
||||
#include "GameObject.h"
|
||||
#include "Miscellaneous/Language.h"
|
||||
#include "Player.h"
|
||||
#include "SpellAuras.h"
|
||||
|
||||
BattleGroundAV::BattleGroundAV()
|
||||
BattlegroundAV::BattlegroundAV()
|
||||
{
|
||||
m_BgObjects.resize(BG_AV_OBJECT_MAX);
|
||||
m_BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
|
||||
@@ -40,25 +40,25 @@ BattleGroundAV::BattleGroundAV()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_AV_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundAV::~BattleGroundAV()
|
||||
BattlegroundAV::~BattlegroundAV()
|
||||
{
|
||||
}
|
||||
|
||||
const uint16 BattleGroundAV::GetBonusHonor(uint8 kills) //TODO: move this function to Battleground.cpp (needs to find a way to get m_MaxLevel)
|
||||
const uint16 BattlegroundAV::GetBonusHonor(uint8 kills) //TODO: move this function to Battleground.cpp (needs to find a way to get m_MaxLevel)
|
||||
{
|
||||
return Trinity::Honor::hk_honor_at_level(m_MaxLevel, kills);
|
||||
}
|
||||
|
||||
void BattleGroundAV::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
UpdateScore(player->GetTeam(),-1);
|
||||
}
|
||||
|
||||
void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
{
|
||||
sLog.outDebug("bg_av HandleKillUnit %i",unit->GetEntry());
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -80,7 +80,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
CastSpellOnTeam(23658,HORDE); //this is a spell which finishes a quest where a player has to kill the boss
|
||||
RewardReputationToTeam(729,BG_AV_REP_BOSS,HORDE);
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),HORDE);
|
||||
EndBattleGround(HORDE);
|
||||
EndBattleground(HORDE);
|
||||
DelCreature(AV_CPLACE_TRIGGER17);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0])
|
||||
@@ -88,7 +88,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
CastSpellOnTeam(23658,ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss
|
||||
RewardReputationToTeam(730,BG_AV_REP_BOSS,ALLIANCE);
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),ALLIANCE);
|
||||
EndBattleGround(ALLIANCE);
|
||||
EndBattleground(ALLIANCE);
|
||||
DelCreature(AV_CPLACE_TRIGGER19);
|
||||
}
|
||||
else if (entry == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN][0])
|
||||
@@ -135,7 +135,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
ChangeMineOwner(AV_SOUTH_MINE,killer->GetTeam());
|
||||
}
|
||||
|
||||
void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;//maybe we should log this, cause this must be a cheater or a big bug
|
||||
@@ -238,7 +238,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAV::UpdateScore(uint16 team, int16 points)
|
||||
void BattlegroundAV::UpdateScore(uint16 team, int16 points)
|
||||
{ //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
|
||||
ASSERT(team == ALLIANCE || team == HORDE);
|
||||
uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
|
||||
@@ -250,7 +250,7 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points)
|
||||
if (m_Team_Scores[teamindex] < 1)
|
||||
{
|
||||
m_Team_Scores[teamindex]=0;
|
||||
EndBattleGround(((teamindex == BG_TEAM_HORDE)?ALLIANCE:HORDE));
|
||||
EndBattleground(((teamindex == BG_TEAM_HORDE)?ALLIANCE:HORDE));
|
||||
}
|
||||
else if (!m_IsInformedNearVictory[teamindex] && m_Team_Scores[teamindex] < SEND_MSG_NEAR_LOSE)
|
||||
{
|
||||
@@ -261,7 +261,7 @@ void BattleGroundAV::UpdateScore(uint16 team, int16 points)
|
||||
}
|
||||
}
|
||||
|
||||
Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
{
|
||||
uint8 level;
|
||||
bool isStatic = false;
|
||||
@@ -341,9 +341,9 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
|
||||
return creature;
|
||||
}
|
||||
|
||||
void BattleGroundAV::Update(uint32 diff)
|
||||
void BattlegroundAV::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -403,13 +403,13 @@ void BattleGroundAV::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAV::StartingEventCloseDoors()
|
||||
void BattlegroundAV::StartingEventCloseDoors()
|
||||
{
|
||||
DoorClose(BG_AV_OBJECT_DOOR_A);
|
||||
DoorClose(BG_AV_OBJECT_DOOR_H);
|
||||
}
|
||||
|
||||
void BattleGroundAV::StartingEventOpenDoors()
|
||||
void BattlegroundAV::StartingEventOpenDoors()
|
||||
{
|
||||
sLog.outDebug("BG_AV: start spawning mine stuff");
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
|
||||
@@ -426,18 +426,18 @@ void BattleGroundAV::StartingEventOpenDoors()
|
||||
DoorOpen(BG_AV_OBJECT_DOOR_A);
|
||||
}
|
||||
|
||||
void BattleGroundAV::AddPlayer(Player *plr)
|
||||
void BattlegroundAV::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundAVScore* sc = new BattleGroundAVScore;
|
||||
BattlegroundAVScore* sc = new BattlegroundAVScore;
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
if (m_MaxLevel == 0)
|
||||
m_MaxLevel=(plr->getLevel()%10 == 0)? plr->getLevel() : (plr->getLevel()-(plr->getLevel()%10))+10; //TODO: just look at the code \^_^/ --but queue-info should provide this information..
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundAV::EndBattleGround(uint32 winner)
|
||||
void BattlegroundAV::EndBattleground(uint32 winner)
|
||||
{
|
||||
//calculate bonuskills for both teams:
|
||||
//first towers:
|
||||
@@ -474,10 +474,10 @@ void BattleGroundAV::EndBattleGround(uint32 winner)
|
||||
}
|
||||
|
||||
//TODO add enterevademode for all attacking creatures
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattleGroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
|
||||
void BattlegroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
@@ -490,7 +490,7 @@ void BattleGroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
|
||||
plr->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
|
||||
}
|
||||
|
||||
void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -530,47 +530,47 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
Source->CastSpell(Source, SpellId, true);
|
||||
}
|
||||
|
||||
void BattleGroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case SCORE_GRAVEYARDS_ASSAULTED:
|
||||
((BattleGroundAVScore*)itr->second)->GraveyardsAssaulted += value;
|
||||
((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_GRAVEYARD);
|
||||
break;
|
||||
case SCORE_GRAVEYARDS_DEFENDED:
|
||||
((BattleGroundAVScore*)itr->second)->GraveyardsDefended += value;
|
||||
((BattlegroundAVScore*)itr->second)->GraveyardsDefended += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_GRAVEYARD);
|
||||
break;
|
||||
case SCORE_TOWERS_ASSAULTED:
|
||||
((BattleGroundAVScore*)itr->second)->TowersAssaulted += value;
|
||||
((BattlegroundAVScore*)itr->second)->TowersAssaulted += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_TOWER);
|
||||
break;
|
||||
case SCORE_TOWERS_DEFENDED:
|
||||
((BattleGroundAVScore*)itr->second)->TowersDefended += value;
|
||||
((BattlegroundAVScore*)itr->second)->TowersDefended += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_TOWER);
|
||||
break;
|
||||
case SCORE_MINES_CAPTURED:
|
||||
((BattleGroundAVScore*)itr->second)->MinesCaptured += value;
|
||||
((BattlegroundAVScore*)itr->second)->MinesCaptured += value;
|
||||
break;
|
||||
case SCORE_LEADERS_KILLED:
|
||||
((BattleGroundAVScore*)itr->second)->LeadersKilled += value;
|
||||
((BattlegroundAVScore*)itr->second)->LeadersKilled += value;
|
||||
break;
|
||||
case SCORE_SECONDARY_OBJECTIVES:
|
||||
((BattleGroundAVScore*)itr->second)->SecondaryObjectives += value;
|
||||
((BattlegroundAVScore*)itr->second)->SecondaryObjectives += value;
|
||||
break;
|
||||
default:
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
{
|
||||
|
||||
uint32 object = GetObjectThroughNode(node);
|
||||
@@ -631,7 +631,7 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
YellToAll(creature,buf,LANG_UNIVERSAL);
|
||||
}
|
||||
|
||||
void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
{ //mine=0 northmine mine=1 southmin
|
||||
//changing the owner results in setting respawntim to infinite for current creatures, spawning new mine owners creatures and changing the chest-objects so that the current owning team can use them
|
||||
ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
|
||||
@@ -721,7 +721,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
return;
|
||||
}
|
||||
|
||||
bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
|
||||
bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
|
||||
{
|
||||
if (GOId == BG_AV_OBJECTID_MINE_N)
|
||||
return (m_Mine_Owner[AV_NORTH_MINE] == team);
|
||||
@@ -730,7 +730,7 @@ bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
|
||||
return true; //cause it's no mine'object it is ok if this is true
|
||||
}
|
||||
|
||||
void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
{
|
||||
uint32 owner = m_Nodes[node].Owner;
|
||||
ASSERT(owner);
|
||||
@@ -780,7 +780,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
|
||||
}
|
||||
}
|
||||
void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
{
|
||||
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
|
||||
for (uint8 i=0; i<4; i++)
|
||||
@@ -795,7 +795,7 @@ void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
|
||||
}
|
||||
|
||||
const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object)
|
||||
const BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
||||
{
|
||||
sLog.outDebug("bg_AV getnodethroughobject %i",object);
|
||||
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
|
||||
@@ -812,12 +812,12 @@ const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object)
|
||||
return BG_AV_Nodes(object - 29);
|
||||
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
|
||||
return BG_AV_NODES_SNOWFALL_GRAVE;
|
||||
sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
sLog.outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
ASSERT(false);
|
||||
return BG_AV_Nodes(0);
|
||||
}
|
||||
|
||||
const uint32 BattleGroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
const uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
{ //this function is the counterpart to GetNodeThroughObject()
|
||||
sLog.outDebug("bg_AV GetObjectThroughNode %i",node);
|
||||
if (m_Nodes[node].Owner == ALLIANCE)
|
||||
@@ -848,14 +848,14 @@ const uint32 BattleGroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
}
|
||||
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
|
||||
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
|
||||
sLog.outError("BattleGroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
|
||||
sLog.outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
|
||||
ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//called when using banner
|
||||
|
||||
void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target_obj)
|
||||
void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target_obj)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -883,7 +883,7 @@ void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
{
|
||||
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
||||
BG_AV_Nodes node = GetNodeThroughObject(object);
|
||||
@@ -954,7 +954,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_GOOD:AV_SOUND_HORDE_GOOD);
|
||||
}
|
||||
|
||||
void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
{
|
||||
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_ASSAULTS:AV_SOUND_HORDE_ASSAULTS);
|
||||
}
|
||||
|
||||
void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
{
|
||||
bool stateok;
|
||||
//graveyards
|
||||
@@ -1099,7 +1099,7 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
|
||||
SendMineWorldStates(AV_SOUTH_MINE);
|
||||
}
|
||||
|
||||
const uint8 BattleGroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray
|
||||
const uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray
|
||||
{
|
||||
//neutral stuff cant get handled (currently its only snowfall)
|
||||
ASSERT(team != AV_NEUTRAL_TEAM);
|
||||
@@ -1122,7 +1122,7 @@ const uint8 BattleGroundAV::GetWorldStateType(uint8 state, uint16 team) //this i
|
||||
return 5; //this will crash the game, but i want to know if something is wrong here
|
||||
}
|
||||
|
||||
void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
void BattlegroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
{
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State,m_Nodes[node].Owner)],1);
|
||||
if (m_Nodes[node].PrevOwner == AV_NEUTRAL_TEAM) //currently only snowfall is supported as neutral node (i don't want to make an extra row (neutral states) in worldstatesarray just for one node
|
||||
@@ -1131,7 +1131,7 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState,m_Nodes[node].PrevOwner)],0);
|
||||
}
|
||||
|
||||
void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||
void BattlegroundAV::SendMineWorldStates(uint32 mine)
|
||||
{
|
||||
ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
|
||||
// currently i'm sure, that this works (:
|
||||
@@ -1158,7 +1158,7 @@ void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||
UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner],0);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
|
||||
WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* pGraveyard = NULL;
|
||||
WorldSafeLocsEntry const* entry = NULL;
|
||||
@@ -1188,7 +1188,7 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
|
||||
return pGraveyard;
|
||||
}
|
||||
|
||||
bool BattleGroundAV::SetupBattleGround()
|
||||
bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
// Create starting objects
|
||||
if (
|
||||
@@ -1197,7 +1197,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
// horde gates
|
||||
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0],BG_AV_DoorPositons[1][1],BG_AV_DoorPositons[1][2],BG_AV_DoorPositons[1][3],0,0,sin(BG_AV_DoorPositons[1][3]/2),cos(BG_AV_DoorPositons[1][3]/2),RESPAWN_IMMEDIATELY))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAV: Failed to spawn some object BattleGround not created!1");
|
||||
sLog.outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!2");
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1230,7 +1230,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PH,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!3");
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1243,7 +1243,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PA,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!4");
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!5.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_SMOKE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!6.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1273,7 +1273,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!7.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1283,7 +1283,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i,BG_AV_OBJECTID_MINE_N,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies BattleGround not created!7.5.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1291,14 +1291,14 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i,BG_AV_OBJECTID_MINE_S,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies BattleGround not created!7.6.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N ,BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3],0,0,sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!8");
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
return false;
|
||||
}
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
@@ -1308,7 +1308,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!9.%i",i);
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1367,7 +1367,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* BattleGroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
{
|
||||
switch (node)
|
||||
{
|
||||
@@ -1395,7 +1395,7 @@ const char* BattleGroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattlegroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
{
|
||||
if (m_Nodes[node].TotalOwner == team)
|
||||
{
|
||||
@@ -1425,7 +1425,7 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
m_Nodes[node].State = POINT_ASSAULTED;
|
||||
}
|
||||
|
||||
void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
|
||||
void BattlegroundAV::DestroyNode(BG_AV_Nodes node)
|
||||
{
|
||||
ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
|
||||
|
||||
@@ -1436,7 +1436,7 @@ void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
|
||||
m_Nodes[node].Timer = 0;
|
||||
}
|
||||
|
||||
void BattleGroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
|
||||
void BattlegroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
|
||||
{
|
||||
m_Nodes[node].TotalOwner = team;
|
||||
m_Nodes[node].Owner = team;
|
||||
@@ -1448,7 +1448,7 @@ void BattleGroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
|
||||
m_Nodes[node].Tower = tower;
|
||||
}
|
||||
|
||||
void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattlegroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
{
|
||||
ASSERT(m_Nodes[node].TotalOwner == team);
|
||||
ASSERT(m_Nodes[node].Owner != team);
|
||||
@@ -1460,7 +1460,7 @@ void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
m_Nodes[node].Timer = 0;
|
||||
}
|
||||
|
||||
void BattleGroundAV::ResetBGSubclass()
|
||||
void BattlegroundAV::ResetBGSubclass()
|
||||
{
|
||||
m_MaxLevel=0;
|
||||
for (uint8 i=0; i<2; i++) //forloop for both teams (it just make 0 == alliance and 1 == horde also for both mines 0=north 1=south
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef __BATTLEGROUNDAV_H
|
||||
#define __BATTLEGROUNDAV_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
#define LANG_BG_AV_A_CAPTAIN_BUFF "Begone. Uncouth scum! The Alliance shall prevail in Alterac Valley!"
|
||||
#define LANG_BG_AV_H_CAPTAIN_BUFF "Now is the time to attack! For the Horde!"
|
||||
@@ -1520,11 +1520,11 @@ struct BG_AV_NodeInfo
|
||||
|
||||
inline BG_AV_Nodes &operator++(BG_AV_Nodes &i){ return i = BG_AV_Nodes(i + 1); }
|
||||
|
||||
class BattleGroundAVScore : public BattleGroundScore
|
||||
class BattlegroundAVScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundAVScore() : GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), TowersDefended(0), MinesCaptured(0), LeadersKilled(0), SecondaryObjectives(0) {};
|
||||
virtual ~BattleGroundAVScore() {};
|
||||
BattlegroundAVScore() : GraveyardsAssaulted(0), GraveyardsDefended(0), TowersAssaulted(0), TowersDefended(0), MinesCaptured(0), LeadersKilled(0), SecondaryObjectives(0) {};
|
||||
virtual ~BattlegroundAVScore() {};
|
||||
uint32 GraveyardsAssaulted;
|
||||
uint32 GraveyardsDefended;
|
||||
uint32 TowersAssaulted;
|
||||
@@ -1534,13 +1534,13 @@ class BattleGroundAVScore : public BattleGroundScore
|
||||
uint32 SecondaryObjectives;
|
||||
};
|
||||
|
||||
class BattleGroundAV : public BattleGround
|
||||
class BattlegroundAV : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundAV();
|
||||
~BattleGroundAV();
|
||||
BattlegroundAV();
|
||||
~BattlegroundAV();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -1550,7 +1550,7 @@ class BattleGroundAV : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
virtual void ResetBGSubclass();
|
||||
|
||||
/*general stuff*/
|
||||
@@ -1564,7 +1564,7 @@ class BattleGroundAV : public BattleGround
|
||||
void HandleQuestComplete(uint32 questid, Player *player);
|
||||
bool PlayerCanDoMineQuest(int32 GOId,uint32 team);
|
||||
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundBE.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundBE.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
BattleGroundBE::BattleGroundBE()
|
||||
BattlegroundBE::BattlegroundBE()
|
||||
{
|
||||
m_BgObjects.resize(BG_BE_OBJECT_MAX);
|
||||
|
||||
@@ -41,14 +41,14 @@ BattleGroundBE::BattleGroundBE()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundBE::~BattleGroundBE()
|
||||
BattlegroundBE::~BattlegroundBE()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundBE::Update(uint32 diff)
|
||||
void BattlegroundBE::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ void BattleGroundBE::Update(uint32 diff)
|
||||
}*/
|
||||
}
|
||||
|
||||
void BattleGroundBE::StartingEventCloseDoors()
|
||||
void BattlegroundBE::StartingEventCloseDoors()
|
||||
{
|
||||
for (uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
@@ -65,7 +65,7 @@ void BattleGroundBE::StartingEventCloseDoors()
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
void BattleGroundBE::StartingEventOpenDoors()
|
||||
void BattlegroundBE::StartingEventOpenDoors()
|
||||
{
|
||||
for (uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
@@ -74,18 +74,18 @@ void BattleGroundBE::StartingEventOpenDoors()
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
void BattleGroundBE::AddPlayer(Player *plr)
|
||||
void BattlegroundBE::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundBEScore* sc = new BattleGroundBEScore;
|
||||
BattlegroundBEScore* sc = new BattlegroundBEScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -105,19 +105,19 @@ void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
Battleground::HandleKillPlayer(player,killer);
|
||||
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
bool BattleGroundBE::HandlePlayerUnderMap(Player *player)
|
||||
bool BattlegroundBE::HandlePlayerUnderMap(Player *player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),6238.930176,262.963470,0.889519,player->GetOrientation(),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -143,19 +143,19 @@ void BattleGroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
// HandleTriggerBuff(buff_guid,Source);
|
||||
}
|
||||
|
||||
void BattleGroundBE::FillInitialWorldStates(WorldPacket &data)
|
||||
void BattlegroundBE::FillInitialWorldStates(WorldPacket &data)
|
||||
{
|
||||
data << uint32(0x9f3) << uint32(1); // 9
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundBE::Reset()
|
||||
void BattlegroundBE::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundBE::SetupBattleGround()
|
||||
bool BattlegroundBE::SetupBattleground()
|
||||
{
|
||||
// gates
|
||||
if (!AddObject(BG_BE_OBJECT_DOOR_1, BG_BE_OBJECT_TYPE_DOOR_1, 6287.277f, 282.1877f, 3.810925f, -2.260201f, 0, 0, 0.9044551f, -0.4265689f, RESPAWN_IMMEDIATELY)
|
||||
@@ -173,15 +173,15 @@ bool BattleGroundBE::SetupBattleGround()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
//there is nothing special in this score
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#ifndef __BATTLEGROUNDBE_H
|
||||
#define __BATTLEGROUNDBE_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BattleGroundBEObjectTypes
|
||||
enum BattlegroundBEObjectTypes
|
||||
{
|
||||
BG_BE_OBJECT_DOOR_1 = 0,
|
||||
BG_BE_OBJECT_DOOR_2 = 1,
|
||||
@@ -33,7 +33,7 @@ enum BattleGroundBEObjectTypes
|
||||
BG_BE_OBJECT_MAX = 6
|
||||
};
|
||||
|
||||
enum BattleGroundBEObjects
|
||||
enum BattlegroundBEObjects
|
||||
{
|
||||
BG_BE_OBJECT_TYPE_DOOR_1 = 183971,
|
||||
BG_BE_OBJECT_TYPE_DOOR_2 = 183973,
|
||||
@@ -43,20 +43,20 @@ enum BattleGroundBEObjects
|
||||
BG_BE_OBJECT_TYPE_BUFF_2 = 184664
|
||||
};
|
||||
|
||||
class BattleGroundBEScore : public BattleGroundScore
|
||||
class BattlegroundBEScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundBEScore() {};
|
||||
virtual ~BattleGroundBEScore() {};
|
||||
BattlegroundBEScore() {};
|
||||
virtual ~BattlegroundBEScore() {};
|
||||
};
|
||||
|
||||
class BattleGroundBE : public BattleGround
|
||||
class BattlegroundBE : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundBE();
|
||||
~BattleGroundBE();
|
||||
BattlegroundBE();
|
||||
~BattlegroundBE();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -66,7 +66,7 @@ class BattleGroundBE : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundDS.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundDS.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
BattleGroundDS::BattleGroundDS()
|
||||
BattlegroundDS::BattlegroundDS()
|
||||
{
|
||||
m_BgObjects.resize(BG_DS_OBJECT_MAX);
|
||||
|
||||
@@ -39,14 +39,14 @@ BattleGroundDS::BattleGroundDS()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundDS::~BattleGroundDS()
|
||||
BattlegroundDS::~BattlegroundDS()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundDS::Update(uint32 diff)
|
||||
void BattlegroundDS::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
if (getWaterFallTimer() < diff)
|
||||
{
|
||||
if (isWaterFallActive())
|
||||
@@ -68,13 +68,13 @@ void BattleGroundDS::Update(uint32 diff)
|
||||
setWaterFallTimer(getWaterFallTimer() - diff);
|
||||
}
|
||||
|
||||
void BattleGroundDS::StartingEventCloseDoors()
|
||||
void BattlegroundDS::StartingEventCloseDoors()
|
||||
{
|
||||
for (uint32 i = BG_DS_OBJECT_DOOR_1; i <= BG_DS_OBJECT_DOOR_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundDS::StartingEventOpenDoors()
|
||||
void BattlegroundDS::StartingEventOpenDoors()
|
||||
{
|
||||
for (uint32 i = BG_DS_OBJECT_DOOR_1; i <= BG_DS_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
@@ -89,18 +89,18 @@ void BattleGroundDS::StartingEventOpenDoors()
|
||||
SpawnBGObject(i, getWaterFallTimer());
|
||||
}
|
||||
|
||||
void BattleGroundDS::AddPlayer(Player *plr)
|
||||
void BattlegroundDS::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundDSScore* sc = new BattleGroundDSScore;
|
||||
BattlegroundDSScore* sc = new BattlegroundDSScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -109,24 +109,24 @@ void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundDS::HandleKillPlayer(Player* player, Player* killer)
|
||||
void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattleGroundDS: Killer player not found");
|
||||
sLog.outError("BattlegroundDS: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
Battleground::HandleKillPlayer(player,killer);
|
||||
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -143,26 +143,26 @@ void BattleGroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
}
|
||||
}
|
||||
|
||||
bool BattleGroundDS::HandlePlayerUnderMap(Player *player)
|
||||
bool BattlegroundDS::HandlePlayerUnderMap(Player *player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(), 1299.046, 784.825, 9.338, 2.422, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundDS::FillInitialWorldStates(WorldPacket &data)
|
||||
void BattlegroundDS::FillInitialWorldStates(WorldPacket &data)
|
||||
{
|
||||
data << uint32(3610) << uint32(1); // 9 show
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundDS::Reset()
|
||||
void BattlegroundDS::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
}
|
||||
|
||||
|
||||
bool BattleGroundDS::SetupBattleGround()
|
||||
bool BattlegroundDS::SetupBattleground()
|
||||
{
|
||||
// gates
|
||||
if (!AddObject(BG_DS_OBJECT_DOOR_1, BG_DS_OBJECT_TYPE_DOOR_1, 1350.95, 817.2, 20.8096, 3.15, 0, 0, 0.99627, 0.0862864, RESPAWN_IMMEDIATELY)
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#ifndef __BATTLEGROUNDDS_H
|
||||
#define __BATTLEGROUNDDS_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BattleGroundDSObjectTypes
|
||||
enum BattlegroundDSObjectTypes
|
||||
{
|
||||
BG_DS_OBJECT_DOOR_1 = 0,
|
||||
BG_DS_OBJECT_DOOR_2 = 1,
|
||||
@@ -31,7 +31,7 @@ enum BattleGroundDSObjectTypes
|
||||
BG_DS_OBJECT_MAX = 6
|
||||
};
|
||||
|
||||
enum BattleGroundDSObjects
|
||||
enum BattlegroundDSObjects
|
||||
{
|
||||
BG_DS_OBJECT_TYPE_DOOR_1 = 192642,
|
||||
BG_DS_OBJECT_TYPE_DOOR_2 = 192643,
|
||||
@@ -41,28 +41,28 @@ enum BattleGroundDSObjects
|
||||
BG_DS_OBJECT_TYPE_BUFF_2 = 184664
|
||||
};
|
||||
|
||||
enum BattleGroundDSData
|
||||
enum BattlegroundDSData
|
||||
{ // These values are NOT blizzlike... need the correct data!
|
||||
BG_DS_WATERFALL_TIMER_MIN = 30000,
|
||||
BG_DS_WATERFALL_TIMER_MAX = 60000,
|
||||
BG_DS_WATERFALL_DURATION = 10000,
|
||||
};
|
||||
|
||||
class BattleGroundDSScore : public BattleGroundScore
|
||||
class BattlegroundDSScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundDSScore() {};
|
||||
virtual ~BattleGroundDSScore() {};
|
||||
BattlegroundDSScore() {};
|
||||
virtual ~BattlegroundDSScore() {};
|
||||
//TODO fix me
|
||||
};
|
||||
|
||||
class BattleGroundDS : public BattleGround
|
||||
class BattlegroundDS : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundDS();
|
||||
~BattleGroundDS();
|
||||
BattlegroundDS();
|
||||
~BattlegroundDS();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -72,7 +72,7 @@ class BattleGroundDS : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundEY.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundEY.h"
|
||||
#include "Creature.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
@@ -36,7 +36,7 @@ uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = {
|
||||
200 // holiday
|
||||
};
|
||||
|
||||
BattleGroundEY::BattleGroundEY()
|
||||
BattlegroundEY::BattlegroundEY()
|
||||
{
|
||||
m_BuffChange = true;
|
||||
m_BgObjects.resize(BG_EY_OBJECT_MAX);
|
||||
@@ -52,13 +52,13 @@ BattleGroundEY::BattleGroundEY()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_EY_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundEY::~BattleGroundEY()
|
||||
BattlegroundEY::~BattlegroundEY()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundEY::Update(uint32 diff)
|
||||
void BattlegroundEY::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -102,7 +102,7 @@ void BattleGroundEY::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::StartingEventCloseDoors()
|
||||
void BattlegroundEY::StartingEventCloseDoors()
|
||||
{
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
|
||||
@@ -111,7 +111,7 @@ void BattleGroundEY::StartingEventCloseDoors()
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
void BattleGroundEY::StartingEventOpenDoors()
|
||||
void BattlegroundEY::StartingEventOpenDoors()
|
||||
{
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
|
||||
@@ -126,9 +126,9 @@ void BattleGroundEY::StartingEventOpenDoors()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
|
||||
void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
|
||||
{
|
||||
BattleGroundTeamId team_index = GetTeamIndexByTeamId(Team);
|
||||
BattlegroundTeamId team_index = GetTeamIndexByTeamId(Team);
|
||||
m_TeamScores[team_index] += Points;
|
||||
m_HonorScoreTics[team_index] += Points;
|
||||
if (m_HonorScoreTics[team_index] >= m_HonorTics)
|
||||
@@ -139,7 +139,7 @@ void BattleGroundEY::AddPoints(uint32 Team, uint32 Points)
|
||||
UpdateTeamScore(Team);
|
||||
}
|
||||
|
||||
void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||
void BattlegroundEY::CheckSomeoneJoinedPoint()
|
||||
{
|
||||
GameObject *obj = NULL;
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
@@ -153,7 +153,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
void BattlegroundEY::CheckSomeoneLeftPoint()
|
||||
{
|
||||
//reset current point counts
|
||||
for (uint8 i = 0; i < 2*EY_POINTS_MAX; ++i)
|
||||
@@ -193,7 +193,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
Player *plr = objmgr.GetPlayer(m_PlayersNearPoint[i][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
|
||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||
@@ -218,7 +218,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::UpdatePointStatuses()
|
||||
void BattlegroundEY::UpdatePointStatuses()
|
||||
{
|
||||
for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ void BattleGroundEY::UpdatePointStatuses()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
void BattlegroundEY::UpdateTeamScore(uint32 Team)
|
||||
{
|
||||
uint32 score = GetTeamScore(Team);
|
||||
//TODO there should be some sound played when one team is near victory!! - and define variables
|
||||
@@ -282,7 +282,7 @@ void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
if (score >= BG_EY_MAX_TEAM_SCORE)
|
||||
{
|
||||
score = BG_EY_MAX_TEAM_SCORE;
|
||||
EndBattleGround(Team);
|
||||
EndBattleground(Team);
|
||||
}
|
||||
|
||||
if (Team == ALLIANCE)
|
||||
@@ -291,7 +291,7 @@ void BattleGroundEY::UpdateTeamScore(uint32 Team)
|
||||
UpdateWorldState(EY_HORDE_RESOURCES, score);
|
||||
}
|
||||
|
||||
void BattleGroundEY::EndBattleGround(uint32 winner)
|
||||
void BattlegroundEY::EndBattleground(uint32 winner)
|
||||
{
|
||||
//win reward
|
||||
if (winner == ALLIANCE)
|
||||
@@ -302,10 +302,10 @@ void BattleGroundEY::EndBattleGround(uint32 winner)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
|
||||
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattleGroundEY::UpdatePointsCount(uint32 Team)
|
||||
void BattlegroundEY::UpdatePointsCount(uint32 Team)
|
||||
{
|
||||
if (Team == ALLIANCE)
|
||||
UpdateWorldState(EY_ALLIANCE_BASE, m_TeamPointsCount[BG_TEAM_ALLIANCE]);
|
||||
@@ -313,7 +313,7 @@ void BattleGroundEY::UpdatePointsCount(uint32 Team)
|
||||
UpdateWorldState(EY_HORDE_BASE, m_TeamPointsCount[BG_TEAM_HORDE]);
|
||||
}
|
||||
|
||||
void BattleGroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
|
||||
void BattlegroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
|
||||
{
|
||||
//we MUST firstly send 0, after that we can send 1!!!
|
||||
if (m_PointState[Point] == EY_POINT_UNDER_CONTROL)
|
||||
@@ -334,18 +334,18 @@ void BattleGroundEY::UpdatePointsIcons(uint32 Team, uint32 Point)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::AddPlayer(Player *plr)
|
||||
void BattlegroundEY::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map
|
||||
BattleGroundEYScore* sc = new BattleGroundEYScore;
|
||||
BattlegroundEYScore* sc = new BattlegroundEYScore;
|
||||
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(plr->GetGUID());
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
void BattlegroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
// sometimes flag aura not removed :(
|
||||
for (int j = EY_POINTS_MAX; j >= 0; --j)
|
||||
@@ -369,7 +369,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -418,7 +418,7 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
}
|
||||
}
|
||||
|
||||
bool BattleGroundEY::SetupBattleGround()
|
||||
bool BattlegroundEY::SetupBattleground()
|
||||
{
|
||||
// doors
|
||||
if (!AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY)
|
||||
@@ -475,7 +475,7 @@ bool BattleGroundEY::SetupBattleGround()
|
||||
|| !AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn some object BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -485,38 +485,38 @@ bool BattleGroundEY::SetupBattleGround()
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
|
||||
if (!at)
|
||||
{
|
||||
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
sLog.outError("BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
continue;
|
||||
}
|
||||
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
sLog.outError("BattleGroundEY: Cannot spawn buff");
|
||||
sLog.outError("BattlegroundEY: Cannot spawn buff");
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundEY::Reset()
|
||||
void BattlegroundEY::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
|
||||
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
|
||||
m_TeamScores[BG_TEAM_HORDE] = 0;
|
||||
@@ -530,7 +530,7 @@ void BattleGroundEY::Reset()
|
||||
m_DroppedFlagGUID = 0;
|
||||
m_PointAddingTimer = 0;
|
||||
m_TowerCapCheckTimer = 0;
|
||||
bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
|
||||
bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID());
|
||||
m_HonorTics = (isBGWeekend) ? BG_EY_EYWeekendHonorTicks : BG_EY_NotEYWeekendHonorTicks;
|
||||
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
@@ -545,7 +545,7 @@ void BattleGroundEY::Reset()
|
||||
m_PlayersNearPoint[EY_PLAYERS_OUT_OF_POINTS].reserve(30);
|
||||
}
|
||||
|
||||
void BattleGroundEY::RespawnFlag(bool send_message)
|
||||
void BattlegroundEY::RespawnFlag(bool send_message)
|
||||
{
|
||||
if (m_FlagCapturedBgObjectType > 0)
|
||||
SpawnBGObject(m_FlagCapturedBgObjectType, RESPAWN_ONE_DAY);
|
||||
@@ -563,7 +563,7 @@ void BattleGroundEY::RespawnFlag(bool send_message)
|
||||
UpdateWorldState(NETHERSTORM_FLAG, 1);
|
||||
}
|
||||
|
||||
void BattleGroundEY::RespawnFlagAfterDrop()
|
||||
void BattlegroundEY::RespawnFlagAfterDrop()
|
||||
{
|
||||
RespawnFlag(true);
|
||||
|
||||
@@ -571,21 +571,21 @@ void BattleGroundEY::RespawnFlagAfterDrop()
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
sLog.outError("BattleGroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
|
||||
sLog.outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
|
||||
|
||||
SetDroppedFlagGUID(0);
|
||||
}
|
||||
|
||||
void BattleGroundEY::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundEY::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
EventPlayerDroppedFlag(player);
|
||||
}
|
||||
|
||||
void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
void BattlegroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -621,7 +621,7 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||
SendMessageToAll(LANG_BG_EY_DROPPED_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL);
|
||||
}
|
||||
|
||||
void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
void BattlegroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS || IsFlagPickedup() || !Source->IsWithinDistInMap(target_obj, 10))
|
||||
return;
|
||||
@@ -653,7 +653,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||
PSendMessageToAll(LANG_BG_EY_HAS_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_HORDE, NULL, Source->GetName());
|
||||
}
|
||||
|
||||
void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
|
||||
void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -701,7 +701,7 @@ void BattleGroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
|
||||
DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides
|
||||
}
|
||||
|
||||
void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -768,7 +768,7 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
|
||||
void BattlegroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
|
||||
return;
|
||||
@@ -807,25 +807,25 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType
|
||||
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1);
|
||||
}
|
||||
|
||||
void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found
|
||||
return;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case SCORE_FLAG_CAPTURES: // flags captured
|
||||
((BattleGroundEYScore*)itr->second)->FlagCaptures += value;
|
||||
((BattlegroundEYScore*)itr->second)->FlagCaptures += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG);
|
||||
break;
|
||||
default:
|
||||
BattleGround::UpdatePlayerScore(Source, type, value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundEY::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundEY::FillInitialWorldStates(WorldPacket& data)
|
||||
{
|
||||
data << uint32(EY_HORDE_BASE) << uint32(m_TeamPointsCount[BG_TEAM_HORDE]);
|
||||
data << uint32(EY_ALLIANCE_BASE) << uint32(m_TeamPointsCount[BG_TEAM_ALLIANCE]);
|
||||
@@ -875,7 +875,7 @@ void BattleGroundEY::FillInitialWorldStates(WorldPacket& data)
|
||||
data << uint32(0xc0d) << uint32(0x17b);
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
uint32 g_id = 0;
|
||||
|
||||
@@ -895,7 +895,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
|
||||
if (!entry)
|
||||
{
|
||||
sLog.outError("BattleGroundEY: Not found the main team graveyard. Graveyard system isn't working!");
|
||||
sLog.outError("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
|
||||
if (!entry)
|
||||
sLog.outError("BattleGroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
|
||||
sLog.outError("BattlegroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
|
||||
else
|
||||
{
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
@@ -928,7 +928,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
return nearestEntry;
|
||||
}
|
||||
|
||||
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
bool BattlegroundEY::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for (int i = 0; i < EY_POINTS_MAX; ++i)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "Language.h"
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
#define BG_EY_FLAG_RESPAWN_TIME (8*IN_MILLISECONDS) //8 seconds
|
||||
#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds
|
||||
@@ -85,7 +85,7 @@ enum BG_EY_Spells
|
||||
BG_EY_PLAYER_DROPPED_FLAG_SPELL = 34991
|
||||
};
|
||||
|
||||
enum EYBattleGroundObjectEntry
|
||||
enum EYBattlegroundObjectEntry
|
||||
{
|
||||
BG_OBJECT_A_DOOR_EY_ENTRY = 184719, //Alliance door
|
||||
BG_OBJECT_H_DOOR_EY_ENTRY = 184720, //Horde door
|
||||
@@ -101,7 +101,7 @@ enum EYBattleGroundObjectEntry
|
||||
BG_OBJECT_DR_TOWER_CAP_EY_ENTRY = 184083 //Draenei Tower Cap Pt
|
||||
};
|
||||
|
||||
enum EYBattleGroundPointsTrigger
|
||||
enum EYBattlegroundPointsTrigger
|
||||
{
|
||||
TR_BLOOD_ELF_POINT = 4476,
|
||||
TR_FEL_REALVER_POINT = 4514,
|
||||
@@ -113,7 +113,7 @@ enum EYBattleGroundPointsTrigger
|
||||
TR_DRAENEI_RUINS_BUFF = 4571
|
||||
};
|
||||
|
||||
enum EYBattleGroundGaveyards
|
||||
enum EYBattlegroundGaveyards
|
||||
{
|
||||
EY_GRAVEYARD_MAIN_ALLIANCE = 1103,
|
||||
EY_GRAVEYARD_MAIN_HORDE = 1104,
|
||||
@@ -123,7 +123,7 @@ enum EYBattleGroundGaveyards
|
||||
EY_GRAVEYARD_MAGE_TOWER = 1108
|
||||
};
|
||||
|
||||
enum EYBattleGroundPoints
|
||||
enum EYBattlegroundPoints
|
||||
{
|
||||
FEL_REALVER = 0,
|
||||
BLOOD_ELF = 1,
|
||||
@@ -134,7 +134,7 @@ enum EYBattleGroundPoints
|
||||
EY_POINTS_MAX = 4
|
||||
};
|
||||
|
||||
enum EYBattleGroundCreaturesTypes
|
||||
enum EYBattlegroundCreaturesTypes
|
||||
{
|
||||
EY_SPIRIT_FEL_REALVER = 0,
|
||||
EY_SPIRIT_BLOOD_ELF = 1,
|
||||
@@ -151,7 +151,7 @@ enum EYBattleGroundCreaturesTypes
|
||||
BG_EY_CREATURES_MAX = 10
|
||||
};
|
||||
|
||||
enum EYBattleGroundObjectTypes
|
||||
enum EYBattlegroundObjectTypes
|
||||
{
|
||||
BG_EY_OBJECT_DOOR_A = 0,
|
||||
BG_EY_OBJECT_DOOR_H = 1,
|
||||
@@ -233,7 +233,7 @@ enum BG_EY_FlagState
|
||||
BG_EY_FLAG_STATE_ON_GROUND = 3
|
||||
};
|
||||
|
||||
enum EYBattleGroundPointState
|
||||
enum EYBattlegroundPointState
|
||||
{
|
||||
EY_POINT_NO_OWNER = 0,
|
||||
EY_POINT_STATE_UNCONTROLLED = 0,
|
||||
@@ -245,9 +245,9 @@ enum BG_EY_Objectives
|
||||
EY_OBJECTIVE_CAPTURE_FLAG = 183
|
||||
};
|
||||
|
||||
struct BattleGroundEYPointIconsStruct
|
||||
struct BattlegroundEYPointIconsStruct
|
||||
{
|
||||
BattleGroundEYPointIconsStruct(uint32 _WorldStateControlIndex, uint32 _WorldStateAllianceControlledIndex, uint32 _WorldStateHordeControlledIndex)
|
||||
BattlegroundEYPointIconsStruct(uint32 _WorldStateControlIndex, uint32 _WorldStateAllianceControlledIndex, uint32 _WorldStateHordeControlledIndex)
|
||||
: WorldStateControlIndex(_WorldStateControlIndex), WorldStateAllianceControlledIndex(_WorldStateAllianceControlledIndex), WorldStateHordeControlledIndex(_WorldStateHordeControlledIndex) {}
|
||||
uint32 WorldStateControlIndex;
|
||||
uint32 WorldStateAllianceControlledIndex;
|
||||
@@ -262,9 +262,9 @@ const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = {
|
||||
{2284.48f, 1731.23f, 1189.99f, 2.89725f} // MAGE_TOWER center
|
||||
};
|
||||
|
||||
struct BattleGroundEYLoosingPointStruct
|
||||
struct BattlegroundEYLoosingPointStruct
|
||||
{
|
||||
BattleGroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde)
|
||||
BattlegroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde)
|
||||
: SpawnNeutralObjectType(_SpawnNeutralObjectType),
|
||||
DespawnObjectTypeAlliance(_DespawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
|
||||
DespawnObjectTypeHorde(_DespawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde)
|
||||
@@ -277,9 +277,9 @@ struct BattleGroundEYLoosingPointStruct
|
||||
uint32 MessageIdHorde;
|
||||
};
|
||||
|
||||
struct BattleGroundEYCapturingPointStruct
|
||||
struct BattlegroundEYCapturingPointStruct
|
||||
{
|
||||
BattleGroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId)
|
||||
BattlegroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId)
|
||||
: DespawnNeutralObjectType(_DespawnNeutralObjectType),
|
||||
SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance),
|
||||
SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde),
|
||||
@@ -298,43 +298,43 @@ const uint8 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10};
|
||||
const uint32 BG_EY_FlagPoints[EY_POINTS_MAX] = {75, 85, 100, 500};
|
||||
|
||||
//constant arrays:
|
||||
const BattleGroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] =
|
||||
const BattlegroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] =
|
||||
{
|
||||
BattleGroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL),
|
||||
BattleGroundEYPointIconsStruct(BLOOD_ELF_UNCONTROL, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL),
|
||||
BattleGroundEYPointIconsStruct(DRAENEI_RUINS_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL),
|
||||
BattleGroundEYPointIconsStruct(MAGE_TOWER_UNCONTROL, MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL)
|
||||
BattlegroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL),
|
||||
BattlegroundEYPointIconsStruct(BLOOD_ELF_UNCONTROL, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL),
|
||||
BattlegroundEYPointIconsStruct(DRAENEI_RUINS_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL),
|
||||
BattlegroundEYPointIconsStruct(MAGE_TOWER_UNCONTROL, MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL)
|
||||
};
|
||||
const BattleGroundEYLoosingPointStruct m_LoosingPointTypes[EY_POINTS_MAX] =
|
||||
const BattlegroundEYLoosingPointStruct m_LoosingPointTypes[EY_POINTS_MAX] =
|
||||
{
|
||||
BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_H_F_RUINS),
|
||||
BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_H_B_TOWER),
|
||||
BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_H_D_RUINS),
|
||||
BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_H_M_TOWER)
|
||||
BattlegroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_H_F_RUINS),
|
||||
BattlegroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_H_B_TOWER),
|
||||
BattlegroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_H_D_RUINS),
|
||||
BattlegroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_H_M_TOWER)
|
||||
};
|
||||
const BattleGroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] =
|
||||
const BattlegroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] =
|
||||
{
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REALVER),
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF),
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
|
||||
BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
|
||||
BattlegroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REALVER),
|
||||
BattlegroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF),
|
||||
BattlegroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
|
||||
BattlegroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
|
||||
};
|
||||
|
||||
class BattleGroundEYScore : public BattleGroundScore
|
||||
class BattlegroundEYScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundEYScore () : FlagCaptures(0) {};
|
||||
virtual ~BattleGroundEYScore() {};
|
||||
BattlegroundEYScore () : FlagCaptures(0) {};
|
||||
virtual ~BattlegroundEYScore() {};
|
||||
uint32 FlagCaptures;
|
||||
};
|
||||
|
||||
class BattleGroundEY : public BattleGround
|
||||
class BattlegroundEY : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundEY();
|
||||
~BattleGroundEY();
|
||||
BattlegroundEY();
|
||||
~BattlegroundEY();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -355,10 +355,10 @@ class BattleGroundEY : public BattleGround
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
void HandleKillPlayer(Player *player, Player *killer);
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
virtual bool SetupBattleGround();
|
||||
virtual bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
void UpdateTeamScore(uint32 Team);
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
virtual void FillInitialWorldStates(WorldPacket& data);
|
||||
void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;}
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundIC.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundIC.h"
|
||||
#include "Language.h"
|
||||
|
||||
BattleGroundIC::BattleGroundIC()
|
||||
BattlegroundIC::BattlegroundIC()
|
||||
{
|
||||
m_BgCreatures.resize(2);
|
||||
m_BgObjects.resize(5);
|
||||
@@ -32,57 +32,57 @@ BattleGroundIC::BattleGroundIC()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundIC::~BattleGroundIC()
|
||||
BattlegroundIC::~BattlegroundIC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundIC::Update(uint32 diff)
|
||||
void BattlegroundIC::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
}
|
||||
|
||||
void BattleGroundIC::StartingEventCloseDoors()
|
||||
void BattlegroundIC::StartingEventCloseDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundIC::StartingEventOpenDoors()
|
||||
void BattlegroundIC::StartingEventOpenDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundIC::AddPlayer(Player *plr)
|
||||
void BattlegroundIC::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundICScore* sc = new BattleGroundICScore;
|
||||
BattlegroundICScore* sc = new BattlegroundICScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundIC::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
void BattlegroundIC::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
}
|
||||
|
||||
void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
|
||||
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
std::map<uint64, BattlegroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
}
|
||||
|
||||
bool BattleGroundIC::SetupBattleGround()
|
||||
bool BattlegroundIC::SetupBattleground()
|
||||
{
|
||||
AddObject(0, 195157, 459.72f, -419.93f, 42.55f, 0, 0, 0, 0.9996573f, 0.02617699f, 10*MINUTE);
|
||||
AddObject(1, 195158, 797.72f, -1009.48f, 138.52f, 0, 0, 0, 0.9996573f, 0.02617699f, 10*MINUTE);
|
||||
@@ -94,7 +94,7 @@ bool BattleGroundIC::SetupBattleGround()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundIC::SpawnLeader(uint32 teamid)
|
||||
void BattlegroundIC::SpawnLeader(uint32 teamid)
|
||||
{
|
||||
if (teamid == ALLIANCE)
|
||||
AddCreature(34924, 0, ALLIANCE, 307.03f, -833.04f, 48.91f, 6.23f, 10*MINUTE);
|
||||
@@ -102,7 +102,7 @@ void BattleGroundIC::SpawnLeader(uint32 teamid)
|
||||
AddCreature(34922, 1, HORDE, 1264.42f, -766.80f, 48.91f, 3.28f, 10*MINUTE);
|
||||
}
|
||||
|
||||
void BattleGroundIC::HandleKillUnit(Creature *unit, Player * /*killer*/)
|
||||
void BattlegroundIC::HandleKillUnit(Creature *unit, Player * /*killer*/)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -111,21 +111,21 @@ void BattleGroundIC::HandleKillUnit(Creature *unit, Player * /*killer*/)
|
||||
if (entry == 34924)
|
||||
{
|
||||
RewardHonorToTeam(500,HORDE);
|
||||
EndBattleGround(HORDE);
|
||||
EndBattleground(HORDE);
|
||||
}
|
||||
else if (entry == 34922)
|
||||
{
|
||||
RewardHonorToTeam(500,ALLIANCE);
|
||||
EndBattleGround(ALLIANCE);
|
||||
EndBattleground(ALLIANCE);
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundIC::EndBattleGround(uint32 winner)
|
||||
void BattlegroundIC::EndBattleground(uint32 winner)
|
||||
{
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattleGroundIC::EventPlayerClickedOnFlag(Player * /*source*/, GameObject* /*target_obj*/)
|
||||
void BattlegroundIC::EventPlayerClickedOnFlag(Player * /*source*/, GameObject* /*target_obj*/)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef __BATTLEGROUNDIC_H
|
||||
#define __BATTLEGROUNDIC_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum Buffs
|
||||
{
|
||||
@@ -33,20 +33,20 @@ enum BG_IC_Objectives
|
||||
IC_OBJECTIVE_DEFEND_BASE = 246
|
||||
};
|
||||
|
||||
class BattleGroundICScore : public BattleGroundScore
|
||||
class BattlegroundICScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundICScore() {};
|
||||
virtual ~BattleGroundICScore() {};
|
||||
BattlegroundICScore() {};
|
||||
virtual ~BattlegroundICScore() {};
|
||||
};
|
||||
|
||||
class BattleGroundIC : public BattleGround
|
||||
class BattlegroundIC : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundIC();
|
||||
~BattleGroundIC();
|
||||
BattlegroundIC();
|
||||
~BattlegroundIC();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -56,10 +56,10 @@ class BattleGroundIC : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
void SpawnLeader(uint32 teamid);
|
||||
void HandleKillUnit(Creature *unit, Player *killer);
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
void EventPlayerClickedOnFlag(Player *source, GameObject* /*target_obj*/);
|
||||
|
||||
/* Scorekeeping */
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundNA.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundNA.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
BattleGroundNA::BattleGroundNA()
|
||||
BattlegroundNA::BattlegroundNA()
|
||||
{
|
||||
m_BgObjects.resize(BG_NA_OBJECT_MAX);
|
||||
|
||||
@@ -41,14 +41,14 @@ BattleGroundNA::BattleGroundNA()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundNA::~BattleGroundNA()
|
||||
BattlegroundNA::~BattlegroundNA()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundNA::Update(uint32 diff)
|
||||
void BattlegroundNA::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -56,13 +56,13 @@ void BattleGroundNA::Update(uint32 diff)
|
||||
}*/
|
||||
}
|
||||
|
||||
void BattleGroundNA::StartingEventCloseDoors()
|
||||
void BattlegroundNA::StartingEventCloseDoors()
|
||||
{
|
||||
for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundNA::StartingEventOpenDoors()
|
||||
void BattlegroundNA::StartingEventOpenDoors()
|
||||
{
|
||||
for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
@@ -71,18 +71,18 @@ void BattleGroundNA::StartingEventOpenDoors()
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
void BattleGroundNA::AddPlayer(Player *plr)
|
||||
void BattlegroundNA::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundNAScore* sc = new BattleGroundNAScore;
|
||||
BattlegroundNAScore* sc = new BattlegroundNAScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -91,30 +91,30 @@ void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattleGroundNA: Killer player not found");
|
||||
sLog.outError("BattlegroundNA: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
Battleground::HandleKillPlayer(player,killer);
|
||||
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
bool BattleGroundNA::HandlePlayerUnderMap(Player *player)
|
||||
bool BattlegroundNA::HandlePlayerUnderMap(Player *player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),4055.504395,2919.660645,13.611241,player->GetOrientation(),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -136,19 +136,19 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
// HandleTriggerBuff(buff_guid,Source);
|
||||
}
|
||||
|
||||
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
|
||||
void BattlegroundNA::FillInitialWorldStates(WorldPacket &data)
|
||||
{
|
||||
data << uint32(0xa11) << uint32(1); // 9
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundNA::Reset()
|
||||
void BattlegroundNA::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundNA::SetupBattleGround()
|
||||
bool BattlegroundNA::SetupBattleground()
|
||||
{
|
||||
// gates
|
||||
if (!AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854, 2966.833, 12.6462, -2.648788, 0, 0, 0.9697962, -0.2439165, RESPAWN_IMMEDIATELY)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#ifndef __BATTLEGROUNDNA_H
|
||||
#define __BATTLEGROUNDNA_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BattleGroundNAObjectTypes
|
||||
enum BattlegroundNAObjectTypes
|
||||
{
|
||||
BG_NA_OBJECT_DOOR_1 = 0,
|
||||
BG_NA_OBJECT_DOOR_2 = 1,
|
||||
@@ -33,7 +33,7 @@ enum BattleGroundNAObjectTypes
|
||||
BG_NA_OBJECT_MAX = 6
|
||||
};
|
||||
|
||||
enum BattleGroundNAObjects
|
||||
enum BattlegroundNAObjects
|
||||
{
|
||||
BG_NA_OBJECT_TYPE_DOOR_1 = 183978,
|
||||
BG_NA_OBJECT_TYPE_DOOR_2 = 183980,
|
||||
@@ -43,21 +43,21 @@ enum BattleGroundNAObjects
|
||||
BG_NA_OBJECT_TYPE_BUFF_2 = 184664
|
||||
};
|
||||
|
||||
class BattleGroundNAScore : public BattleGroundScore
|
||||
class BattlegroundNAScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundNAScore() {};
|
||||
virtual ~BattleGroundNAScore() {};
|
||||
BattlegroundNAScore() {};
|
||||
virtual ~BattlegroundNAScore() {};
|
||||
//TODO fix me
|
||||
};
|
||||
|
||||
class BattleGroundNA : public BattleGround
|
||||
class BattlegroundNA : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundNA();
|
||||
~BattleGroundNA();
|
||||
BattlegroundNA();
|
||||
~BattlegroundNA();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -67,7 +67,7 @@ class BattleGroundNA : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket &d);
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
*/
|
||||
|
||||
#include "Player.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundRB.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundRB.h"
|
||||
#include "Language.h"
|
||||
|
||||
BattleGroundRB::BattleGroundRB()
|
||||
BattlegroundRB::BattlegroundRB()
|
||||
{
|
||||
//TODO FIX ME!
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
|
||||
@@ -32,50 +32,50 @@ BattleGroundRB::BattleGroundRB()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundRB::~BattleGroundRB()
|
||||
BattlegroundRB::~BattlegroundRB()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundRB::Update(uint32 diff)
|
||||
void BattlegroundRB::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
}
|
||||
|
||||
void BattleGroundRB::StartingEventCloseDoors()
|
||||
void BattlegroundRB::StartingEventCloseDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundRB::StartingEventOpenDoors()
|
||||
void BattlegroundRB::StartingEventOpenDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundRB::AddPlayer(Player *plr)
|
||||
void BattlegroundRB::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundRBScore* sc = new BattleGroundRBScore;
|
||||
BattlegroundRBScore* sc = new BattlegroundRBScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
void BattlegroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
}
|
||||
|
||||
void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
std::map<uint64, BattlegroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
}
|
||||
|
||||
@@ -21,22 +21,22 @@
|
||||
#ifndef __BATTLEGROUNDRB_H
|
||||
#define __BATTLEGROUNDRB_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
class BattleGroundRBScore : public BattleGroundScore
|
||||
class BattlegroundRBScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundRBScore() {};
|
||||
virtual ~BattleGroundRBScore() {};
|
||||
BattlegroundRBScore() {};
|
||||
virtual ~BattlegroundRBScore() {};
|
||||
};
|
||||
|
||||
class BattleGroundRB : public BattleGround
|
||||
class BattlegroundRB : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundRB();
|
||||
~BattleGroundRB();
|
||||
BattlegroundRB();
|
||||
~BattlegroundRB();
|
||||
void Update(uint32 diff);
|
||||
|
||||
virtual void AddPlayer(Player *plr);
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundRL.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundRL.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
|
||||
BattleGroundRL::BattleGroundRL()
|
||||
BattlegroundRL::BattlegroundRL()
|
||||
{
|
||||
m_BgObjects.resize(BG_RL_OBJECT_MAX);
|
||||
|
||||
@@ -41,14 +41,14 @@ BattleGroundRL::BattleGroundRL()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundRL::~BattleGroundRL()
|
||||
BattlegroundRL::~BattlegroundRL()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundRL::Update(uint32 diff)
|
||||
void BattlegroundRL::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -56,13 +56,13 @@ void BattleGroundRL::Update(uint32 diff)
|
||||
}*/
|
||||
}
|
||||
|
||||
void BattleGroundRL::StartingEventCloseDoors()
|
||||
void BattlegroundRL::StartingEventCloseDoors()
|
||||
{
|
||||
for (uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundRL::StartingEventOpenDoors()
|
||||
void BattlegroundRL::StartingEventOpenDoors()
|
||||
{
|
||||
for (uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
@@ -71,18 +71,18 @@ void BattleGroundRL::StartingEventOpenDoors()
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
void BattleGroundRL::AddPlayer(Player *plr)
|
||||
void BattlegroundRL::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundRLScore* sc = new BattleGroundRLScore;
|
||||
BattlegroundRLScore* sc = new BattlegroundRLScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -91,7 +91,7 @@ void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -102,19 +102,19 @@ void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player,killer);
|
||||
Battleground::HandleKillPlayer(player,killer);
|
||||
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
bool BattleGroundRL::HandlePlayerUnderMap(Player *player)
|
||||
bool BattlegroundRL::HandlePlayerUnderMap(Player *player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(),1285.810547,1667.896851,39.957642,player->GetOrientation(),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -137,19 +137,19 @@ void BattleGroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
// HandleTriggerBuff(buff_guid,Source);
|
||||
}
|
||||
|
||||
void BattleGroundRL::FillInitialWorldStates(WorldPacket &data)
|
||||
void BattlegroundRL::FillInitialWorldStates(WorldPacket &data)
|
||||
{
|
||||
data << uint32(0xbba) << uint32(1); // 9
|
||||
UpdateArenaWorldState();
|
||||
}
|
||||
|
||||
void BattleGroundRL::Reset()
|
||||
void BattlegroundRL::Reset()
|
||||
{
|
||||
//call parent's reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundRL::SetupBattleGround()
|
||||
bool BattlegroundRL::SetupBattleground()
|
||||
{
|
||||
// gates
|
||||
if (!AddObject(BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_1, 1293.561, 1601.938, 31.60557, -1.457349, 0, 0, -0.6658813, 0.7460576, RESPAWN_IMMEDIATELY)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#ifndef __BATTLEGROUNDRL_H
|
||||
#define __BATTLEGROUNDRL_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BattleGroundRLObjectTypes
|
||||
enum BattlegroundRLObjectTypes
|
||||
{
|
||||
BG_RL_OBJECT_DOOR_1 = 0,
|
||||
BG_RL_OBJECT_DOOR_2 = 1,
|
||||
@@ -31,7 +31,7 @@ enum BattleGroundRLObjectTypes
|
||||
BG_RL_OBJECT_MAX = 4
|
||||
};
|
||||
|
||||
enum BattleGroundRLObjects
|
||||
enum BattlegroundRLObjects
|
||||
{
|
||||
BG_RL_OBJECT_TYPE_DOOR_1 = 185918,
|
||||
BG_RL_OBJECT_TYPE_DOOR_2 = 185917,
|
||||
@@ -39,21 +39,21 @@ enum BattleGroundRLObjects
|
||||
BG_RL_OBJECT_TYPE_BUFF_2 = 184664
|
||||
};
|
||||
|
||||
class BattleGroundRLScore : public BattleGroundScore
|
||||
class BattlegroundRLScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundRLScore() {};
|
||||
virtual ~BattleGroundRLScore() {};
|
||||
BattlegroundRLScore() {};
|
||||
virtual ~BattlegroundRLScore() {};
|
||||
//TODO fix me
|
||||
};
|
||||
|
||||
class BattleGroundRL : public BattleGround
|
||||
class BattlegroundRL : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundRL();
|
||||
~BattleGroundRL();
|
||||
BattlegroundRL();
|
||||
~BattlegroundRL();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -65,7 +65,7 @@ class BattleGroundRL : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
};
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundRV.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundRV.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
BattleGroundRV::BattleGroundRV()
|
||||
BattlegroundRV::BattlegroundRV()
|
||||
{
|
||||
m_BgObjects.resize(BG_RV_OBJECT_MAX);
|
||||
|
||||
@@ -41,14 +41,14 @@ BattleGroundRV::BattleGroundRV()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_ARENA_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundRV::~BattleGroundRV()
|
||||
BattlegroundRV::~BattlegroundRV()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void BattleGroundRV::Update(uint32 diff)
|
||||
void BattlegroundRV::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (getTimer() < diff)
|
||||
{
|
||||
@@ -92,11 +92,11 @@ void BattleGroundRV::Update(uint32 diff)
|
||||
setTimer(getTimer() - diff);
|
||||
}
|
||||
|
||||
void BattleGroundRV::StartingEventCloseDoors()
|
||||
void BattlegroundRV::StartingEventCloseDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundRV::StartingEventOpenDoors()
|
||||
void BattlegroundRV::StartingEventOpenDoors()
|
||||
{
|
||||
// Buff respawn
|
||||
SpawnBGObject(BG_RV_OBJECT_BUFF_1, 90);
|
||||
@@ -112,11 +112,11 @@ void BattleGroundRV::StartingEventOpenDoors()
|
||||
setTimer(BG_RV_FIRST_TIMER);
|
||||
}
|
||||
|
||||
void BattleGroundRV::AddPlayer(Player *plr)
|
||||
void BattlegroundRV::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundRVScore* sc = new BattleGroundRVScore;
|
||||
BattlegroundRVScore* sc = new BattlegroundRVScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
|
||||
@@ -124,7 +124,7 @@ void BattleGroundRV::AddPlayer(Player *plr)
|
||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
||||
}
|
||||
|
||||
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
void BattlegroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
{
|
||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return;
|
||||
@@ -135,18 +135,18 @@ void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
void BattleGroundRV::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundRV::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattleGroundRV: Killer player not found");
|
||||
sLog.outError("BattlegroundRV: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
|
||||
UpdateWorldState(BG_RV_WORLD_STATE_A, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||
UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE));
|
||||
@@ -154,14 +154,14 @@ void BattleGroundRV::HandleKillPlayer(Player *player, Player *killer)
|
||||
CheckArenaWinConditions();
|
||||
}
|
||||
|
||||
bool BattleGroundRV::HandlePlayerUnderMap(Player *player)
|
||||
bool BattlegroundRV::HandlePlayerUnderMap(Player *player)
|
||||
{
|
||||
player->TeleportTo(GetMapId(), 763.5, -284, 28.276, 2.422, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void BattleGroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -178,20 +178,20 @@ void BattleGroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundRV::FillInitialWorldStates(WorldPacket &data)
|
||||
void BattlegroundRV::FillInitialWorldStates(WorldPacket &data)
|
||||
{
|
||||
data << uint32(BG_RV_WORLD_STATE_A) << uint32(GetAlivePlayersCountByTeam(ALLIANCE));
|
||||
data << uint32(BG_RV_WORLD_STATE_H) << uint32(GetAlivePlayersCountByTeam(HORDE));
|
||||
data << uint32(BG_RV_WORLD_STATE) << uint32(1);
|
||||
}
|
||||
|
||||
void BattleGroundRV::Reset()
|
||||
void BattlegroundRV::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
}
|
||||
|
||||
bool BattleGroundRV::SetupBattleGround()
|
||||
bool BattlegroundRV::SetupBattleground()
|
||||
{
|
||||
// Fence
|
||||
if (!AddObject(BG_RV_OBJECT_FENCE_1, BG_RV_OBJECT_TYPE_FENCE_1, 763.432373, -274.058197, 28.276695, 3.141593, 0, 0, 0, RESPAWN_IMMEDIATELY)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#ifndef __BATTLEGROUNDRV_H
|
||||
#define __BATTLEGROUNDRV_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
enum BattleGroundRVObjectTypes
|
||||
enum BattlegroundRVObjectTypes
|
||||
{
|
||||
BG_RV_OBJECT_BUFF_1,
|
||||
BG_RV_OBJECT_BUFF_2,
|
||||
@@ -53,7 +53,7 @@ enum BattleGroundRVObjectTypes
|
||||
BG_RV_OBJECT_MAX,
|
||||
};
|
||||
|
||||
enum BattleGroundRVObjects
|
||||
enum BattlegroundRVObjects
|
||||
{
|
||||
BG_RV_OBJECT_TYPE_BUFF_1 = 184663,
|
||||
BG_RV_OBJECT_TYPE_BUFF_2 = 184664,
|
||||
@@ -82,7 +82,7 @@ enum BattleGroundRVObjects
|
||||
BG_RV_OBJECT_TYPE_PILAR_4 = 194587, // ivory
|
||||
};
|
||||
|
||||
enum BattleGroundRVData
|
||||
enum BattlegroundRVData
|
||||
{
|
||||
BG_RV_STATE_OPEN_FENCES,
|
||||
BG_RV_STATE_OPEN_PILARS,
|
||||
@@ -97,20 +97,20 @@ enum BattleGroundRVData
|
||||
BG_RV_WORLD_STATE = 0xe1a,
|
||||
};
|
||||
|
||||
class BattleGroundRVScore : public BattleGroundScore
|
||||
class BattlegroundRVScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundRVScore() {};
|
||||
virtual ~BattleGroundRVScore() {};
|
||||
BattlegroundRVScore() {};
|
||||
virtual ~BattlegroundRVScore() {};
|
||||
};
|
||||
|
||||
class BattleGroundRV : public BattleGround
|
||||
class BattlegroundRV : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundRV();
|
||||
~BattleGroundRV();
|
||||
BattlegroundRV();
|
||||
~BattlegroundRV();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -122,7 +122,7 @@ class BattleGroundRV : public BattleGround
|
||||
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
void HandleKillPlayer(Player* player, Player *killer);
|
||||
bool HandlePlayerUnderMap(Player * plr);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundSA.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundSA.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "GameObject.h"
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "WorldPacket.h"
|
||||
|
||||
|
||||
BattleGroundSA::BattleGroundSA()
|
||||
BattlegroundSA::BattlegroundSA()
|
||||
{
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES;
|
||||
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_SA_START_ONE_MINUTE;
|
||||
@@ -40,11 +40,11 @@ BattleGroundSA::BattleGroundSA()
|
||||
InitSecondRound = false;
|
||||
}
|
||||
|
||||
BattleGroundSA::~BattleGroundSA()
|
||||
BattlegroundSA::~BattlegroundSA()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundSA::Reset()
|
||||
void BattlegroundSA::Reset()
|
||||
{
|
||||
TotalTime = 0;
|
||||
attackers = ((urand(0,1)) ? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
@@ -54,12 +54,12 @@ void BattleGroundSA::Reset()
|
||||
status = BG_SA_WARMUP;
|
||||
}
|
||||
|
||||
bool BattleGroundSA::SetupBattleGround()
|
||||
bool BattlegroundSA::SetupBattleground()
|
||||
{
|
||||
return ResetObjs();
|
||||
}
|
||||
|
||||
bool BattleGroundSA::ResetObjs()
|
||||
bool BattlegroundSA::ResetObjs()
|
||||
{
|
||||
uint32 atF = BG_SA_Factions[attackers];
|
||||
uint32 defF = BG_SA_Factions[attackers ? TEAM_ALLIANCE : TEAM_HORDE];
|
||||
@@ -220,7 +220,7 @@ bool BattleGroundSA::ResetObjs()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundSA::StartShips()
|
||||
void BattlegroundSA::StartShips()
|
||||
{
|
||||
if (ShipsStarted)
|
||||
return;
|
||||
@@ -230,7 +230,7 @@ void BattleGroundSA::StartShips()
|
||||
|
||||
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
|
||||
{
|
||||
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end();itr++)
|
||||
{
|
||||
if (Player* p = objmgr.GetPlayer(itr->first))
|
||||
{
|
||||
@@ -248,7 +248,7 @@ void BattleGroundSA::StartShips()
|
||||
ShipsStarted = true;
|
||||
}
|
||||
|
||||
void BattleGroundSA::Update(uint32 diff)
|
||||
void BattlegroundSA::Update(uint32 diff)
|
||||
{
|
||||
if (InitSecondRound)
|
||||
{
|
||||
@@ -266,7 +266,7 @@ void BattleGroundSA::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
}
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
TotalTime += diff;
|
||||
|
||||
if (status == BG_SA_WARMUP )
|
||||
@@ -337,11 +337,11 @@ void BattleGroundSA::Update(uint32 diff)
|
||||
RoundScores[1].winner = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
|
||||
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleGround(NULL);
|
||||
EndBattleground(NULL);
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -353,15 +353,15 @@ void BattleGroundSA::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::StartingEventCloseDoors()
|
||||
void BattlegroundSA::StartingEventCloseDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundSA::StartingEventOpenDoors()
|
||||
void BattlegroundSA::StartingEventOpenDoors()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundSA::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundSA::FillInitialWorldStates(WorldPacket& data)
|
||||
{
|
||||
uint32 ally_attacks = uint32(attackers == TEAM_ALLIANCE ? 1 : 0);
|
||||
uint32 horde_attacks = uint32(attackers == TEAM_HORDE ? 1 : 0);
|
||||
@@ -401,11 +401,11 @@ void BattleGroundSA::FillInitialWorldStates(WorldPacket& data)
|
||||
data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << ally_attacks;
|
||||
}
|
||||
|
||||
void BattleGroundSA::AddPlayer(Player *plr)
|
||||
void BattlegroundSA::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundSAScore* sc = new BattleGroundSAScore;
|
||||
BattlegroundSAScore* sc = new BattlegroundSAScore;
|
||||
|
||||
if (!ShipsStarted)
|
||||
{
|
||||
@@ -433,34 +433,34 @@ void BattleGroundSA::AddPlayer(Player *plr)
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
void BattlegroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
void BattlegroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
}
|
||||
|
||||
void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found...
|
||||
return;
|
||||
|
||||
if (type == SCORE_DESTROYED_DEMOLISHER)
|
||||
((BattleGroundSAScore*)itr->second)->demolishers_destroyed += value;
|
||||
((BattlegroundSAScore*)itr->second)->demolishers_destroyed += value;
|
||||
else if (type == SCORE_DESTROYED_WALL)
|
||||
((BattleGroundSAScore*)itr->second)->gates_destroyed += value;
|
||||
((BattlegroundSAScore*)itr->second)->gates_destroyed += value;
|
||||
else
|
||||
BattleGround::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source,type,value, doAddHonor);
|
||||
}
|
||||
|
||||
void BattleGroundSA::TeleportPlayers()
|
||||
void BattlegroundSA::TeleportPlayers()
|
||||
{
|
||||
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
{
|
||||
@@ -493,7 +493,7 @@ void BattleGroundSA::TeleportPlayers()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint8 hitType, uint32 destroyedEvent)
|
||||
void BattlegroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint8 hitType, uint32 destroyedEvent)
|
||||
{
|
||||
if (!go || !go->GetGOInfo())
|
||||
return;
|
||||
@@ -525,7 +525,7 @@ void BattleGroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint8 hit
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::HandleKillUnit(Creature* unit, Player* killer)
|
||||
void BattlegroundSA::HandleKillUnit(Creature* unit, Player* killer)
|
||||
{
|
||||
if (!unit)
|
||||
return;
|
||||
@@ -538,7 +538,7 @@ void BattleGroundSA::HandleKillUnit(Creature* unit, Player* killer)
|
||||
You may ask what the fuck does it do?
|
||||
Prevents owner overwriting guns faction with own.
|
||||
*/
|
||||
void BattleGroundSA::OverrideGunFaction()
|
||||
void BattlegroundSA::OverrideGunFaction()
|
||||
{
|
||||
if (!m_BgCreatures[0])
|
||||
return;
|
||||
@@ -556,7 +556,7 @@ void BattleGroundSA::OverrideGunFaction()
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::DemolisherStartState(bool start)
|
||||
void BattlegroundSA::DemolisherStartState(bool start)
|
||||
{
|
||||
if (!m_BgCreatures[0])
|
||||
return;
|
||||
@@ -573,7 +573,7 @@ void BattleGroundSA::DemolisherStartState(bool start)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent)
|
||||
void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroyedEvent)
|
||||
{
|
||||
uint32 i = GetGateIDFromDestroyEventID(destroyedEvent);
|
||||
if (!GateStatus[i])
|
||||
@@ -617,7 +617,7 @@ void BattleGroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroye
|
||||
}
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattleGroundSA::GetClosestGraveYard(Player* player)
|
||||
WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
uint32 safeloc = 0;
|
||||
WorldSafeLocsEntry const* ret;
|
||||
@@ -652,7 +652,7 @@ WorldSafeLocsEntry const* BattleGroundSA::GetClosestGraveYard(Player* player)
|
||||
return closest;
|
||||
}
|
||||
|
||||
void BattleGroundSA::SendTime()
|
||||
void BattlegroundSA::SendTime()
|
||||
{
|
||||
uint32 end_of_round = (BG_SA_ENDROUNDTIME - TotalTime);
|
||||
UpdateWorldState(BG_SA_TIMER_MINS, end_of_round/60000);
|
||||
@@ -660,7 +660,7 @@ void BattleGroundSA::SendTime()
|
||||
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000);
|
||||
}
|
||||
|
||||
void BattleGroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
void BattlegroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
{
|
||||
switch(target_obj->GetEntry())
|
||||
{
|
||||
@@ -684,7 +684,7 @@ void BattleGroundSA::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||
};
|
||||
}
|
||||
|
||||
void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
||||
void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
||||
{
|
||||
if (GraveyardStatus[i] == attackers)
|
||||
return;
|
||||
@@ -757,7 +757,7 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
||||
};
|
||||
}
|
||||
|
||||
void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
{
|
||||
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] && GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED)
|
||||
{
|
||||
@@ -787,23 +787,23 @@ void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
|
||||
RoundScores[1].winner = attackers;
|
||||
RoundScores[1].time = TotalTime;ToggleTimer();
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleGround(NULL);
|
||||
EndBattleground(NULL);
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleGround(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
EndBattleGround(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
EndBattleground(RoundScores[1].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundSA::ToggleTimer()
|
||||
void BattlegroundSA::ToggleTimer()
|
||||
{
|
||||
TimerEnabled = !TimerEnabled;
|
||||
UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0);
|
||||
}
|
||||
|
||||
void BattleGroundSA::EndBattleGround(uint32 winner)
|
||||
void BattlegroundSA::EndBattleground(uint32 winner)
|
||||
{
|
||||
//honor reward for winning
|
||||
if (winner == ALLIANCE)
|
||||
@@ -815,10 +815,10 @@ void BattleGroundSA::EndBattleGround(uint32 winner)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE);
|
||||
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattleGroundSA::UpdateDemolisherSpawns()
|
||||
void BattlegroundSA::UpdateDemolisherSpawns()
|
||||
{
|
||||
for (uint8 i = BG_SA_DEMOLISHER_1; i <= BG_SA_DEMOLISHER_4; i++)
|
||||
{
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
#ifndef __BATTLEGROUNDSA_H
|
||||
#define __BATTLEGROUNDSA_H
|
||||
|
||||
class BattleGround;
|
||||
class Battleground;
|
||||
|
||||
class BattleGroundSAScore : public BattleGroundScore
|
||||
class BattlegroundSAScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundSAScore(): demolishers_destroyed(0), gates_destroyed(0) {};
|
||||
virtual ~BattleGroundSAScore() {};
|
||||
BattlegroundSAScore(): demolishers_destroyed(0), gates_destroyed(0) {};
|
||||
virtual ~BattlegroundSAScore() {};
|
||||
uint8 demolishers_destroyed;
|
||||
uint8 gates_destroyed;
|
||||
};
|
||||
@@ -399,20 +399,20 @@ struct BG_SA_RoundScore
|
||||
uint32 time;
|
||||
};
|
||||
|
||||
class BattleGroundSA : public BattleGround
|
||||
class BattlegroundSA : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
BattleGroundSA();
|
||||
~BattleGroundSA();
|
||||
BattlegroundSA();
|
||||
~BattlegroundSA();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
virtual void AddPlayer(Player *plr);
|
||||
virtual void StartingEventCloseDoors();
|
||||
virtual void StartingEventOpenDoors();
|
||||
virtual bool SetupBattleGround();
|
||||
virtual bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
virtual void FillInitialWorldStates(WorldPacket& data);
|
||||
virtual void EventPlayerDamagedGO(Player* plr, GameObject* go, uint8 hitType, uint32 destroyedEvent);
|
||||
@@ -448,7 +448,7 @@ class BattleGroundSA : public BattleGround
|
||||
}
|
||||
return uws;
|
||||
}
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
|
||||
void RemovePlayer(Player *plr,uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundWS.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "Language.h"
|
||||
#include "Object.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
@@ -49,7 +49,7 @@ uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = {
|
||||
{0,45,0} // holiday
|
||||
};
|
||||
|
||||
BattleGroundWS::BattleGroundWS()
|
||||
BattlegroundWS::BattlegroundWS()
|
||||
{
|
||||
m_BgObjects.resize(BG_WS_OBJECT_MAX);
|
||||
m_BgCreatures.resize(BG_CREATURES_MAX_WS);
|
||||
@@ -60,13 +60,13 @@ BattleGroundWS::BattleGroundWS()
|
||||
m_StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN;
|
||||
}
|
||||
|
||||
BattleGroundWS::~BattleGroundWS()
|
||||
BattlegroundWS::~BattlegroundWS()
|
||||
{
|
||||
}
|
||||
|
||||
void BattleGroundWS::Update(uint32 diff)
|
||||
void BattlegroundWS::Update(uint32 diff)
|
||||
{
|
||||
BattleGround::Update(diff);
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -75,21 +75,21 @@ void BattleGroundWS::Update(uint32 diff)
|
||||
if (GetTeamScore(ALLIANCE) == 0)
|
||||
{
|
||||
if (GetTeamScore(HORDE) == 0) // No one scored - result is tie
|
||||
EndBattleGround(NULL);
|
||||
EndBattleground(NULL);
|
||||
else // Horde has more points and thus wins
|
||||
EndBattleGround(HORDE);
|
||||
EndBattleground(HORDE);
|
||||
}
|
||||
|
||||
else if (GetTeamScore(HORDE) == 0)
|
||||
EndBattleGround(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
|
||||
EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
|
||||
|
||||
else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the last flag
|
||||
EndBattleGround(m_LastFlagCaptureTeam);
|
||||
EndBattleground(m_LastFlagCaptureTeam);
|
||||
|
||||
else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score
|
||||
EndBattleGround(HORDE);
|
||||
EndBattleground(HORDE);
|
||||
else
|
||||
EndBattleGround(ALLIANCE);
|
||||
EndBattleground(ALLIANCE);
|
||||
}
|
||||
else if (GetStartTime() > m_minutesElapsed*MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ void BattleGroundWS::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundWS::StartingEventCloseDoors()
|
||||
void BattlegroundWS::StartingEventCloseDoors()
|
||||
{
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i)
|
||||
{
|
||||
@@ -187,7 +187,7 @@ void BattleGroundWS::StartingEventCloseDoors()
|
||||
UpdateWorldState(BG_WS_STATE_TIMER, 25);
|
||||
}
|
||||
|
||||
void BattleGroundWS::StartingEventOpenDoors()
|
||||
void BattlegroundWS::StartingEventOpenDoors()
|
||||
{
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; ++i)
|
||||
DoorOpen(i);
|
||||
@@ -203,16 +203,16 @@ void BattleGroundWS::StartingEventOpenDoors()
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundWS::AddPlayer(Player *plr)
|
||||
void BattlegroundWS::AddPlayer(Player *plr)
|
||||
{
|
||||
BattleGround::AddPlayer(plr);
|
||||
Battleground::AddPlayer(plr);
|
||||
//create score and add it to map, default values are set in constructor
|
||||
BattleGroundWGScore* sc = new BattleGroundWGScore;
|
||||
BattlegroundWGScore* sc = new BattlegroundWGScore;
|
||||
|
||||
m_PlayerScores[plr->GetGUID()] = sc;
|
||||
}
|
||||
|
||||
void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
{
|
||||
if (Team == ALLIANCE)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
m_BothFlagsKept = false;
|
||||
}
|
||||
|
||||
void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -265,7 +265,7 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
m_BothFlagsKept = false;
|
||||
}
|
||||
|
||||
void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||
void BattlegroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -343,7 +343,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||
UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 0);
|
||||
|
||||
RewardHonorToTeam(BG_WSG_Honor[m_HonorMode][BG_WSG_WIN], winner);
|
||||
EndBattleGround(winner);
|
||||
EndBattleground(winner);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -351,7 +351,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||
void BattlegroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
{
|
||||
@@ -437,7 +437,7 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -556,14 +556,14 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||
}
|
||||
|
||||
void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
// sometimes flag aura not removed :(
|
||||
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||
sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
this->SetAllianceFlagPicker(0);
|
||||
this->RespawnFlag(ALLIANCE, false);
|
||||
}
|
||||
@@ -574,7 +574,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||
sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
this->SetHordeFlagPicker(0);
|
||||
this->RespawnFlag(HORDE, false);
|
||||
}
|
||||
@@ -583,7 +583,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
|
||||
void BattlegroundWS::UpdateFlagState(uint32 team, uint32 value)
|
||||
{
|
||||
if (team == ALLIANCE)
|
||||
UpdateWorldState(BG_WS_FLAG_STATE_ALLIANCE, value);
|
||||
@@ -591,7 +591,7 @@ void BattleGroundWS::UpdateFlagState(uint32 team, uint32 value)
|
||||
UpdateWorldState(BG_WS_FLAG_STATE_HORDE, value);
|
||||
}
|
||||
|
||||
void BattleGroundWS::UpdateTeamScore(uint32 team)
|
||||
void BattlegroundWS::UpdateTeamScore(uint32 team)
|
||||
{
|
||||
if (team == ALLIANCE)
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(team));
|
||||
@@ -599,7 +599,7 @@ void BattleGroundWS::UpdateTeamScore(uint32 team)
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(team));
|
||||
}
|
||||
|
||||
void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
@@ -609,10 +609,10 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
//uint64 buff_guid = 0;
|
||||
switch(Trigger)
|
||||
{
|
||||
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update().
|
||||
case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
|
||||
//buff_guid = m_BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
|
||||
break;
|
||||
case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update().
|
||||
case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
|
||||
//buff_guid = m_BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
|
||||
break;
|
||||
case 3706: // Alliance elixir of regeneration spawn
|
||||
@@ -652,7 +652,7 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
// HandleTriggerBuff(buff_guid,Source);
|
||||
}
|
||||
|
||||
bool BattleGroundWS::SetupBattleGround()
|
||||
bool BattlegroundWS::SetupBattleground()
|
||||
{
|
||||
// flags
|
||||
if (!AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
|
||||
@@ -678,21 +678,21 @@ bool BattleGroundWS::SetupBattleGround()
|
||||
|| !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn some object BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const *sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! BattleGround not created!");
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -701,10 +701,10 @@ bool BattleGroundWS::SetupBattleGround()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattleGroundWS::Reset()
|
||||
void BattlegroundWS::Reset()
|
||||
{
|
||||
//call parent's class reset
|
||||
BattleGround::Reset();
|
||||
Battleground::Reset();
|
||||
|
||||
m_FlagKeepers[BG_TEAM_ALLIANCE] = 0;
|
||||
m_FlagKeepers[BG_TEAM_HORDE] = 0;
|
||||
@@ -714,7 +714,7 @@ void BattleGroundWS::Reset()
|
||||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
m_TeamScores[BG_TEAM_ALLIANCE] = 0;
|
||||
m_TeamScores[BG_TEAM_HORDE] = 0;
|
||||
bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
|
||||
bool isBGWeekend = sBattlegroundMgr.IsBGWeekend(GetTypeID());
|
||||
m_ReputationCapture = (isBGWeekend) ? 45 : 35;
|
||||
m_HonorWinKills = (isBGWeekend) ? 3 : 1;
|
||||
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
|
||||
@@ -730,7 +730,7 @@ void BattleGroundWS::Reset()
|
||||
*/
|
||||
}
|
||||
|
||||
void BattleGroundWS::EndBattleGround(uint32 winner)
|
||||
void BattlegroundWS::EndBattleground(uint32 winner)
|
||||
{
|
||||
//win reward
|
||||
if (winner == ALLIANCE)
|
||||
@@ -741,43 +741,43 @@ void BattleGroundWS::EndBattleGround(uint32 winner)
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE);
|
||||
|
||||
BattleGround::EndBattleGround(winner);
|
||||
Battleground::EndBattleground(winner);
|
||||
}
|
||||
|
||||
void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)
|
||||
void BattlegroundWS::HandleKillPlayer(Player *player, Player *killer)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
EventPlayerDroppedFlag(player);
|
||||
|
||||
BattleGround::HandleKillPlayer(player, killer);
|
||||
Battleground::HandleKillPlayer(player, killer);
|
||||
}
|
||||
|
||||
void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
void BattlegroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor)
|
||||
{
|
||||
|
||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
BattlegroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
||||
if (itr == m_PlayerScores.end()) // player not found
|
||||
return;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case SCORE_FLAG_CAPTURES: // flags captured
|
||||
((BattleGroundWGScore*)itr->second)->FlagCaptures += value;
|
||||
((BattlegroundWGScore*)itr->second)->FlagCaptures += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG);
|
||||
break;
|
||||
case SCORE_FLAG_RETURNS: // flags returned
|
||||
((BattleGroundWGScore*)itr->second)->FlagReturns += value;
|
||||
((BattlegroundWGScore*)itr->second)->FlagReturns += value;
|
||||
Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG);
|
||||
break;
|
||||
default:
|
||||
BattleGround::UpdatePlayerScore(Source, type, value, doAddHonor);
|
||||
Battleground::UpdatePlayerScore(Source, type, value, doAddHonor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
|
||||
WorldSafeLocsEntry const* BattlegroundWS::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
//if status in progress, it returns main graveyards with spiritguides
|
||||
//else it will return the graveyard in the flagroom - this is especially good
|
||||
@@ -800,7 +800,7 @@ WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player)
|
||||
}
|
||||
}
|
||||
|
||||
void BattleGroundWS::FillInitialWorldStates(WorldPacket& data)
|
||||
void BattlegroundWS::FillInitialWorldStates(WorldPacket& data)
|
||||
{
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_ALLIANCE) << uint32(GetTeamScore(ALLIANCE));
|
||||
data << uint32(BG_WS_FLAG_CAPTURES_HORDE) << uint32(GetTeamScore(HORDE));
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef __BATTLEGROUNDWS_H
|
||||
#define __BATTLEGROUNDWS_H
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "Battleground.h"
|
||||
|
||||
enum BG_WS_TimerOrScore
|
||||
{
|
||||
@@ -144,23 +144,23 @@ enum BG_WS_Objectives
|
||||
WS_OBJECTIVE_RETURN_FLAG = 44
|
||||
};
|
||||
|
||||
class BattleGroundWGScore : public BattleGroundScore
|
||||
class BattlegroundWGScore : public BattlegroundScore
|
||||
{
|
||||
public:
|
||||
BattleGroundWGScore() : FlagCaptures(0), FlagReturns(0) {};
|
||||
virtual ~BattleGroundWGScore() {};
|
||||
BattlegroundWGScore() : FlagCaptures(0), FlagReturns(0) {};
|
||||
virtual ~BattlegroundWGScore() {};
|
||||
uint32 FlagCaptures;
|
||||
uint32 FlagReturns;
|
||||
};
|
||||
|
||||
class BattleGroundWS : public BattleGround
|
||||
class BattlegroundWS : public Battleground
|
||||
{
|
||||
friend class BattleGroundMgr;
|
||||
friend class BattlegroundMgr;
|
||||
|
||||
public:
|
||||
/* Construction */
|
||||
BattleGroundWS();
|
||||
~BattleGroundWS();
|
||||
BattlegroundWS();
|
||||
~BattlegroundWS();
|
||||
void Update(uint32 diff);
|
||||
|
||||
/* inherited from BattlegroundClass */
|
||||
@@ -191,9 +191,9 @@ class BattleGroundWS : public BattleGround
|
||||
void RemovePlayer(Player *plr, uint64 guid);
|
||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||
void HandleKillPlayer(Player *player, Player *killer);
|
||||
bool SetupBattleGround();
|
||||
bool SetupBattleground();
|
||||
virtual void Reset();
|
||||
void EndBattleGround(uint32 winner);
|
||||
void EndBattleground(uint32 winner);
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
|
||||
void UpdateFlagState(uint32 team, uint32 value);
|
||||
|
||||
Reference in New Issue
Block a user