Merge pull request #38 from Bogir/fixes_1

Several Fixes
This commit is contained in:
ZhengPeiRu21
2022-04-11 08:43:02 -06:00
committed by GitHub
3 changed files with 19 additions and 10 deletions

View File

@@ -2006,14 +2006,14 @@ void PlayerbotFactory::InitMounts()
break;
case RACE_NIGHTELF:
slow = { 10789, 8394, 10793 };
fast = { 18766, 18767, 18902 };
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 = { 8588, 10796, 8592, 472 };
slow = { 10796, 10799, 8395, 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();
@@ -2576,6 +2576,9 @@ void PlayerbotFactory::InitArenaTeam()
ObjectGuid capt = arenateam->GetCaptain();
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());

View File

@@ -497,6 +497,9 @@ void RandomPlayerbotFactory::CreateRandomGuilds()
if (guildName.empty())
continue;
if (sGuildMgr->GetGuildByName(guildName))
continue;
if (availableLeaders.empty())
{
LOG_ERROR("playerbots", "No leaders for random guilds available");
@@ -508,14 +511,17 @@ 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;
}
if (player->GetGuildId())
continue;
Guild* guild = new Guild();
if (!guild->Create(player, guildName))
{
LOG_ERROR("playerbots", "Error creating guild {}", guildName.c_str());
LOG_ERROR("playerbots", "Error creating guild [ {} ] with leader [ {} ]", guildName.c_str(), player->GetName().c_str());
delete guild;
continue;
}

View File

@@ -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);