mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9892] Cleanups for BattleGroundEY code
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also prevent send uninitilized mark data in case BATTLEGROUND_EY end. Simplify related code.
This commit is contained in:
parent
312a076491
commit
19b5d777cd
4 changed files with 75 additions and 94 deletions
|
|
@ -855,42 +855,30 @@ uint32 BattleGround::GetBattlemasterEntry() const
|
||||||
|
|
||||||
void BattleGround::RewardMark(Player *plr,uint32 count)
|
void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||||
{
|
{
|
||||||
BattleGroundMarks mark;
|
|
||||||
bool IsSpell;
|
|
||||||
switch(GetTypeID())
|
switch(GetTypeID())
|
||||||
{
|
{
|
||||||
case BATTLEGROUND_AV:
|
case BATTLEGROUND_AV:
|
||||||
IsSpell = true;
|
|
||||||
if (count == ITEM_WINNER_COUNT)
|
if (count == ITEM_WINNER_COUNT)
|
||||||
mark = SPELL_AV_MARK_WINNER;
|
RewardSpellCast(plr,SPELL_AV_MARK_WINNER);
|
||||||
else
|
else
|
||||||
mark = SPELL_AV_MARK_LOSER;
|
RewardSpellCast(plr,SPELL_AV_MARK_LOSER);
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_WS:
|
case BATTLEGROUND_WS:
|
||||||
IsSpell = true;
|
|
||||||
if (count == ITEM_WINNER_COUNT)
|
if (count == ITEM_WINNER_COUNT)
|
||||||
mark = SPELL_WS_MARK_WINNER;
|
RewardSpellCast(plr,SPELL_WS_MARK_WINNER);
|
||||||
else
|
else
|
||||||
mark = SPELL_WS_MARK_LOSER;
|
RewardSpellCast(plr,SPELL_WS_MARK_LOSER);
|
||||||
break;
|
break;
|
||||||
case BATTLEGROUND_AB:
|
case BATTLEGROUND_AB:
|
||||||
IsSpell = true;
|
|
||||||
if (count == ITEM_WINNER_COUNT)
|
if (count == ITEM_WINNER_COUNT)
|
||||||
mark = SPELL_AB_MARK_WINNER;
|
RewardSpellCast(plr,SPELL_AB_MARK_WINNER);
|
||||||
else
|
else
|
||||||
mark = SPELL_AB_MARK_LOSER;
|
RewardSpellCast(plr,SPELL_AB_MARK_LOSER);
|
||||||
break;
|
|
||||||
case BATTLEGROUND_EY:
|
|
||||||
IsSpell = false;
|
|
||||||
break;
|
break;
|
||||||
|
case BATTLEGROUND_EY: // no rewards
|
||||||
default:
|
default:
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsSpell)
|
|
||||||
RewardSpellCast(plr,mark);
|
|
||||||
else
|
|
||||||
RewardItem(plr,mark,count);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
|
void BattleGround::RewardSpellCast(Player *plr, uint32 spell_id)
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@ BattleGroundEY::BattleGroundEY()
|
||||||
m_BuffChange = true;
|
m_BuffChange = true;
|
||||||
m_BgObjects.resize(BG_EY_OBJECT_MAX);
|
m_BgObjects.resize(BG_EY_OBJECT_MAX);
|
||||||
|
|
||||||
m_Points_Trigger[FEL_REALVER] = TR_FEL_REALVER_BUFF;
|
m_Points_Trigger[BG_EY_NODE_FEL_REAVER] = TR_FEL_REAVER_BUFF;
|
||||||
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
|
m_Points_Trigger[BG_EY_NODE_BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
|
||||||
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
|
m_Points_Trigger[BG_EY_NODE_DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
|
||||||
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
|
m_Points_Trigger[BG_EY_NODE_MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
|
||||||
|
|
||||||
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
|
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0;
|
||||||
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
|
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
|
||||||
|
|
@ -107,7 +107,7 @@ void BattleGroundEY::StartingEventOpenDoors()
|
||||||
{
|
{
|
||||||
//randomly spawn buff
|
//randomly spawn buff
|
||||||
uint8 buff = urand(0, 2);
|
uint8 buff = urand(0, 2);
|
||||||
SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER + buff + i * 3], RESPAWN_IMMEDIATELY);
|
SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3], RESPAWN_IMMEDIATELY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,12 +129,12 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||||
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
|
for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i)
|
||||||
{
|
{
|
||||||
uint8 j = 0;
|
uint8 j = 0;
|
||||||
while (j < m_PlayersNearPoint[BG_EY_NODES_MAX].size())
|
while (j < m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].size())
|
||||||
{
|
{
|
||||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
|
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_NODES_MAX][j]));
|
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]));
|
||||||
++j;
|
++j;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -147,9 +147,9 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||||
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr);
|
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr);
|
||||||
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr);
|
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr);
|
||||||
//add player to point
|
//add player to point
|
||||||
m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_NODES_MAX][j]);
|
m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
|
||||||
//remove player from "free space"
|
//remove player from "free space"
|
||||||
m_PlayersNearPoint[BG_EY_NODES_MAX].erase(m_PlayersNearPoint[BG_EY_NODES_MAX].begin() + j);
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].erase(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].begin() + j);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
++j;
|
++j;
|
||||||
|
|
@ -172,7 +172,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||||
{
|
{
|
||||||
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
|
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
|
||||||
m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(m_PlayersNearPoint[i][j]);
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
|
||||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||||
++j;
|
++j;
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -181,7 +181,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||||
!plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS))
|
!plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS))
|
||||||
//move player out of point (add him to players that are out of points
|
//move player out of point (add him to players that are out of points
|
||||||
{
|
{
|
||||||
m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(m_PlayersNearPoint[i][j]);
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
|
||||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||||
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW, plr);
|
UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW, plr);
|
||||||
}
|
}
|
||||||
|
|
@ -307,7 +307,7 @@ void BattleGroundEY::AddPlayer(Player *plr)
|
||||||
//create score and add it to map
|
//create score and add it to map
|
||||||
BattleGroundEYScore* sc = new BattleGroundEYScore;
|
BattleGroundEYScore* sc = new BattleGroundEYScore;
|
||||||
|
|
||||||
m_PlayersNearPoint[BG_EY_NODES_MAX].push_back(plr->GetGUID());
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetGUID());
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetGUID()] = sc;
|
||||||
}
|
}
|
||||||
|
|
@ -347,22 +347,22 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||||
switch(Trigger)
|
switch(Trigger)
|
||||||
{
|
{
|
||||||
case TR_BLOOD_ELF_POINT:
|
case TR_BLOOD_ELF_POINT:
|
||||||
if (m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BLOOD_ELF] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
|
||||||
break;
|
break;
|
||||||
case TR_FEL_REALVER_POINT:
|
case TR_FEL_REAVER_POINT:
|
||||||
if (m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[FEL_REALVER] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REALVER);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REAVER);
|
||||||
break;
|
break;
|
||||||
case TR_MAGE_TOWER_POINT:
|
case TR_MAGE_TOWER_POINT:
|
||||||
if (m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[MAGE_TOWER] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
|
||||||
break;
|
break;
|
||||||
case TR_DRAENEI_RUINS_POINT:
|
case TR_DRAENEI_RUINS_POINT:
|
||||||
if (m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[DRAENEI_RUINS] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
|
||||||
break;
|
break;
|
||||||
|
|
@ -376,6 +376,7 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||||
case 4569:
|
case 4569:
|
||||||
case 4570:
|
case 4570:
|
||||||
case 4571:
|
case 4571:
|
||||||
|
case 5866:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||||
|
|
@ -395,9 +396,9 @@ bool BattleGroundEY::SetupBattleGround()
|
||||||
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
sLog.outError("BattleGroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||||
continue;
|
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)
|
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + 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_REAVER + 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)
|
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + 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");
|
||||||
}
|
}
|
||||||
|
|
@ -436,8 +437,8 @@ void BattleGroundEY::Reset()
|
||||||
// the flag in the middle is spawned at beginning
|
// the flag in the middle is spawned at beginning
|
||||||
m_ActiveEvents[BG_EY_EVENT_CAPTURE_FLAG] = BG_EY_EVENT2_FLAG_CENTER;
|
m_ActiveEvents[BG_EY_EVENT_CAPTURE_FLAG] = BG_EY_EVENT2_FLAG_CENTER;
|
||||||
|
|
||||||
m_PlayersNearPoint[EY_PLAYERS_OUT_OF_POINTS].clear();
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].clear();
|
||||||
m_PlayersNearPoint[EY_PLAYERS_OUT_OF_POINTS].reserve(30);
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].reserve(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundEY::RespawnFlag(bool send_message)
|
void BattleGroundEY::RespawnFlag(bool send_message)
|
||||||
|
|
@ -673,18 +674,18 @@ void BattleGroundEY::FillInitialWorldStates(WorldPacket& data, uint32& count)
|
||||||
FillInitialWorldState(data, count, 0xab0, 0x0);
|
FillInitialWorldState(data, count, 0xab0, 0x0);
|
||||||
FillInitialWorldState(data, count, 0xaaf, 0x0);
|
FillInitialWorldState(data, count, 0xaaf, 0x0);
|
||||||
|
|
||||||
FillInitialWorldState(data, count, DRAENEI_RUINS_HORDE_CONTROL, m_PointOwnedByTeam[DRAENEI_RUINS] == HORDE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, DRAENEI_RUINS_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == HORDE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, DRAENEI_RUINS_ALLIANCE_CONTROL, m_PointOwnedByTeam[DRAENEI_RUINS] == ALLIANCE && m_PointState[DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, DRAENEI_RUINS_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == ALLIANCE && m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, DRAENEI_RUINS_UNCONTROL, m_PointState[DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, DRAENEI_RUINS_UNCONTROL, m_PointState[BG_EY_NODE_DRAENEI_RUINS] != EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, MAGE_TOWER_ALLIANCE_CONTROL, m_PointOwnedByTeam[MAGE_TOWER] == ALLIANCE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, MAGE_TOWER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == ALLIANCE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, MAGE_TOWER_HORDE_CONTROL, m_PointOwnedByTeam[MAGE_TOWER] == HORDE && m_PointState[MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, MAGE_TOWER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == HORDE && m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, MAGE_TOWER_UNCONTROL, m_PointState[MAGE_TOWER] != EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, MAGE_TOWER_UNCONTROL, m_PointState[BG_EY_NODE_MAGE_TOWER] != EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, FEL_REAVER_HORDE_CONTROL, m_PointOwnedByTeam[FEL_REALVER] == HORDE && m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, FEL_REAVER_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == HORDE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, FEL_REAVER_ALLIANCE_CONTROL, m_PointOwnedByTeam[FEL_REALVER] == ALLIANCE && m_PointState[FEL_REALVER] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, FEL_REAVER_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == ALLIANCE && m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, FEL_REAVER_UNCONTROL, m_PointState[FEL_REALVER] != EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, FEL_REAVER_UNCONTROL, m_PointState[BG_EY_NODE_FEL_REAVER] != EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, BLOOD_ELF_HORDE_CONTROL, m_PointOwnedByTeam[BLOOD_ELF] == HORDE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, BLOOD_ELF_HORDE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == HORDE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, BLOOD_ELF_ALLIANCE_CONTROL, m_PointOwnedByTeam[BLOOD_ELF] == ALLIANCE && m_PointState[BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, BLOOD_ELF_ALLIANCE_CONTROL, m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == ALLIANCE && m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, BLOOD_ELF_UNCONTROL, m_PointState[BLOOD_ELF] != EY_POINT_UNDER_CONTROL);
|
FillInitialWorldState(data, count, BLOOD_ELF_UNCONTROL, m_PointState[BG_EY_NODE_BLOOD_ELF] != EY_POINT_UNDER_CONTROL);
|
||||||
FillInitialWorldState(data, count, NETHERSTORM_FLAG, m_FlagState == BG_EY_FLAG_STATE_ON_BASE);
|
FillInitialWorldState(data, count, NETHERSTORM_FLAG, m_FlagState == BG_EY_FLAG_STATE_ON_BASE);
|
||||||
FillInitialWorldState(data, count, 0xad2, 0x1);
|
FillInitialWorldState(data, count, 0xad2, 0x1);
|
||||||
FillInitialWorldState(data, count, 0xad1, 0x1);
|
FillInitialWorldState(data, count, 0xad1, 0x1);
|
||||||
|
|
@ -753,10 +754,9 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||||
|
|
||||||
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
|
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
|
||||||
{
|
{
|
||||||
uint32 count = 0;
|
|
||||||
for(int i = 0; i < BG_EY_NODES_MAX; ++i)
|
for(int i = 0; i < BG_EY_NODES_MAX; ++i)
|
||||||
if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EY_POINT_UNDER_CONTROL)
|
if (m_PointState[i] != EY_POINT_UNDER_CONTROL || m_PointOwnedByTeam[i] != team)
|
||||||
++count;
|
return false;
|
||||||
|
|
||||||
return count == BG_EY_NODES_MAX;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,11 +86,11 @@ enum BG_EY_Spells
|
||||||
enum EYBattleGroundPointsTrigger
|
enum EYBattleGroundPointsTrigger
|
||||||
{
|
{
|
||||||
TR_BLOOD_ELF_POINT = 4476,
|
TR_BLOOD_ELF_POINT = 4476,
|
||||||
TR_FEL_REALVER_POINT = 4514,
|
TR_FEL_REAVER_POINT = 4514,
|
||||||
TR_MAGE_TOWER_POINT = 4516,
|
TR_MAGE_TOWER_POINT = 4516,
|
||||||
TR_DRAENEI_RUINS_POINT = 4518,
|
TR_DRAENEI_RUINS_POINT = 4518,
|
||||||
TR_BLOOD_ELF_BUFF = 4568,
|
TR_BLOOD_ELF_BUFF = 4568,
|
||||||
TR_FEL_REALVER_BUFF = 4569,
|
TR_FEL_REAVER_BUFF = 4569,
|
||||||
TR_MAGE_TOWER_BUFF = 4570,
|
TR_MAGE_TOWER_BUFF = 4570,
|
||||||
TR_DRAENEI_RUINS_BUFF = 4571
|
TR_DRAENEI_RUINS_BUFF = 4571
|
||||||
};
|
};
|
||||||
|
|
@ -99,54 +99,47 @@ enum EYBattleGroundGaveyards
|
||||||
{
|
{
|
||||||
EY_GRAVEYARD_MAIN_ALLIANCE = 1103,
|
EY_GRAVEYARD_MAIN_ALLIANCE = 1103,
|
||||||
EY_GRAVEYARD_MAIN_HORDE = 1104,
|
EY_GRAVEYARD_MAIN_HORDE = 1104,
|
||||||
EY_GRAVEYARD_FEL_REALVER = 1105,
|
EY_GRAVEYARD_FEL_REAVER = 1105,
|
||||||
EY_GRAVEYARD_BLOOD_ELF = 1106,
|
EY_GRAVEYARD_BLOOD_ELF = 1106,
|
||||||
EY_GRAVEYARD_DRAENEI_RUINS = 1107,
|
EY_GRAVEYARD_DRAENEI_RUINS = 1107,
|
||||||
EY_GRAVEYARD_MAGE_TOWER = 1108
|
EY_GRAVEYARD_MAGE_TOWER = 1108
|
||||||
};
|
};
|
||||||
|
|
||||||
// deprecated
|
|
||||||
enum EYBattleGroundPoints
|
|
||||||
{
|
|
||||||
FEL_REALVER = 0,
|
|
||||||
BLOOD_ELF = 1,
|
|
||||||
DRAENEI_RUINS = 2,
|
|
||||||
MAGE_TOWER = 3,
|
|
||||||
|
|
||||||
EY_PLAYERS_OUT_OF_POINTS = 4,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum BG_EY_Nodes
|
enum BG_EY_Nodes
|
||||||
{
|
{
|
||||||
BG_EY_NODE_FEL_REALVER = 0,
|
BG_EY_NODE_FEL_REAVER = 0,
|
||||||
BG_EY_NODE_BLOOD_ELF = 1,
|
BG_EY_NODE_BLOOD_ELF = 1,
|
||||||
BG_EY_NODE_DRAENEI_RUINS = 2,
|
BG_EY_NODE_DRAENEI_RUINS = 2,
|
||||||
BG_EY_NODE_MAGE_TOWER = 3,
|
BG_EY_NODE_MAGE_TOWER = 3,
|
||||||
BG_EY_NODES_ERROR = 255
|
|
||||||
|
// special internal node
|
||||||
|
BG_EY_PLAYERS_OUT_OF_POINTS = 4, // used for store out of node players data
|
||||||
};
|
};
|
||||||
#define BG_EY_NODES_MAX 4
|
|
||||||
|
#define BG_EY_NODES_MAX 4
|
||||||
|
#define BG_EY_NODES_MAX_WITH_SPEIAL 5
|
||||||
|
|
||||||
// node-events work like this: event1:nodeid, event2:state (0alliance,1horde,2neutral)
|
// node-events work like this: event1:nodeid, event2:state (0alliance,1horde,2neutral)
|
||||||
#define BG_EYE_NEUTRAL_TEAM 2
|
#define BG_EYE_NEUTRAL_TEAM 2
|
||||||
#define BG_EY_EVENT_CAPTURE_FLAG 4 // event1=4, event2=nodeid or 4 for the default center spawn
|
#define BG_EY_EVENT_CAPTURE_FLAG 4 // event1=4, event2=nodeid or 4 for the default center spawn
|
||||||
#define BG_EY_EVENT2_FLAG_CENTER 4 // maximum node is 3 so 4 for center is ok
|
#define BG_EY_EVENT2_FLAG_CENTER 4 // maximum node is 3 so 4 for center is ok
|
||||||
// all other event2 are just nodeids, i won't define something here
|
// all other event2 are just nodeids, i won't define something here
|
||||||
|
|
||||||
// x, y, z
|
// x, y, z
|
||||||
// used to check, when player is in range of a node
|
// used to check, when player is in range of a node
|
||||||
const float BG_EY_NodePositions[BG_EY_NODES_MAX][4] = {
|
const float BG_EY_NodePositions[BG_EY_NODES_MAX][3] = {
|
||||||
{2024.600708f, 1742.819580f, 1195.157715f}, // FEL_REALVER
|
{2024.600708f, 1742.819580f, 1195.157715f}, // BG_EY_NODE_FEL_REAVER
|
||||||
{2050.493164f, 1372.235962f, 1194.563477f}, // BLOOD_ELF
|
{2050.493164f, 1372.235962f, 1194.563477f}, // BG_EY_NODE_BLOOD_ELF
|
||||||
{2301.010498f, 1386.931641f, 1197.183472f}, // DRAENEI_RUINS
|
{2301.010498f, 1386.931641f, 1197.183472f}, // BG_EY_NODE_DRAENEI_RUINS
|
||||||
{2282.121582f, 1760.006958f, 1189.707153f} // MAGE_TOWER
|
{2282.121582f, 1760.006958f, 1189.707153f} // BG_EY_NODE_MAGE_TOWER
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EYBattleGroundObjectTypes
|
enum EYBattleGroundObjectTypes
|
||||||
{
|
{
|
||||||
//buffs
|
//buffs
|
||||||
BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER = 1,
|
BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER = 1,
|
||||||
BG_EY_OBJECT_REGENBUFF_FEL_REALVER = 2,
|
BG_EY_OBJECT_REGENBUFF_FEL_REAVER = 2,
|
||||||
BG_EY_OBJECT_BERSERKBUFF_FEL_REALVER = 3,
|
BG_EY_OBJECT_BERSERKBUFF_FEL_REAVER = 3,
|
||||||
BG_EY_OBJECT_SPEEDBUFF_BLOOD_ELF = 4,
|
BG_EY_OBJECT_SPEEDBUFF_BLOOD_ELF = 4,
|
||||||
BG_EY_OBJECT_REGENBUFF_BLOOD_ELF = 5,
|
BG_EY_OBJECT_REGENBUFF_BLOOD_ELF = 5,
|
||||||
BG_EY_OBJECT_BERSERKBUFF_BLOOD_ELF = 6,
|
BG_EY_OBJECT_BERSERKBUFF_BLOOD_ELF = 6,
|
||||||
|
|
@ -232,7 +225,7 @@ const BattleGroundEYLoosingPointStruct LoosingPointTypes[BG_EY_NODES_MAX] =
|
||||||
};
|
};
|
||||||
const BattleGroundEYCapturingPointStruct CapturingPointTypes[BG_EY_NODES_MAX] =
|
const BattleGroundEYCapturingPointStruct CapturingPointTypes[BG_EY_NODES_MAX] =
|
||||||
{
|
{
|
||||||
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_F_RUINS, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REALVER),
|
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_F_RUINS, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REAVER),
|
||||||
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_B_TOWER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF),
|
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_B_TOWER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF),
|
||||||
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_D_RUINS, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
|
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_D_RUINS, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS),
|
||||||
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_M_TOWER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
|
BattleGroundEYCapturingPointStruct(LANG_BG_EY_HAS_TAKEN_A_M_TOWER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER)
|
||||||
|
|
@ -323,7 +316,7 @@ class BattleGroundEY : public BattleGround
|
||||||
uint8 m_PointState[BG_EY_NODES_MAX];
|
uint8 m_PointState[BG_EY_NODES_MAX];
|
||||||
int32 m_PointBarStatus[BG_EY_NODES_MAX];
|
int32 m_PointBarStatus[BG_EY_NODES_MAX];
|
||||||
typedef std::vector<uint64> PlayersNearPointType;
|
typedef std::vector<uint64> PlayersNearPointType;
|
||||||
PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX + 1];
|
PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
|
||||||
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
|
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
|
||||||
|
|
||||||
int32 m_PointAddingTimer;
|
int32 m_PointAddingTimer;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9891"
|
#define REVISION_NR "9892"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue