Fix: Updated to work with newer commits of AzerothCore

This commit is contained in:
Revision
2024-07-22 00:39:06 +02:00
parent fedb6084e2
commit 838bfe333d
48 changed files with 241 additions and 239 deletions

View File

@@ -32,7 +32,7 @@ bool BGJoinAction::Execute(Event event)
return false;
uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel());
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff)
return false;
@@ -169,7 +169,7 @@ bool BGJoinAction::gatherArenaTeam(ArenaType type)
if (!member)
continue;
if (member->getLevel() < 70)
if (member->GetLevel() < 70)
continue;
if (!group->AddMember(member))
@@ -218,7 +218,7 @@ bool BGJoinAction::canJoinBg(BattlegroundQueueTypeId queueTypeId, BattlegroundBr
// check bracket
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel());
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff)
return false;
@@ -371,7 +371,7 @@ bool BGJoinAction::isUseful()
return false;
// check level
if (bot->getLevel() < 10)
if (bot->GetLevel() < 10)
return false;
// do not try if with player master or in combat/group
@@ -438,7 +438,7 @@ bool BGJoinAction::JoinQueue(uint32 type)
return false;
uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel());
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (!pvpDiff)
return false;
@@ -548,7 +548,7 @@ bool BGJoinAction::JoinQueue(uint32 type)
}
LOG_INFO("playerbots", "Bot {} {}:{} <{}> queued {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _bgType.c_str(),
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _bgType.c_str(),
isRated ? "Rated Arena" : isArena ? "Arena" : "");
@@ -722,7 +722,7 @@ bool BGLeaveAction::Execute(Event event)
if (bot->InBattleground())
{
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG");
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG");
WorldPacket leave(CMSG_LEAVE_BATTLEFIELD);
leave << uint8(0) << uint8(0) << uint32(0) << uint16(0);
@@ -744,7 +744,7 @@ bool BGLeaveAction::Execute(Event event)
return false;
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} queue",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), isArena ? "Arena" : "BG");
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), isArena ? "Arena" : "BG");
WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20);
packet << type << unk2 << (uint32)_bgTypeId << unk << uint8(0);
@@ -828,7 +828,7 @@ bool BGStatusAction::Execute(Event event)
BattlegroundBracketId bracketId;
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(_bgTypeId);
mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->getLevel());
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
if (pvpDiff)
bracketId = pvpDiff->GetBracketId();
@@ -892,7 +892,7 @@ bool BGStatusAction::Execute(Event event)
if (Time1 == TIME_TO_AUTOREMOVE) //Battleground is over, bot needs to leave
{
LOG_INFO("playerbots", "Bot {} <{}> ({} {}): Received BG status TIME_REMOVE for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->getLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->GetLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", isArena ? "Arena" : "BG", _bgType);
if (Battleground* bg = bot->GetBattleground())
{
@@ -924,7 +924,7 @@ bool BGStatusAction::Execute(Event event)
botAI->ChangeStrategy("-arena", BOT_STATE_NON_COMBAT);
LOG_INFO("playerbots", "Bot {} {}:{} <{}> leaves {} - {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket packet(CMSG_LEAVE_BATTLEFIELD);
packet << uint8(0);
@@ -947,7 +947,7 @@ bool BGStatusAction::Execute(Event event)
if (statusid == STATUS_WAIT_QUEUE) // bot is in queue
{
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_QUEUE (wait time: {}) for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), Time2, isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), Time2, isArena ? "Arena" : "BG", _bgType);
// temp fix for crash
//return true;
@@ -967,7 +967,7 @@ bool BGStatusAction::Execute(Event event)
}
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Force join {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket emptyPacket;
bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket);
action = 0x1;
@@ -1017,7 +1017,7 @@ bool BGStatusAction::Execute(Event event)
return false;
LOG_INFO("playerbots", "Bot {} {}:{} <{}> waited too long and leaves queue ({} {}).",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket packet(CMSG_BATTLEFIELD_PORT, 20);
action = 0;
@@ -1037,14 +1037,14 @@ bool BGStatusAction::Execute(Event event)
if (statusid == STATUS_IN_PROGRESS) // placeholder for Leave BG if it takes too long
{
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status IN_PROGRESS for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false;
}
if (statusid == STATUS_WAIT_JOIN) //bot may join
{
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Received BG status WAIT_JOIN for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
if (isArena)
{
@@ -1055,7 +1055,7 @@ bool BGStatusAction::Execute(Event event)
if (!bgQueue.GetPlayerGroupInfoData(bot->GetGUID(), &ginfo))
{
LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false;
}
@@ -1066,7 +1066,7 @@ bool BGStatusAction::Execute(Event event)
if (!bg)
{
LOG_ERROR("playerbots", "Bot {} {}:{} <{}>: Missing QueueInfo for {} {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
return false;
}
@@ -1075,7 +1075,7 @@ bool BGStatusAction::Execute(Event event)
}
LOG_INFO("playerbots", "Bot {} {}:{} <{}> joined {} - {}",
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), isArena ? "Arena" : "BG", _bgType);
WorldPacket emptyPacket;
bot->GetSession()->HandleCancelMountAuraOpcode(emptyPacket);
@@ -1118,7 +1118,7 @@ bool BGStatusCheckAction::Execute(Event event)
bot->GetSession()->HandleBattlefieldStatusOpcode(packet);
LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Checking BG invite status",
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->getLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H");
bot->GetGUID().ToString().c_str(), bot->GetName(), bot->GetLevel(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H");
return true;
}