BG BotFill : correctif racine de l IA d objectifs - GUID 128 bits tronques en bool
Le registre des commandants (PlayerStatus/PlayerGUIDs) etait indexe uint64 ; ObjectGuid (128 bits) s y convertissait via operator bool() -> tous les joueurs partageaient la cle 1. Premier bot enrole, tous les autres rejetes comme doublons, et les recherches inverses (GetBotBGAI) ne trouvaient personne : les commandants ne pilotaient aucun bot. Conteneurs et signatures retypes en ObjectGuid dans CommandBG et les 5 commandants (WS/AB/EY/AV/IC). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,8 +53,9 @@ void CommandBG::Initialize()
|
||||
|
||||
void CommandBG::ReadyGame()
|
||||
{
|
||||
TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::ReadyGame team=%u etat=%u", uint32(m_TeamID), uint32(m_BGGC));
|
||||
m_BGGC = BGGameCommand::BGGS_Ready;
|
||||
//for (uint64 guid : m_PlayerGUIDs)
|
||||
//for (ObjectGuid guid : m_PlayerGUIDs)
|
||||
//{
|
||||
// if (UnitAI* pAI = GetPlayerAI(guid))
|
||||
// {
|
||||
@@ -66,8 +67,9 @@ void CommandBG::ReadyGame()
|
||||
|
||||
void CommandBG::StartGame()
|
||||
{
|
||||
TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::StartGame team=%u etat=%u", uint32(m_TeamID), uint32(m_BGGC));
|
||||
m_BGGC = BGGameCommand::BGGS_Start;
|
||||
//for (uint64 guid : m_PlayerGUIDs)
|
||||
//for (ObjectGuid guid : m_PlayerGUIDs)
|
||||
//{
|
||||
// if (UnitAI* pAI = GetPlayerAI(guid))
|
||||
// {
|
||||
@@ -77,7 +79,7 @@ void CommandBG::StartGame()
|
||||
//}
|
||||
}
|
||||
|
||||
void CommandBG::OnPlayerDead(uint64 guid)
|
||||
void CommandBG::OnPlayerDead(ObjectGuid guid)
|
||||
{
|
||||
PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid);
|
||||
if (itGUID == m_PlayerGUIDs.end())
|
||||
@@ -87,6 +89,7 @@ void CommandBG::OnPlayerDead(uint64 guid)
|
||||
|
||||
bool CommandBG::AddPlayerBot(Player* player, Battleground* pBG)
|
||||
{
|
||||
TC_LOG_ERROR("server.worldserver", "BGF-DBG: CommandBG::AddPlayerBot %s team=%u etat=%u", player ? player->GetName().c_str() : "null", uint32(m_TeamID), uint32(m_BGGC));
|
||||
if (!player || !pBG)
|
||||
return false;
|
||||
if (m_PlayerGUIDs.find(player->GetGUID()) != m_PlayerGUIDs.end())
|
||||
@@ -142,6 +145,12 @@ void CommandBG::RemovePlayerBot(Player* player)
|
||||
|
||||
void CommandBG::Update(uint32 diff)
|
||||
{
|
||||
static uint32 s_dbgCount = 0;
|
||||
if (++s_dbgCount % 97 == 0)
|
||||
TC_LOG_ERROR("server.worldserver", "BGF-DBG: CmdUpdate this=%p inst=%u team=%u etat=%u model=%u statut=%u bots=%u",
|
||||
(void*)this, m_pBattleground ? m_pBattleground->GetInstanceID() : 0u,
|
||||
uint32(m_TeamID), uint32(m_BGGC), uint32(g_CommandModelType),
|
||||
m_pBattleground ? uint32(m_pBattleground->GetStatus()) : 999u, uint32(m_PlayerGUIDs.size()));
|
||||
if (m_BGGC != BGGS_None)
|
||||
{
|
||||
if (m_BGGC == BGGS_Init)
|
||||
@@ -185,18 +194,18 @@ void CommandBG::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
UnitAI* CommandBG::GetPlayerAI(uint64 guid)
|
||||
UnitAI* CommandBG::GetPlayerAI(ObjectGuid guid)
|
||||
{
|
||||
PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid);
|
||||
if (itGUID == m_PlayerGUIDs.end())
|
||||
return NULL;
|
||||
Player* player = ObjectAccessor::FindPlayer(ObjectGuid::Create<HighGuid::Player>(guid));
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
return NULL;
|
||||
return player->GetAI();
|
||||
}
|
||||
|
||||
BotBGAI* CommandBG::GetBotBGAI(uint64 guid)
|
||||
BotBGAI* CommandBG::GetBotBGAI(ObjectGuid guid)
|
||||
{
|
||||
UnitAI* pAI = GetPlayerAI(guid);
|
||||
if (!pAI)
|
||||
@@ -204,12 +213,12 @@ BotBGAI* CommandBG::GetBotBGAI(uint64 guid)
|
||||
return (dynamic_cast<BotBGAI*>(pAI));
|
||||
}
|
||||
|
||||
Player* CommandBG::GetBGPlayer(uint64 guid)
|
||||
Player* CommandBG::GetBGPlayer(ObjectGuid guid)
|
||||
{
|
||||
PlayerStatus::iterator itGUID = m_PlayerGUIDs.find(guid);
|
||||
if (itGUID == m_PlayerGUIDs.end())
|
||||
return NULL;
|
||||
return ObjectAccessor::FindPlayer(ObjectGuid::Create<HighGuid::Player>(guid));
|
||||
return ObjectAccessor::FindPlayer(guid);
|
||||
}
|
||||
|
||||
Position CommandBG::GetNearTeleportPoint(Position& currentPos)
|
||||
@@ -290,7 +299,7 @@ void CommandBG::ProcessGroupFocus(AIWaypoint* selfFocus, AIWaypoint* enemyFocus)
|
||||
}
|
||||
}
|
||||
|
||||
Position CommandBG::GetPositionByGuid(uint64 guid)
|
||||
Position CommandBG::GetPositionByGuid(ObjectGuid guid)
|
||||
{
|
||||
ObjectGuid oGuid = ObjectGuid::Create<HighGuid::Player>(guid);
|
||||
if (oGuid.IsPlayer())
|
||||
|
||||
@@ -32,8 +32,8 @@ class BotBGAI;
|
||||
|
||||
typedef std::vector<uint32> AIWPEntrys;
|
||||
typedef std::vector<AIWaypoint*> BGKeyPoints;
|
||||
typedef std::set<uint64> PlayerGUIDs;
|
||||
typedef std::map<uint64, bool> PlayerStatus;
|
||||
typedef std::set<ObjectGuid> PlayerGUIDs;
|
||||
typedef std::map<ObjectGuid, bool> PlayerStatus;
|
||||
|
||||
enum CommandModel
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
virtual void Initialize();
|
||||
virtual void ReadyGame();
|
||||
virtual void StartGame();
|
||||
virtual void OnPlayerDead(uint64 guid);
|
||||
virtual void OnPlayerDead(ObjectGuid guid);
|
||||
virtual bool AddPlayerBot(Player* player, Battleground* pBG);
|
||||
void RemovePlayerBot(Player* player);
|
||||
virtual AIWaypoint* GetReadyPosition() { return NULL; }
|
||||
@@ -111,9 +111,9 @@ public:
|
||||
virtual bool CanUpMount(Player* player) { return true; }
|
||||
virtual bool CanDireFlee() { return true; }
|
||||
|
||||
UnitAI* GetPlayerAI(uint64 guid);
|
||||
BotBGAI* GetBotBGAI(uint64 guid);
|
||||
Player* GetBGPlayer(uint64 guid);
|
||||
UnitAI* GetPlayerAI(ObjectGuid guid);
|
||||
BotBGAI* GetBotBGAI(ObjectGuid guid);
|
||||
Player* GetBGPlayer(ObjectGuid guid);
|
||||
Position GetNearTeleportPoint(Position& currentPos);
|
||||
void UpdateBelongBattleground(Battleground* pBG) { m_pBattleground = pBG; }
|
||||
void ClearPlayerGUIDs() { m_PlayerGUIDs.clear(); }
|
||||
@@ -122,7 +122,7 @@ protected:
|
||||
bool GroupAllPlayerReadyToWayPoint(AIWaypoint* pKeyPoint);
|
||||
void ProcessGroupFocus(AIWaypoint* selfFocus, AIWaypoint* enemyFocus);
|
||||
|
||||
Position GetPositionByGuid(uint64 guid);
|
||||
Position GetPositionByGuid(ObjectGuid guid);
|
||||
|
||||
protected:
|
||||
BGGameCommand m_BGGC;
|
||||
|
||||
@@ -191,7 +191,7 @@ void CommandAB::ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, Pl
|
||||
int32 needCount = int32(enemyCount) + (flagIsOvvupied ? 2 : 4);
|
||||
for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++)
|
||||
{
|
||||
uint64 guid = *itGuid;
|
||||
ObjectGuid guid = *itGuid;
|
||||
if (canStealFlag)
|
||||
{
|
||||
if (!AcceptCommandByPlayerGUID(guid, pBGNode->GetGUID()))
|
||||
@@ -208,7 +208,7 @@ void CommandAB::ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, Pl
|
||||
while (needCount > 0 && !players.empty())
|
||||
{
|
||||
float minDistance = 99999;
|
||||
uint64 minGUID = 0;
|
||||
ObjectGuid minGUID;
|
||||
for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++)
|
||||
{
|
||||
Position pos = GetPositionByGuid(*itGuid);
|
||||
@@ -278,7 +278,7 @@ PlayerGUIDs CommandAB::GetABFlagRangePlayerByTeam(uint32 abNode, TeamId team)
|
||||
return existPlayers;
|
||||
}
|
||||
|
||||
bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
bool CommandAB::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
{
|
||||
if (!targetAIWP)
|
||||
return false;
|
||||
@@ -289,7 +289,7 @@ bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
bool CommandAB::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
{
|
||||
if (flagGuid.IsEmpty())
|
||||
return false;
|
||||
@@ -300,7 +300,7 @@ bool CommandAB::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool
|
||||
return true;
|
||||
}
|
||||
|
||||
void CommandAB::TryOccupiedABNode(uint64 guid)
|
||||
void CommandAB::TryOccupiedABNode(ObjectGuid guid)
|
||||
{
|
||||
Player* player = GetBGPlayer(guid);
|
||||
if (!player || player->HasUnitState(UNIT_STATE_CASTING) || player->IsInCombat())
|
||||
|
||||
@@ -55,9 +55,9 @@ private:
|
||||
void ProcessABNodeRequirement(uint32 abNode, AIWaypoint* waypoint, PlayerGUIDs& players);
|
||||
bool ABFlagIsOccupied(uint32 abNode, TeamId team);
|
||||
PlayerGUIDs GetABFlagRangePlayerByTeam(uint32 abNode, TeamId team);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedABNode(uint64 guid);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedABNode(ObjectGuid guid);
|
||||
uint32 GetABNodeIndexByTeam(uint32 index, TeamId team);
|
||||
|
||||
private:
|
||||
|
||||
@@ -365,7 +365,7 @@ void CommandAV::ProcessRequirementByNodeType(BattlegroundAV* pBattlegroundAV, BG
|
||||
uint32 canSteal = (enemyCount == 0) ? 3 : 0;
|
||||
for (PlayerGUIDs::iterator itGuid = selfPlayers.begin(); itGuid != selfPlayers.end(); itGuid++)
|
||||
{
|
||||
uint64 guid = *itGuid;
|
||||
ObjectGuid guid = *itGuid;
|
||||
if (canSteal > 0)
|
||||
{
|
||||
if (!AcceptCommandByPlayerGUID(guid, waypoint, true))
|
||||
@@ -386,7 +386,7 @@ void CommandAV::ProcessRequirementByNodeType(BattlegroundAV* pBattlegroundAV, BG
|
||||
while (needCount > 0 && !allPlayers.empty() && pBGNode)
|
||||
{
|
||||
float minDistance = 99999;
|
||||
uint64 minGUID = 0;
|
||||
ObjectGuid minGUID;
|
||||
for (PlayerGUIDs::iterator itGuid = allPlayers.begin(); itGuid != allPlayers.end(); itGuid++)
|
||||
{
|
||||
Position pos = GetPositionByGuid(*itGuid);
|
||||
@@ -421,7 +421,7 @@ void CommandAV::ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, Tea
|
||||
uint32 needCount = enemyCount + 10;
|
||||
for (PlayerGUIDs::iterator itGuid = selfPlayers.begin(); itGuid != selfPlayers.end(); itGuid++)
|
||||
{
|
||||
uint64 guid = *itGuid;
|
||||
ObjectGuid guid = *itGuid;
|
||||
if (!AcceptCommandByPlayerGUID(guid, waypoint))
|
||||
continue;
|
||||
allPlayers.erase(guid);
|
||||
@@ -432,7 +432,7 @@ void CommandAV::ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, Tea
|
||||
while (needCount > 0 && !allPlayers.empty())
|
||||
{
|
||||
float minDistance = 99999;
|
||||
uint64 minGUID = 0;
|
||||
ObjectGuid minGUID;
|
||||
for (PlayerGUIDs::iterator itGuid = allPlayers.begin(); itGuid != allPlayers.end(); itGuid++)
|
||||
{
|
||||
Position pos = GetPositionByGuid(*itGuid);
|
||||
@@ -485,7 +485,7 @@ PlayerGUIDs CommandAV::GetAVCaptainRangePlayerByTeam(BattlegroundAV* pBattlegrou
|
||||
return existPlayers;
|
||||
}
|
||||
|
||||
bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
bool CommandAV::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
{
|
||||
if (!targetAIWP)
|
||||
return false;
|
||||
@@ -496,7 +496,7 @@ bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
bool CommandAV::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
{
|
||||
if (flagGuid.IsEmpty())
|
||||
return false;
|
||||
@@ -507,7 +507,7 @@ bool CommandAV::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool
|
||||
return true;
|
||||
}
|
||||
|
||||
void CommandAV::TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, uint64 guid)
|
||||
void CommandAV::TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, ObjectGuid guid)
|
||||
{
|
||||
Player* player = GetBGPlayer(guid);
|
||||
if (!player || player->HasUnitState(UNIT_STATE_CASTING) || player->IsInCombat())
|
||||
|
||||
@@ -70,9 +70,9 @@ private:
|
||||
void ProcessRequirementByCaptain(BattlegroundAV* pBattlegroundAV, TeamId team, AIWaypoint* waypoint, PlayerGUIDs& allPlayers, bool attOrDef);
|
||||
PlayerGUIDs GetAVFlagRangePlayerByTeam(BattlegroundAV* pBattlegroundAV, BG_AV_Nodes nodeType, TeamId team);
|
||||
PlayerGUIDs GetAVCaptainRangePlayerByTeam(BattlegroundAV* pBattlegroundAV, Creature const* pCaptain, TeamId team);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, uint64 guid);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedAVNode(BattlegroundAV* pBattlegroundAV, ObjectGuid guid);
|
||||
|
||||
private:
|
||||
int32 lastUpdateTick;
|
||||
|
||||
@@ -261,7 +261,7 @@ void CommandEY::ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, Pl
|
||||
int32 needCount = int32(enemyCount) + (flagIsOvvupied ? 1 : 3);
|
||||
for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++)
|
||||
{
|
||||
uint64 guid = *itGuid;
|
||||
ObjectGuid guid = *itGuid;
|
||||
if (!AcceptCommandByPlayerGUID(guid, waypoint))
|
||||
continue;
|
||||
players.erase(guid);
|
||||
@@ -272,7 +272,7 @@ void CommandEY::ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, Pl
|
||||
while (needCount > 0 && !players.empty())
|
||||
{
|
||||
float minDistance = 99999;
|
||||
uint64 minGUID = 0;
|
||||
ObjectGuid minGUID;
|
||||
for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++)
|
||||
{
|
||||
Position pos = GetPositionByGuid(*itGuid);
|
||||
@@ -323,7 +323,7 @@ PlayerGUIDs CommandEY::GetEYPointRangePlayerByTeam(uint32 point, TeamId team)
|
||||
return existPlayers;
|
||||
}
|
||||
|
||||
bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
bool CommandEY::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
{
|
||||
if (!targetAIWP)
|
||||
return false;
|
||||
@@ -334,7 +334,7 @@ bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandEY::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
bool CommandEY::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
{
|
||||
if (flagGuid.IsEmpty())
|
||||
return false;
|
||||
@@ -361,7 +361,7 @@ uint32 CommandEY::GetEYPointIndexByTeam(uint32 index, TeamId team)
|
||||
return (team == TEAM_ALLIANCE) ? EYBattlegroundPoints::MAGE_TOWER : EYBattlegroundPoints::BLOOD_ELF;
|
||||
}
|
||||
|
||||
void CommandEY::TryPickStormFlag(uint64 guid)
|
||||
void CommandEY::TryPickStormFlag(ObjectGuid guid)
|
||||
{
|
||||
if (!m_pBattleground)
|
||||
return;
|
||||
|
||||
@@ -52,10 +52,10 @@ private:
|
||||
void ProcessEYPointRequirement(uint32 point, AIWaypoint* waypoint, PlayerGUIDs& players);
|
||||
bool EYPointIsOccupied(uint32 point, TeamId team);
|
||||
PlayerGUIDs GetEYPointRangePlayerByTeam(uint32 point, TeamId team);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
uint32 GetEYPointIndexByTeam(uint32 index, TeamId team);
|
||||
void TryPickStormFlag(uint64 guid);
|
||||
void TryPickStormFlag(ObjectGuid guid);
|
||||
void TryCaptureFlag(Player* player, AIWaypoint* pAIWP, uint32 point);
|
||||
void ProcessFlagPicker(Player* player);
|
||||
uint32 GetCaptureFlagPoint(uint32 index, TeamId team);
|
||||
|
||||
@@ -194,7 +194,7 @@ void CommandIC::ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint,
|
||||
int32 canStealFlag = (nearEnemyCount == 0 && !flagIsOcupied) ? 1 : 0;
|
||||
for (PlayerGUIDs::iterator itGuid = nodeNearPlayers.begin(); itGuid != nodeNearPlayers.end(); itGuid++)
|
||||
{
|
||||
uint64 guid = *itGuid;
|
||||
ObjectGuid guid = *itGuid;
|
||||
if (canStealFlag > 0)
|
||||
{
|
||||
if (!AcceptCommandByPlayerGUID(guid, pBGNode->GetGUID()))
|
||||
@@ -211,7 +211,7 @@ void CommandIC::ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint,
|
||||
while (needCount > 0 && !players.empty())
|
||||
{
|
||||
float minDistance = 99999;
|
||||
uint64 minGUID = 0;
|
||||
ObjectGuid minGUID;
|
||||
for (PlayerGUIDs::iterator itGuid = players.begin(); itGuid != players.end(); itGuid++)
|
||||
{
|
||||
Position pos = GetPositionByGuid(*itGuid);
|
||||
@@ -258,7 +258,7 @@ PlayerGUIDs CommandIC::GetICFlagRangePlayerByTeam(uint32 nodeType, TeamId team,
|
||||
return existPlayers;
|
||||
}
|
||||
|
||||
bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
bool CommandIC::AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag /* = false */)
|
||||
{
|
||||
if (!targetAIWP)
|
||||
return false;
|
||||
@@ -269,7 +269,7 @@ bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, b
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
bool CommandIC::AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag /* = false */)
|
||||
{
|
||||
if (flagGuid.IsEmpty())
|
||||
return false;
|
||||
@@ -280,7 +280,7 @@ bool CommandIC::AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool
|
||||
return true;
|
||||
}
|
||||
|
||||
void CommandIC::TryOccupiedICNode(uint64 guid)
|
||||
void CommandIC::TryOccupiedICNode(ObjectGuid guid)
|
||||
{
|
||||
Player* player = GetBGPlayer(guid);
|
||||
if (!player || player->HasUnitState(UNIT_STATE_CASTING))// || player->IsInCombat())
|
||||
|
||||
@@ -54,9 +54,9 @@ private:
|
||||
private:
|
||||
void ProcessICNodeRequirement(uint32 nodeType, AIWaypoint* waypoint, uint32 baseCount, PlayerGUIDs& players);
|
||||
PlayerGUIDs GetICFlagRangePlayerByTeam(uint32 nodeType, TeamId team, float range = 40);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(uint64 guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedICNode(uint64 guid);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, AIWaypoint* targetAIWP, bool isFlag = false);
|
||||
bool AcceptCommandByPlayerGUID(ObjectGuid guid, ObjectGuid flagGuid, bool isFlag = false);
|
||||
void TryOccupiedICNode(ObjectGuid guid);
|
||||
uint32 GetICNodeObjectType(uint32 index, TeamId team);
|
||||
|
||||
private:
|
||||
|
||||
@@ -185,7 +185,7 @@ void CommandWS::ProcessRegulation()
|
||||
}
|
||||
}
|
||||
|
||||
void CommandWS::TryPickEnemyFlag(uint64 guid)
|
||||
void CommandWS::TryPickEnemyFlag(ObjectGuid guid)
|
||||
{
|
||||
if (!m_pBattleground)
|
||||
return;
|
||||
@@ -225,7 +225,7 @@ void CommandWS::TryPickEnemyFlag(uint64 guid)
|
||||
pObject->Use(player);
|
||||
}
|
||||
|
||||
void CommandWS::TryPickSelfFlag(uint64 guid)
|
||||
void CommandWS::TryPickSelfFlag(ObjectGuid guid)
|
||||
{
|
||||
if (!m_pBattleground)
|
||||
return;
|
||||
@@ -254,7 +254,7 @@ void CommandWS::TryPickSelfFlag(uint64 guid)
|
||||
pObject->Use(player);
|
||||
}
|
||||
|
||||
void CommandWS::TryCaptureFlag(uint64 guid)
|
||||
void CommandWS::TryCaptureFlag(ObjectGuid guid)
|
||||
{
|
||||
if (!m_pBattleground)
|
||||
return;
|
||||
@@ -593,7 +593,7 @@ ObjectGuid CommandWS::GetBGFlagFromEnemy()
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
GameObject* CommandWS::SearchDropedFlag(uint64 guid, TeamId team)
|
||||
GameObject* CommandWS::SearchDropedFlag(ObjectGuid guid, TeamId team)
|
||||
{
|
||||
BotBGAI* pBotAI = GetBotBGAI(guid);
|
||||
if (!pBotAI)
|
||||
|
||||
@@ -54,15 +54,15 @@ private:
|
||||
void ProcessAllAttack(ObjectGuid& attackGuid);
|
||||
void ProcessAttackAndGuard(ObjectGuid attackGuid, ObjectGuid guaredGuid);
|
||||
|
||||
void TryPickEnemyFlag(uint64 guid);
|
||||
void TryPickSelfFlag(uint64 guid);
|
||||
void TryCaptureFlag(uint64 guid);
|
||||
void TryPickEnemyFlag(ObjectGuid guid);
|
||||
void TryPickSelfFlag(ObjectGuid guid);
|
||||
void TryCaptureFlag(ObjectGuid guid);
|
||||
ObjectGuid SelfBGFlagPicker();
|
||||
ObjectGuid EnemyBGFlagPicker();
|
||||
ObjectGuid GetBGFlagFromSelf();
|
||||
ObjectGuid GetBGFlagFromEnemy();
|
||||
|
||||
GameObject* SearchDropedFlag(uint64 guid, TeamId team);
|
||||
GameObject* SearchDropedFlag(ObjectGuid guid, TeamId team);
|
||||
|
||||
private:
|
||||
int32 lastUpdateTick;
|
||||
|
||||
Reference in New Issue
Block a user