From 0b83523a2c39f776f9871725acd88f6c78b75b19 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 17:37:53 +0500 Subject: [PATCH 01/13] fix removed unexisting spells for mounting moved condition for check Guild on top of method --- src/PlayerbotFactory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 5b574013..2cec8b78 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2021,7 +2021,7 @@ void PlayerbotFactory::InitMounts() fast = { 23225, 23223, 23222 }; break; case RACE_TROLL: - slow = { 8588, 10796, 8592, 472 }; + slow = { 10796, 472 }; fast = { 23241, 23242, 23243 }; break; case RACE_DRAENEI: @@ -2412,15 +2412,15 @@ void PlayerbotFactory::InitInventoryEquip() void PlayerbotFactory::InitGuild() { + if (bot->GetGuildId()) + return; + bot->SaveToDB(false, false); // add guild tabard if (bot->GetGuildId() && !bot->HasItemCount(5976, 1)) StoreItem(5976, 1); - if (bot->GetGuildId()) - return; - if (sPlayerbotAIConfig->randomBotGuilds.empty()) RandomPlayerbotFactory::CreateRandomGuilds(); From ac36231adcaced2285c2fb0ed36efa758cddda6a Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 17:47:01 +0500 Subject: [PATCH 02/13] fix check if GuildName is already taken by other guild fixed NPE `if (!player) ... player->GetName()` --- src/RandomPlayerbotFactory.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index d961b290..910eaa6c 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -497,6 +497,12 @@ void RandomPlayerbotFactory::CreateRandomGuilds() if (guildName.empty()) continue; + if (sGuildMgr->GetGuildByName(guildName)) + { + LOG_WARN("playerbots", "GuildName %s is busy. Skipped...", guildName.c_str()); + continue; + } + if (availableLeaders.empty()) { LOG_ERROR("playerbots", "No leaders for random guilds available"); @@ -508,14 +514,16 @@ void RandomPlayerbotFactory::CreateRandomGuilds() Player* player = ObjectAccessor::FindPlayer(leader); if (!player) { - LOG_ERROR("playerbots", "Cannot find player for leader {}", player->GetName().c_str()); + LOG_ERROR("playerbots", "ObjectAccessor Cannot find player to set leader for guild {} . Skipped...", guildName.c_str()); continue; } Guild* guild = new Guild(); if (!guild->Create(player, guildName)) { - LOG_ERROR("playerbots", "Error creating guild {}", guildName.c_str()); + // it very strange, but sometimes Guild can't be created by unknown reason + // We already checked that player is exists and guildName are correct + LOG_ERROR("playerbots", "Error creating guild [ {} ] with leader [ {} ]", guildName.c_str(), player->GetName().c_str()); delete guild; continue; } From af25f586e031141087f6ec26b4507dcab89a3aed Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 17:52:06 +0500 Subject: [PATCH 03/13] fix synthax --- src/RandomPlayerbotMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index 642b0fa2..451a7ec3 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -918,7 +918,7 @@ bool RandomPlayerbotMgr::ProcessBot(Player* player) uint32 teleport = GetEventValue(bot, "teleport"); if (!teleport) { - LOG_INFO("players", "Bot #%d <%s>: sent to grind", bot, player->GetName()); + LOG_INFO("players", "Bot #{} <{}>: sent to grind", bot, player->GetName()); RandomTeleportForLevel(player); Refresh(player); SetEventValue(bot, "teleport", 1, sPlayerbotAIConfig->maxRandomBotInWorldTime); From ca1a012325a2fba63bdea634b1bb06dc2d619675 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 18:02:43 +0500 Subject: [PATCH 04/13] removed unexisting spell id --- src/PlayerbotFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 2cec8b78..0c9eb975 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2006,7 +2006,7 @@ void PlayerbotFactory::InitMounts() break; case RACE_NIGHTELF: slow = { 10789, 8394, 10793 }; - fast = { 18766, 18767, 18902 }; + fast = { 18766, 18767 }; break; case RACE_UNDEAD_PLAYER: slow = { 17463, 17464, 17462 }; From 5bc71a454244f89242aeb065648ceaa527014d31 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 18:24:34 +0500 Subject: [PATCH 05/13] check if player already is member of any Arena-tream --- src/PlayerbotFactory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 0c9eb975..1cf346ec 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2576,6 +2576,9 @@ void PlayerbotFactory::InitArenaTeam() ObjectGuid capt = arenateam->GetCaptain(); Player* botcaptain = ObjectAccessor::FindPlayer(capt); + if (sCharacterCache->GetCharacterArenaTeamIdByGuid(capt, arenateam->GetType()) != 0) + return; + if (botcaptain && botcaptain->GetTeamId() == bot->GetTeamId()) //need? { arenateam->AddMember(bot->GetGUID()); From 08be97053861965374367186d64dba4bd05e8759 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 19:22:56 +0500 Subject: [PATCH 06/13] . --- src/PlayerbotFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 1cf346ec..54535b8c 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2576,7 +2576,7 @@ void PlayerbotFactory::InitArenaTeam() ObjectGuid capt = arenateam->GetCaptain(); Player* botcaptain = ObjectAccessor::FindPlayer(capt); - if (sCharacterCache->GetCharacterArenaTeamIdByGuid(capt, arenateam->GetType()) != 0) + if (sCharacterCache->GetCharacterArenaTeamIdByGuid(capt, arenateam->GetType()) != 0 || botcaptain->GetArenaTeamId(arenateam->GetType())) return; if (botcaptain && botcaptain->GetTeamId() == bot->GetTeamId()) //need? From 6e89ba391f3cf13d25f02c49430be5c36f7414a7 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Fri, 8 Apr 2022 20:32:07 +0500 Subject: [PATCH 07/13] fixed some ids --- src/PlayerbotFactory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 54535b8c..ae7030e8 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2006,14 +2006,14 @@ void PlayerbotFactory::InitMounts() break; case RACE_NIGHTELF: slow = { 10789, 8394, 10793 }; - fast = { 18766, 18767 }; + fast = { 24252, 63637, 22723 }; break; case RACE_UNDEAD_PLAYER: slow = { 17463, 17464, 17462 }; - fast = { 17465, 23246 }; + fast = { 17465, 23246, 66846 }; break; case RACE_TAUREN: - slow = { 18990, 18989 }; + slow = { 18990, 18989, 64657 }; fast = { 23249, 23248, 23247 }; break; case RACE_GNOME: @@ -2021,7 +2021,7 @@ void PlayerbotFactory::InitMounts() fast = { 23225, 23223, 23222 }; break; case RACE_TROLL: - slow = { 10796, 472 }; + slow = { 10796, 10799, 8395, 472 }; fast = { 23241, 23242, 23243 }; break; case RACE_DRAENEI: From 0f5407e92e1f0e2bb3f8695823d1617f6803ad91 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Sat, 9 Apr 2022 04:21:52 +0500 Subject: [PATCH 08/13] fix create random guild --- src/RandomPlayerbotFactory.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index 910eaa6c..1580b828 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -498,10 +498,7 @@ void RandomPlayerbotFactory::CreateRandomGuilds() continue; if (sGuildMgr->GetGuildByName(guildName)) - { - LOG_WARN("playerbots", "GuildName %s is busy. Skipped...", guildName.c_str()); continue; - } if (availableLeaders.empty()) { @@ -518,6 +515,9 @@ void RandomPlayerbotFactory::CreateRandomGuilds() continue; } + if (player->GetGuildId()) + continue; + Guild* guild = new Guild(); if (!guild->Create(player, guildName)) { From 76155fc2ca714305f789571b808c9b54bedcd2fa Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Sat, 9 Apr 2022 04:24:41 +0500 Subject: [PATCH 09/13] . --- src/RandomPlayerbotFactory.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index 1580b828..585669ab 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -521,8 +521,6 @@ void RandomPlayerbotFactory::CreateRandomGuilds() Guild* guild = new Guild(); if (!guild->Create(player, guildName)) { - // it very strange, but sometimes Guild can't be created by unknown reason - // We already checked that player is exists and guildName are correct LOG_ERROR("playerbots", "Error creating guild [ {} ] with leader [ {} ]", guildName.c_str(), player->GetName().c_str()); delete guild; continue; From ba8f6fd1194d62b497816fa55737c8bf75df4c5d Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Sat, 9 Apr 2022 15:06:32 +0500 Subject: [PATCH 10/13] Update PlayerbotFactory.cpp --- src/PlayerbotFactory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index ae7030e8..74b16e9e 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2576,8 +2576,7 @@ void PlayerbotFactory::InitArenaTeam() ObjectGuid capt = arenateam->GetCaptain(); Player* botcaptain = ObjectAccessor::FindPlayer(capt); - if (sCharacterCache->GetCharacterArenaTeamIdByGuid(capt, arenateam->GetType()) != 0 || botcaptain->GetArenaTeamId(arenateam->GetType())) - return; + if ((bot && bot->GetArenaTeamId(arenateam->GetSlot())) || sCharacterCache->GetCharacterArenaTeamIdByGuid(bot->GetGUID(), arenateam->GetSlot()) != 0) if (botcaptain && botcaptain->GetTeamId() == bot->GetTeamId()) //need? { From eae5011e484e4c03562079c849fb343b28927f53 Mon Sep 17 00:00:00 2001 From: "Bogir[rus]" Date: Sat, 9 Apr 2022 15:07:43 +0500 Subject: [PATCH 11/13] Update PlayerbotFactory.cpp --- src/PlayerbotFactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 74b16e9e..d5ab30cb 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2577,7 +2577,8 @@ void PlayerbotFactory::InitArenaTeam() Player* botcaptain = ObjectAccessor::FindPlayer(capt); if ((bot && bot->GetArenaTeamId(arenateam->GetSlot())) || sCharacterCache->GetCharacterArenaTeamIdByGuid(bot->GetGUID(), arenateam->GetSlot()) != 0) - + return; + if (botcaptain && botcaptain->GetTeamId() == bot->GetTeamId()) //need? { arenateam->AddMember(bot->GetGUID()); From 0d9483ef9dd7119fb6c01feb91c299b1337c0e03 Mon Sep 17 00:00:00 2001 From: qudzy <102037134+qudzy@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:26:30 +0200 Subject: [PATCH 12/13] Categorize Visual Studio folder in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c6e12994..3317db68 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ CMakeLists.txt.user # /.settings/ /.externalToolBuilders/* +/.vs # exclude in all levels nbproject/ .sync.ffs_db From f0ecab6ac5920983d27ea99b5e1e94e5f4676475 Mon Sep 17 00:00:00 2001 From: qudzy <102037134+qudzy@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:49:13 +0200 Subject: [PATCH 13/13] Correct faction interpolation in reputation suggestion --- src/strategy/actions/SuggestWhatToDoAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/actions/SuggestWhatToDoAction.cpp b/src/strategy/actions/SuggestWhatToDoAction.cpp index 32c83629..a32d59b2 100644 --- a/src/strategy/actions/SuggestWhatToDoAction.cpp +++ b/src/strategy/actions/SuggestWhatToDoAction.cpp @@ -205,7 +205,7 @@ void SuggestWhatToDoAction::grindReputation() std::ostringstream itemout; itemout << "|c004040b0" << allowedFactions[urand(0, allowedFactions.size() - 1)] << "|r"; - placeholders["{}action"] = itemout.str(); + placeholders["%faction"] = itemout.str(); spam(sPlayerbotTextMgr->Format("suggest_faction", placeholders)); }