* Rename: BattleGround -> Battleground.
--HG-- branch : trunk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user