diff --git a/src/Bot/RandomPlayerbotMgr.cpp b/src/Bot/RandomPlayerbotMgr.cpp index 3fea369a5..a772136e7 100644 --- a/src/Bot/RandomPlayerbotMgr.cpp +++ b/src/Bot/RandomPlayerbotMgr.cpp @@ -1768,13 +1768,16 @@ void RandomPlayerbotMgr::RandomTeleportForLevel(Player* bot) if (bot->InBattleground()) return; - std::vector locs = sTravelMgr.GetCityLocations(bot); - if (!locs.empty()) + if (bot->GetLevel() >= 10 && urand(0, 100) < sPlayerbotAIConfig.probTeleToBankers * 100) { - RandomTeleport(bot, locs, true); - return; + std::vector locs = sTravelMgr.GetCityLocations(bot); + if (!locs.empty()) + { + RandomTeleport(bot, locs, true); + return; + } } - locs = sTravelMgr.GetTeleportLocations(bot); + std::vector locs = sTravelMgr.GetTeleportLocations(bot); if (!locs.empty()) { RandomTeleport(bot, locs, false); diff --git a/src/Mgr/Travel/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp index 7a5ac4f2e..1868bc2e3 100644 --- a/src/Mgr/Travel/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -4419,6 +4419,7 @@ std::vector> TravelMgr::GetOptimalFlightDestinations(Player* bot->GetTeamId()); if (!fromNode) return validDestinations; + std::vector candidateLocations; if (bot->GetLevel() >= 10 && urand(0, 100) < sPlayerbotAIConfig.probTeleToBankers * 100) candidateLocations = GetCityLocations(bot); @@ -4673,6 +4674,31 @@ void TravelMgr::PrepareDestinationCache() if (forAlliance) allianceFlightMasterCache[guid] = pos; flightMastersCount++; + + // Zones that have flight masters but no innkeepers — use flight master as hub + static const std::set zonesWithoutInnkeeper = { + 4, // Blasted Lands (52-57) + 16, // Azshara (45-52) + 28, // Western Plaguelands (50-60) + 46, // Burning Steppes (51-60) + 51, // Searing Gorge (45-51) + 361, // Felwood (47-57) + 490, // Un'Goro Crater (49-56) + 2817, // Crystalsong Forest (77-80) + 4197 // Wintergrasp (79-80) + }; + if (zonesWithoutInnkeeper.count(areaId)) + { + LevelBracket bracket = zone2LevelBracket[areaId]; + WorldPosition loc(mapId, x + cos(orient) * 5.0f, y + sin(orient) * 5.0f, z + 0.5f, orient + M_PI); + for (int i = bracket.low; i <= bracket.high; i++) + { + if (forHorde) + hordeHubsPerLevelCache[i].push_back(loc); + if (forAlliance) + allianceHubsPerLevelCache[i].push_back(loc); + } + } } else if (creatureTemplate->npcflag & UNIT_NPC_FLAG_INNKEEPER) {