mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-17 10:45:43 +00:00
Fix: Updated to work with newer commits of AzerothCore
This commit is contained in:
@@ -121,7 +121,7 @@ void AutoLearnSpellAction::LearnQuestSpells(std::ostringstream* out)
|
||||
if (!quest->GetRequiredClasses() || quest->IsRepeatable() || quest->GetMinLevel() < 10)
|
||||
continue;
|
||||
|
||||
if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->getLevel() || !bot->SatisfyQuestRace(quest, false))
|
||||
if (!bot->SatisfyQuestClass(quest, false) || quest->GetMinLevel() > bot->GetLevel() || !bot->SatisfyQuestRace(quest, false))
|
||||
continue;
|
||||
|
||||
if (quest->GetRewSpellCast() > 0)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -3545,7 +3545,7 @@ bool BGTactics::selectObjective(bool reset)
|
||||
{
|
||||
// Capture front objectives before attacking back objectives
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get Front Objectives",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
|
||||
if (role < 6)
|
||||
{
|
||||
BgObjective = bg->GetBGObject(attackObjectivesFront[0]);
|
||||
@@ -3559,7 +3559,7 @@ bool BGTactics::selectObjective(bool reset)
|
||||
{
|
||||
// Now capture all objectives with priority on back
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Get All Objectives",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
|
||||
if (role < 4)
|
||||
{
|
||||
BgObjective = bg->GetBGObject(attackObjectivesFront[0]);
|
||||
@@ -3632,7 +3632,7 @@ bool BGTactics::selectObjective(bool reset)
|
||||
{
|
||||
//Retreat with flag
|
||||
//LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Retreat with flag",
|
||||
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName());
|
||||
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
|
||||
if (rootTeam == TEAM_HORDE)
|
||||
{
|
||||
areaTrigger = 0;
|
||||
@@ -3648,7 +3648,7 @@ bool BGTactics::selectObjective(bool reset)
|
||||
{
|
||||
//Deliver flag
|
||||
//LOG_INFO("playerbots", "Bot {} {}:{} <{}>: Deliver flag",
|
||||
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName());
|
||||
//bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
|
||||
if (eyeOfTheStormBG->GetCapturePointInfo(EY_AttackObjectives[0])._ownerTeamId == rootTeamIndex)
|
||||
{
|
||||
areaTrigger = AT_FEL_REAVER_POINT;
|
||||
|
||||
@@ -155,7 +155,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
|
||||
// // for (auto& path : sPlayerbotAIConfig->classSpecs[bot->getClass()].talentPath)
|
||||
// // {
|
||||
// // TalentSpec newSpec = *GetBestPremadeSpec(path.id);
|
||||
// // newSpec.CropTalents(bot->getLevel());
|
||||
// // newSpec.CropTalents(bot->GetLevel());
|
||||
// // if (oldSpec->isEarlierVersionOf(newSpec))
|
||||
// // {
|
||||
// // ret.push_back(&path);
|
||||
@@ -225,7 +225,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
|
||||
// bool ChangeTalentsAction::AutoSelectTalents(std::ostringstream* out)
|
||||
// {
|
||||
// // Does the bot have talentpoints?
|
||||
// if (bot->getLevel() < 10)
|
||||
// if (bot->GetLevel() < 10)
|
||||
// {
|
||||
// *out << "No free talent points.";
|
||||
// return false;
|
||||
@@ -239,7 +239,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
|
||||
// if (specNo > 0)
|
||||
// {
|
||||
// TalentSpec newSpec = *GetBestPremadeSpec(specId);
|
||||
// newSpec.CropTalents(bot->getLevel());
|
||||
// newSpec.CropTalents(bot->GetLevel());
|
||||
// newSpec.ApplyTalents(bot, out);
|
||||
// if (newSpec.GetTalentPoints() > 0)
|
||||
// {
|
||||
@@ -249,7 +249,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
|
||||
// else if (!specLink.empty())
|
||||
// {
|
||||
// TalentSpec newSpec(bot, specLink);
|
||||
// newSpec.CropTalents(bot->getLevel());
|
||||
// newSpec.CropTalents(bot->GetLevel());
|
||||
// newSpec.ApplyTalents(bot, out);
|
||||
// if (newSpec.GetTalentPoints() > 0)
|
||||
// {
|
||||
@@ -288,7 +288,7 @@ std::string ChangeTalentsAction::SpecApply(std::string param)
|
||||
// specId = PickPremadePath(paths, sRandomPlayerbotMgr->IsRandomBot(bot))->id;
|
||||
// TalentSpec newSpec = *GetBestPremadeSpec(specId);
|
||||
// specLink = newSpec.GetTalentLink();
|
||||
// newSpec.CropTalents(bot->getLevel());
|
||||
// newSpec.CropTalents(bot->GetLevel());
|
||||
// newSpec.ApplyTalents(bot, out);
|
||||
|
||||
// if (paths.size() > 1)
|
||||
|
||||
@@ -132,7 +132,7 @@ bool CheckMountStateAction::isUseful()
|
||||
if (!GET_PLAYERBOT_AI(bot)->HasStrategy("mount", BOT_STATE_NON_COMBAT) && !bot->IsMounted())
|
||||
return false;
|
||||
|
||||
bool firstmount = bot->getLevel() >= 20;
|
||||
bool firstmount = bot->GetLevel() >= 20;
|
||||
if (!firstmount)
|
||||
return false;
|
||||
|
||||
@@ -197,7 +197,7 @@ bool CheckMountStateAction::Mount()
|
||||
}
|
||||
}
|
||||
|
||||
if (bot->GetPureSkillValue(SKILL_RIDING) <= 75 && bot->getLevel() < secondmount)
|
||||
if (bot->GetPureSkillValue(SKILL_RIDING) <= 75 && bot->GetLevel() < secondmount)
|
||||
masterSpeed = 59;
|
||||
|
||||
if (bot->InBattleground() && masterSpeed > 99)
|
||||
|
||||
@@ -789,7 +789,7 @@ bool ChooseTravelTargetAction::needForQuest(Unit* target)
|
||||
{
|
||||
QuestStatusData questStatus = quest.second;
|
||||
|
||||
if (questTemplate->GetQuestLevel() > bot->getLevel())
|
||||
if (questTemplate->GetQuestLevel() > bot->GetLevel())
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
|
||||
|
||||
@@ -111,9 +111,9 @@ void CleanQuestLogAction::DropQuestType(uint8& numQuest, uint8 wantNum, bool isG
|
||||
numQuest++;
|
||||
|
||||
int32 lowLevelDiff = sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF);
|
||||
if (lowLevelDiff < 0 || bot->getLevel() <= bot->GetQuestLevel(quest) + uint32(lowLevelDiff)) // Quest is not gray
|
||||
if (lowLevelDiff < 0 || bot->GetLevel() <= bot->GetQuestLevel(quest) + uint32(lowLevelDiff)) // Quest is not gray
|
||||
{
|
||||
if (bot->getLevel() + 5 > bot->GetQuestLevel(quest)) // Quest is not red
|
||||
if (bot->GetLevel() + 5 > bot->GetQuestLevel(quest)) // Quest is not red
|
||||
if (!isGreen)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ bool EmoteAction::Execute(Event event)
|
||||
(namlen > 1 && strstri(bot->GetName().c_str(), nam.c_str()))))
|
||||
{
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_TEXT_EMOTE {} from player {} <{}>",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(),
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(),
|
||||
bot->GetName(), text_emote, pSource->GetGUID().ToString().c_str(), pSource->GetName());
|
||||
|
||||
emote = text_emote;
|
||||
@@ -694,7 +694,7 @@ bool EmoteAction::Execute(Event event)
|
||||
(urand(0, 1) && bot->HasInArc(static_cast<float>(M_PI), pSource, 10.0f))))
|
||||
{
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> received SMSG_EMOTE {} from player {} <{}>",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(),
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(),
|
||||
emoteId, pSource->GetGUID().ToString().c_str(), pSource->GetName());
|
||||
|
||||
std::vector<uint32> types;
|
||||
|
||||
@@ -31,15 +31,15 @@ bool HireAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bot->getLevel() > master->getLevel())
|
||||
if (bot->GetLevel() > master->GetLevel())
|
||||
{
|
||||
botAI->TellMaster("You cannot hire higher level characters than you");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 discount = sRandomPlayerbotMgr->GetTradeDiscount(bot, master);
|
||||
uint32 m = 1 + (bot->getLevel() / 10);
|
||||
uint32 moneyReq = m * 5000 * bot->getLevel();
|
||||
uint32 m = 1 + (bot->GetLevel() / 10);
|
||||
uint32 moneyReq = m * 5000 * bot->GetLevel();
|
||||
if (discount < moneyReq)
|
||||
{
|
||||
std::ostringstream out;
|
||||
|
||||
@@ -60,7 +60,7 @@ bool InviteNearbyToGroupAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (abs(int32(player->getLevel() - bot->getLevel())) > 2)
|
||||
if (abs(int32(player->GetLevel() - bot->GetLevel())) > 2)
|
||||
continue;
|
||||
|
||||
if (sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)
|
||||
@@ -135,7 +135,7 @@ bool InviteGuildToGroupAction::Execute(Event event)
|
||||
if (botAI->HasActivePlayerMaster()) //Do not invite alts of active players.
|
||||
continue;
|
||||
|
||||
if (player->getLevel() > bot->getLevel() + 5) // Only invite higher levels that need money so they can grind money and help out.
|
||||
if (player->GetLevel() > bot->GetLevel() + 5) // Only invite higher levels that need money so they can grind money and help out.
|
||||
{
|
||||
AiObjectContext* botContext = botAI->GetAiObjectContext();
|
||||
|
||||
@@ -149,7 +149,7 @@ bool InviteGuildToGroupAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (abs(int32(player->getLevel() - bot->getLevel())) > 4)
|
||||
if (abs(int32(player->GetLevel() - bot->GetLevel())) > 4)
|
||||
continue;
|
||||
|
||||
if (!botAI && sServerFacade->GetDistance2d(bot, player) > sPlayerbotAIConfig->sightDistance)
|
||||
|
||||
@@ -144,14 +144,14 @@ bool LeaveFarAwayAction::isUseful()
|
||||
|
||||
if (bot->GetGuildId() == master->GetGuildId())
|
||||
{
|
||||
if (bot->getLevel() > master->getLevel() + 5)
|
||||
if (bot->GetLevel() > master->GetLevel() + 5)
|
||||
{
|
||||
if (AI_VALUE(bool, "should get money"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (abs(int32(master->getLevel() - bot->getLevel())) > 4)
|
||||
if (abs(int32(master->GetLevel() - bot->GetLevel())) > 4)
|
||||
return true;
|
||||
|
||||
if (bot->GetMapId() != master->GetMapId() || bot->GetDistance2d(master) >= 2 * sPlayerbotAIConfig->rpgDistance) {
|
||||
|
||||
@@ -87,8 +87,8 @@ bool LfgJoinAction::JoinLFG()
|
||||
ItemCountByQuality visitor;
|
||||
IterateItems(&visitor, ITERATE_ITEMS_IN_EQUIP);
|
||||
bool random = urand(0, 100) < 20;
|
||||
bool heroic = urand(0, 100) < 50 && (visitor.count[ITEM_QUALITY_EPIC] >= 3 || visitor.count[ITEM_QUALITY_RARE] >= 10) && bot->getLevel() >= 70;
|
||||
bool rbotAId = !heroic && (urand(0, 100) < 50 && visitor.count[ITEM_QUALITY_EPIC] >= 5 && (bot->getLevel() == 60 || bot->getLevel() == 70 || bot->getLevel() == 80));
|
||||
bool heroic = urand(0, 100) < 50 && (visitor.count[ITEM_QUALITY_EPIC] >= 3 || visitor.count[ITEM_QUALITY_RARE] >= 10) && bot->GetLevel() >= 70;
|
||||
bool rbotAId = !heroic && (urand(0, 100) < 50 && visitor.count[ITEM_QUALITY_EPIC] >= 5 && (bot->GetLevel() == 60 || bot->GetLevel() == 70 || bot->GetLevel() == 80));
|
||||
|
||||
LfgDungeonSet list;
|
||||
std::vector<uint32> selected;
|
||||
@@ -103,7 +103,7 @@ bool LfgJoinAction::JoinLFG()
|
||||
if (!dungeon || (dungeon->TypeID != LFG_TYPE_RANDOM && dungeon->TypeID != LFG_TYPE_DUNGEON && dungeon->TypeID != LFG_TYPE_HEROIC && dungeon->TypeID != LFG_TYPE_RAID))
|
||||
continue;
|
||||
|
||||
uint32 botLevel = bot->getLevel();
|
||||
uint32 botLevel = bot->GetLevel();
|
||||
if (dungeon->MinLevel && botLevel < dungeon->MinLevel)
|
||||
continue;
|
||||
|
||||
@@ -133,7 +133,7 @@ bool LfgJoinAction::JoinLFG()
|
||||
dungeon->type != LFG_TYPE_RAID))
|
||||
continue;
|
||||
|
||||
uint32 botLevel = bot->getLevel();
|
||||
uint32 botLevel = bot->GetLevel();
|
||||
if (dungeon->MinLevel && botLevel < dungeon->MinLevel)
|
||||
continue;
|
||||
|
||||
@@ -173,7 +173,7 @@ bool LfgJoinAction::JoinLFG()
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H",
|
||||
bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
|
||||
/*if (lfgState->IsSingleRole())
|
||||
{
|
||||
@@ -213,7 +213,7 @@ bool LfgJoinAction::JoinLFG()
|
||||
|
||||
pState->SetType(LFG_TYPE_RANDOM_DUNGEON);
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Random Dungeon as {} ({})",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, dungeon->Name[0]);
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, dungeon->Name[0]);
|
||||
return true;
|
||||
}
|
||||
else if (heroic)
|
||||
@@ -221,19 +221,19 @@ bool LfgJoinAction::JoinLFG()
|
||||
pState->SetType(LFG_TYPE_HEROIC_DUNGEON);
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Heroic Dungeon as {} ({})",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H",
|
||||
bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
}
|
||||
else if (rbotAId)
|
||||
{
|
||||
pState->SetType(LFG_TYPE_RAID);
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, RbotAId as {} ({})",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
pState->SetType(LFG_TYPE_DUNGEON);
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: queues LFG, Dungeon as {} ({})",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), _roles, many ? "several dungeons" : dungeon->Name[0]);
|
||||
}*/
|
||||
|
||||
// Set RbotAId Browser comment
|
||||
@@ -258,7 +258,7 @@ bool LfgRoleCheckAction::Execute(Event event)
|
||||
sLFGMgr->UpdateRoleCheck(group->GetGUID(), bot->GetGUID(), newRoles);
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}>: LFG roles checked",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -281,13 +281,13 @@ bool LfgAcceptAction::Execute(Event event)
|
||||
if (bot->IsInCombat() || bot->isDead())
|
||||
{
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> is in combat and refuses LFG proposal {}",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), id);
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), id);
|
||||
sLFGMgr->UpdateProposal(id, bot->GetGUID(), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> accepts LFG proposal {}",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str(), id);
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str(), id);
|
||||
|
||||
botAI->GetAiObjectContext()->GetValue<uint32>("lfg proposal")->Set(0);
|
||||
|
||||
@@ -363,7 +363,7 @@ bool LfgJoinAction::isUseful()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bot->getLevel() < 15)
|
||||
if (bot->GetLevel() < 15)
|
||||
return false;
|
||||
|
||||
if ((botAI->GetMaster() && !GET_PLAYERBOT_AI(botAI->GetMaster())) || bot->GetGroup() && bot->GetGroup()->GetLeaderGUID() != bot->GetGUID())
|
||||
|
||||
@@ -402,7 +402,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
||||
|
||||
// out << std::to_string(bot->getRace()) << ",";
|
||||
// out << std::to_string(bot->getClass()) << ",";
|
||||
// out << bot->getLevel() << ",";
|
||||
// out << bot->GetLevel() << ",";
|
||||
// out << (entry ? -1 : entry);
|
||||
|
||||
// sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str());
|
||||
@@ -559,7 +559,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle,
|
||||
// startPosition.printWKT({ startPosition, movePosition }, out, 1);
|
||||
// out << std::to_string(bot->getRace()) << ",";
|
||||
// out << std::to_string(bot->getClass()) << ",";
|
||||
// out << bot->getLevel();
|
||||
// out << bot->GetLevel();
|
||||
// out << 0;
|
||||
|
||||
// sPlayerbotAIConfig->log("bot_movement.csv", out.str().c_str());
|
||||
|
||||
@@ -39,7 +39,7 @@ bool ReleaseSpiritAction::Execute(Event event)
|
||||
context->GetValue<uint32>("death count")->Set(dCount + 1);
|
||||
}
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
WorldPacket packet(CMSG_REPOP_REQUEST);
|
||||
packet << uint8(0);
|
||||
@@ -86,13 +86,13 @@ bool AutoReleaseSpiritAction::Execute(Event event)
|
||||
context->GetValue<uint32>("death count")->Set(dCount + 1);
|
||||
}
|
||||
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> auto released", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
WorldPacket packet(CMSG_REPOP_REQUEST);
|
||||
packet << uint8(0);
|
||||
bot->GetSession()->HandleRepopRequestOpcode(packet);
|
||||
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> releases spirit", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
if (bot->InBattleground() && (time(NULL) - bg_gossip_time >= 15 || !bot->HasAura(SPELL_WAITING_FOR_RESURRECT)))
|
||||
{
|
||||
@@ -164,7 +164,7 @@ bool AutoReleaseSpiritAction::isUseful()
|
||||
|
||||
bool RepopAction::Execute(Event event)
|
||||
{
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> repops at graveyard", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
int64 deadTime;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ bool ReviveFromCorpseAction::Execute(Event event)
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at body", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at body", bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
bot->GetMotionMaster()->Clear();
|
||||
bot->StopMoving();
|
||||
@@ -91,7 +91,7 @@ bool FindCorpseAction::Execute(Event event)
|
||||
if (dCount >= 5)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}>: died too many times, was revived and teleported",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
context->GetValue<uint32>("death count")->Set(0);
|
||||
// sRandomPlayerbotMgr->RandomTeleportForLevel(bot);
|
||||
sRandomPlayerbotMgr->Revive(bot);
|
||||
@@ -301,7 +301,7 @@ bool SpiritHealerAction::Execute(Event event)
|
||||
if (unit && unit->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER))
|
||||
{
|
||||
LOG_DEBUG("playerbots", "Bot {} {}:{} <{}> revives at spirit healer",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName());
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName());
|
||||
PlayerbotChatHandler ch(bot);
|
||||
bot->ResurrectPlayer(0.5f);
|
||||
bot->SpawnCorpseBones();
|
||||
@@ -340,7 +340,7 @@ bool SpiritHealerAction::Execute(Event event)
|
||||
}
|
||||
|
||||
LOG_INFO("playerbots", "Bot {} {}:{} <{}> can't find a spirit healer",
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName().c_str());
|
||||
bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName().c_str());
|
||||
|
||||
botAI->TellError("Cannot find any spirit healer nearby");
|
||||
return false;
|
||||
|
||||
@@ -88,7 +88,7 @@ void SuggestWhatToDoAction::instance()
|
||||
std::vector<std::string> allowedInstances;
|
||||
for (auto & instance : instances)
|
||||
{
|
||||
if (bot->getLevel() >= instance.second) allowedInstances.push_back(instance.first);
|
||||
if (bot->GetLevel() >= instance.second) allowedInstances.push_back(instance.first);
|
||||
}
|
||||
|
||||
if (allowedInstances.empty()) return;
|
||||
@@ -187,7 +187,7 @@ void SuggestWhatToDoAction::grindReputation()
|
||||
std::vector<std::string> allowedFactions;
|
||||
for (std::map<std::string, uint8>::iterator i = factions.begin(); i != factions.end(); ++i)
|
||||
{
|
||||
if (bot->getLevel() >= i->second)
|
||||
if (bot->GetLevel() >= i->second)
|
||||
allowedFactions.push_back(i->first);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ bool MaintenanceAction::Execute(Event event)
|
||||
factory.InitSkills();
|
||||
factory.InitMounts();
|
||||
factory.InitGlyphs(true);
|
||||
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
|
||||
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
|
||||
factory.ApplyEnchantAndGemsNew();
|
||||
}
|
||||
bot->DurabilityRepairAll(false, 1.0f, false);
|
||||
@@ -199,7 +199,7 @@ bool AutoGearAction::Execute(Event event)
|
||||
gs);
|
||||
factory.InitEquipment(true);
|
||||
factory.InitAmmo();
|
||||
if (bot->getLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
|
||||
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel) {
|
||||
factory.ApplyEnchantAndGemsNew();
|
||||
}
|
||||
bot->DurabilityRepairAll(false, 1.0f, false);
|
||||
|
||||
@@ -63,7 +63,7 @@ bool MoveToDarkPortalAction::Execute(Event event)
|
||||
if (bot->GetGroup()->GetLeaderGUID() != bot->GetGUID() && !GET_PLAYERBOT_AI(GET_PLAYERBOT_AI(bot)->GetGroupMaster()))
|
||||
return false;
|
||||
|
||||
if (bot->getLevel() > 57)
|
||||
if (bot->GetLevel() > 57)
|
||||
{
|
||||
if ((bot->GetTeamId() == TEAM_ALLIANCE && bot->GetQuestStatus(10119) == QUEST_STATUS_NONE) || (bot->GetTeamId() == TEAM_HORDE && bot->GetQuestStatus(9407) == QUEST_STATUS_NONE))
|
||||
{
|
||||
@@ -104,12 +104,12 @@ bool MoveToDarkPortalAction::Execute(Event event)
|
||||
|
||||
bool MoveToDarkPortalAction::isUseful()
|
||||
{
|
||||
return bot->getLevel() > 54;
|
||||
return bot->GetLevel() > 54;
|
||||
}
|
||||
|
||||
bool DarkPortalAzerothAction::Execute(Event event)
|
||||
{
|
||||
if (bot->getLevel() > 57)
|
||||
if (bot->GetLevel() > 57)
|
||||
{
|
||||
WorldPacket packet(CMSG_AREATRIGGER);
|
||||
packet << 4354;
|
||||
@@ -122,7 +122,7 @@ bool DarkPortalAzerothAction::Execute(Event event)
|
||||
|
||||
bool DarkPortalAzerothAction::isUseful()
|
||||
{
|
||||
return bot->getLevel() > 57;
|
||||
return bot->GetLevel() > 57;
|
||||
}
|
||||
|
||||
bool MoveFromDarkPortalAction::Execute(Event event)
|
||||
|
||||
@@ -108,7 +108,7 @@ std::string const WhoAction::QuerySpec(std::string const text)
|
||||
uint8 spec = AiFactory::GetPlayerSpecTab(bot);
|
||||
|
||||
out << "|h|cffffffff" << chat->FormatRace(bot->getRace()) << " [" << (bot->getGender() == GENDER_MALE ? "M" : "F") << "] " << chat->FormatClass(bot, spec);
|
||||
out << " (|h|cff00ff00" << (uint32)bot->getLevel() << "|h|cffffffff lvl), ";
|
||||
out << " (|h|cff00ff00" << (uint32)bot->GetLevel() << "|h|cffffffff lvl), ";
|
||||
out << "|h|cff00ff00" << botAI->GetEquipGearScore(bot, false, false) << "|h|cffffffff GS (";
|
||||
|
||||
ItemCountByQuality visitor;
|
||||
|
||||
@@ -36,10 +36,10 @@ std::vector<uint32> WorldBuffAction::NeedWorldBuffs(Unit* unit)
|
||||
if (wb.classId != 0 && wb.classId != unit->getClass())
|
||||
continue;
|
||||
|
||||
if (wb.minLevel != 0 && wb.minLevel > unit->getLevel())
|
||||
if (wb.minLevel != 0 && wb.minLevel > unit->GetLevel())
|
||||
continue;
|
||||
|
||||
if (wb.maxLevel != 0 && wb.maxLevel < unit->getLevel())
|
||||
if (wb.maxLevel != 0 && wb.maxLevel < unit->GetLevel())
|
||||
continue;
|
||||
|
||||
if (unit->HasAura(wb.spellId))
|
||||
|
||||
@@ -54,7 +54,7 @@ void XpGainAction::GiveXP(uint32 xp, Unit* victim)
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 level = bot->getLevel();
|
||||
uint32 level = bot->GetLevel();
|
||||
|
||||
// XP to money conversion processed in Player::RewardQuest
|
||||
if (level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
@@ -80,7 +80,7 @@ void XpGainAction::GiveXP(uint32 xp, Unit* victim)
|
||||
bot->GiveLevel(level + 1);
|
||||
}
|
||||
|
||||
level = bot->getLevel();
|
||||
level = bot->GetLevel();
|
||||
nextLvlXP = bot->GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ NextAction** CastDireBearFormAction::getAlternatives()
|
||||
|
||||
bool CastTravelFormAction::isUseful()
|
||||
{
|
||||
bool firstmount = bot->getLevel() >= 20;
|
||||
bool firstmount = bot->GetLevel() >= 20;
|
||||
|
||||
// useful if no mount or with wsg flag
|
||||
return !bot->IsMounted() && (!firstmount || (bot->HasAura(23333) || bot->HasAura(23335) || bot->HasAura(34976))) && !botAI->HasAura("dash", bot);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
// if (mediumMana && dynamic_cast<CastBuffSpellAction*>(action))
|
||||
// return 0.0f;
|
||||
|
||||
// if (target && ((int)target->getLevel() - (int)bot->getLevel()) >= 0)
|
||||
// if (target && ((int)target->GetLevel() - (int)bot->GetLevel()) >= 0)
|
||||
// return 1.0f;
|
||||
|
||||
// return 1.0f;
|
||||
|
||||
@@ -59,7 +59,7 @@ bool StealthTrigger::IsActive()
|
||||
|
||||
bool SapTrigger::IsPossible()
|
||||
{
|
||||
return bot->getLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat();
|
||||
return bot->GetLevel() > 10 && bot->HasSpell(6770) && !bot->IsInCombat();
|
||||
}
|
||||
|
||||
bool SprintTrigger::IsPossible()
|
||||
|
||||
@@ -108,7 +108,7 @@ bool OutNumberedTrigger::IsActive()
|
||||
if (bot->GetGroup() && bot->GetGroup()->isRaidGroup())
|
||||
return false;
|
||||
|
||||
int32 botLevel = bot->getLevel();
|
||||
int32 botLevel = bot->GetLevel();
|
||||
uint32 friendPower = 200;
|
||||
uint32 foePower = 0;
|
||||
for (auto& attacker : botAI->GetAiObjectContext()->GetValue<GuidVector>("attackers")->Get())
|
||||
@@ -117,7 +117,7 @@ bool OutNumberedTrigger::IsActive()
|
||||
if (!creature)
|
||||
continue;
|
||||
|
||||
int32 dLevel = creature->getLevel() - botLevel;
|
||||
int32 dLevel = creature->GetLevel() - botLevel;
|
||||
if (dLevel > -10)
|
||||
foePower = std::max(100 + 10 * dLevel, dLevel * 200);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ bool OutNumberedTrigger::IsActive()
|
||||
if (!player || player == bot)
|
||||
continue;
|
||||
|
||||
int32 dLevel = player->getLevel() - botLevel;
|
||||
int32 dLevel = player->GetLevel() - botLevel;
|
||||
|
||||
if (dLevel > -10 && bot->GetDistance(player) < 10.0f)
|
||||
friendPower += std::max(200 + 20 * dLevel, dLevel * 200);
|
||||
|
||||
@@ -84,7 +84,7 @@ bool BgInviteActiveTrigger::IsActive()
|
||||
if (ginfo.IsInvitedToBGInstanceGUID && ginfo.RemoveInviteTime)
|
||||
{
|
||||
LOG_INFO("playerbots", "Bot {} <{}> ({} {}) : Invited to BG but not in BG",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ bool RpgDuelTrigger::IsActive()
|
||||
return false;
|
||||
|
||||
// Less spammy duels
|
||||
if (bot->getLevel() < 3)
|
||||
if (bot->GetLevel() < 3)
|
||||
return false;
|
||||
|
||||
if (botAI->HasRealPlayerMaster())
|
||||
@@ -450,10 +450,10 @@ bool RpgDuelTrigger::IsActive()
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
if (player->getLevel() > bot->getLevel() + 3)
|
||||
if (player->GetLevel() > bot->GetLevel() + 3)
|
||||
return false;
|
||||
|
||||
if (bot->getLevel() > player->getLevel() + 10)
|
||||
if (bot->GetLevel() > player->GetLevel() + 10)
|
||||
return false;
|
||||
|
||||
// caster or target already have requested duel
|
||||
|
||||
@@ -22,7 +22,7 @@ bool MoveStuckTrigger::IsActive()
|
||||
if (posVal->LastChangeDelay() > 5 * MINUTE)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ bool MoveStuckTrigger::IsActive()
|
||||
if (longLog)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 10mins",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
}
|
||||
|
||||
return longLog;
|
||||
@@ -68,7 +68,7 @@ bool MoveLongStuckTrigger::IsActive()
|
||||
if (grid.x_coord < 0 || grid.x_coord >= MAX_NUMBER_OF_GRIDS)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ bool MoveLongStuckTrigger::IsActive()
|
||||
if (grid.y_coord < 0 || grid.y_coord >= MAX_NUMBER_OF_GRIDS)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in grid {},{} on map {}",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ bool MoveLongStuckTrigger::IsActive()
|
||||
if (cell.GridX() > 0 && cell.GridY() > 0 && !MMAP::MMapFactory::createOrGetMMapMgr()->loadMap(botPos.getMapId(), cell.GridX(), cell.GridY()))
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in unloaded grid {},{} on map {}",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), grid.x_coord, grid.y_coord, botPos.getMapId());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ bool MoveLongStuckTrigger::IsActive()
|
||||
if (posVal->LastChangeDelay() > 10 * MINUTE)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for {} seconds",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ bool MoveLongStuckTrigger::IsActive()
|
||||
if (longLog)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in the same position for 15mins",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
}
|
||||
|
||||
return longLog;
|
||||
@@ -146,7 +146,7 @@ bool CombatStuckTrigger::IsActive()
|
||||
if (combatVal->LastChangeDelay() > 5 * MINUTE)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ bool CombatLongStuckTrigger::IsActive()
|
||||
if (combatVal->LastChangeDelay() > 15 * MINUTE)
|
||||
{
|
||||
// LOG_INFO("playerbots", "Bot {} {}:{} <{}> was in combat for {} seconds",
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->getLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
// bot->GetGUID().ToString().c_str(), bot->GetTeamId() == TEAM_ALLIANCE ? "A" : "H", bot->GetLevel(), bot->GetName(), posVal->LastChangeDelay());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ uint8 BalancePercentValue::Calculate()
|
||||
if (!player || !player->IsAlive())
|
||||
continue;
|
||||
|
||||
playerLevel += player->getLevel();
|
||||
playerLevel += player->GetLevel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ uint8 BalancePercentValue::Calculate()
|
||||
if (!creature || !creature->IsAlive())
|
||||
continue;
|
||||
|
||||
uint32 level = creature->getLevel();
|
||||
uint32 level = creature->GetLevel();
|
||||
|
||||
switch (creature->GetCreatureTemplate()->rank)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ uint32 MoneyNeededForValue::Calculate()
|
||||
|
||||
uint32 moneyWanted = 0;
|
||||
|
||||
uint32 level = bot->getLevel();
|
||||
uint32 level = bot->GetLevel();
|
||||
|
||||
switch (needMoneyFor)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ Unit* GrindTargetValue::FindTargetForGrinding(uint32 assistCount)
|
||||
//if (!bot->InBattleground() && master && master->GetDistance(unit) >= sPlayerbotAIConfig->grindDistance && !sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
//continue;
|
||||
|
||||
if (!bot->InBattleground() && (int)unit->getLevel() - (int)bot->getLevel() > 4 && !unit->GetGUID().IsPlayer())
|
||||
if (!bot->InBattleground() && (int)unit->GetLevel() - (int)bot->GetLevel() > 4 && !unit->GetGUID().IsPlayer())
|
||||
continue;
|
||||
|
||||
// if (needForQuestMap.find(unit->GetEntry()) == needForQuestMap.end())
|
||||
@@ -160,7 +160,7 @@ bool GrindTargetValue::needForQuest(Unit* target)
|
||||
{
|
||||
QuestStatusData* questStatus = sTravelMgr->getQuestStatus(bot, questId);
|
||||
|
||||
if (questTemplate->GetQuestLevel() > bot->getLevel())
|
||||
if (questTemplate->GetQuestLevel() > bot->GetLevel())
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)
|
||||
|
||||
@@ -190,7 +190,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
|
||||
if (itemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), itemProto))
|
||||
shouldEquip = false;
|
||||
if (itemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->getLevel(), itemProto))
|
||||
if (itemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->GetLevel(), itemProto))
|
||||
shouldEquip = false;
|
||||
|
||||
Item* oldItem = bot->GetItemByPos(dest);
|
||||
@@ -228,7 +228,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
|
||||
if (oldItemProto->Class == ITEM_CLASS_WEAPON && !sRandomItemMgr->CanEquipWeapon(bot->getClass(), oldItemProto))
|
||||
existingShouldEquip = false;
|
||||
|
||||
if (oldItemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->getLevel(), oldItemProto))
|
||||
if (oldItemProto->Class == ITEM_CLASS_ARMOR && !sRandomItemMgr->CanEquipArmor(bot->getClass(), bot->GetLevel(), oldItemProto))
|
||||
existingShouldEquip = false;
|
||||
|
||||
// uint32 oldItemPower = sRandomItemMgr->GetLiveStatWeight(bot, oldItemProto->ItemId);
|
||||
|
||||
@@ -177,7 +177,7 @@ BattlegroundTypeId RpgBgTypeValue::Calculate()
|
||||
if (!bg)
|
||||
continue;
|
||||
|
||||
if (bot->getLevel() < bg->GetMinLevel())
|
||||
if (bot->GetLevel() < bg->GetMinLevel())
|
||||
continue;
|
||||
|
||||
// check if already in queue
|
||||
|
||||
@@ -136,7 +136,7 @@ questGiverMap QuestGiversValue::Calculate()
|
||||
|
||||
std::vector<GuidPosition> ActiveQuestGiversValue::Calculate()
|
||||
{
|
||||
questGiverMap qGivers = GAI_VALUE2(questGiverMap, "quest givers", bot->getLevel());
|
||||
questGiverMap qGivers = GAI_VALUE2(questGiverMap, "quest givers", bot->GetLevel());
|
||||
|
||||
std::vector<GuidPosition> retQuestGivers;
|
||||
|
||||
@@ -406,7 +406,7 @@ uint32 DialogStatusValue::getDialogStatus(Player* bot, int32 questgiver, uint32
|
||||
{
|
||||
dialogStatusNew = DIALOG_STATUS_REWARD_REP;
|
||||
}
|
||||
else if (lowLevelDiff < 0 || bot->getLevel() <= bot->GetQuestLevel(pQuest) + uint32(lowLevelDiff))
|
||||
else if (lowLevelDiff < 0 || bot->GetLevel() <= bot->GetQuestLevel(pQuest) + uint32(lowLevelDiff))
|
||||
{
|
||||
dialogStatusNew = DIALOG_STATUS_AVAILABLE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user