Update starter position

This commit is contained in:
Yunfan Li
2024-12-14 01:33:39 +08:00
parent 2171493d5e
commit 1f8d0d244c

View File

@@ -1451,6 +1451,7 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
"AND t.faction not in (11, 71, 79, 85, 188, 1575) " "AND t.faction not in (11, 71, 79, 85, 188, 1575) "
"AND (t.unit_flags & 256) = 0 " "AND (t.unit_flags & 256) = 0 "
"AND (t.unit_flags & 4096) = 0 " "AND (t.unit_flags & 4096) = 0 "
"AND t.rank = 0 "
// "AND (t.flags_extra & 32768) = 0 " // "AND (t.flags_extra & 32768) = 0 "
"GROUP BY " "GROUP BY "
"map, " "map, "
@@ -1531,20 +1532,28 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
continue; continue;
const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(1, x, y, z)); const AreaTableEntry* area = sAreaTableStore.LookupEntry(map->GetAreaId(1, x, y, z));
uint32 level = area->area_level; uint32 level = area->area_level;
for (int i = 1; i <= 80; i++) for (int i = 5; i <= 80; i++)
{ {
std::vector<WorldLocation>& locs = locsPerLevelCache[i]; std::vector<WorldLocation>& locs = locsPerLevelCache[i];
int counter = 0; int counter = 0;
WorldLocation levelLoc; WorldLocation levelLoc;
for (auto& checkLoc : locs) for (auto& checkLoc : locs)
{ {
if (loc.GetMapId() == checkLoc.GetMapId() && loc.GetExactDist(checkLoc) <= 500.0f) if (loc.GetMapId() != checkLoc.GetMapId())
continue;
if (map->GetZoneId(1, loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ()) !=
map->GetZoneId(1, checkLoc.GetPositionX(), checkLoc.GetPositionY(), checkLoc.GetPositionZ()))
continue;
if (loc.GetMapId() == checkLoc.GetMapId() && loc.GetExactDist(checkLoc) <= 1000.0f)
{ {
counter++; counter++;
levelLoc = checkLoc; levelLoc = checkLoc;
} }
} }
if (counter < 3) if (counter < 15)
continue; continue;
if (!(entry->hostileMask & 4)) if (!(entry->hostileMask & 4))