fix(scene): unlock all teleports across maps, merge resource configs, fix scenary not load error, and add quick farm battle handlers

This commit is contained in:
CAtlas0784 committed 2026-10-16 20:08:13 +07:00
1 parent 9aab62414f
commit 163d4433e6
47 files changed
+2025067 -6082

No files matched your search

@@ -67,6 +67,29 @@ func loadChallengeScene(s *Session, entryID, targetGroupID, monsterID, eventID u
}
// 2. position the player safely between boss and arena center
// 2. detect arena floor platform height from props in scene
// In some challenge arenas (e.g. entrance 3012602 / AS Starward 30225),
// the boss monster pos in config is placed at Y = -193081 (22m below the floor),
// while the arena stage prop (102259) is at Y = -170770.
// Spawning at monsPos.Y puts the player under the map into the void.
hasFloorProp := false
var floorY int32 = -2147483648
for _, g := range scene.Scenes {
for _, p := range g.Props {
dx := float64(p.Pos.X)
dz := float64(p.Pos.Z)
if math.Sqrt(dx*dx+dz*dz) < 150000.0 { // within 150 meters of center
if p.Pos.Y > floorY {
floorY = p.Pos.Y
hasFloorProp = true
}
}
}
}
if hasFloorProp && floorY > monsPos.Y {
monsPos.Y = floorY
}
centerVX := float64(-monsPos.X)
centerVZ := float64(-monsPos.Z)
distToCenter := math.Sqrt(centerVX*centerVX + centerVZ*centerVZ)
@@ -99,10 +122,7 @@ func loadChallengeScene(s *Session, entryID, targetGroupID, monsterID, eventID u
Pos: &goproto.Vector{X: spawnX, Y: spawnY, Z: spawnZ},
Rot: &goproto.Vector{Y: spawnRotY},
}
player.Scene.EntryID = entryID
player.Scene.FloorID = floorID
player.Scene.PlaneID = planeID
// NOTE: keep player.Scene intact so returning to overworld or relogging spawns in overworld
sceneInfo := &goproto.SceneInfo{
FloorId: floorID,
@@ -119,13 +139,10 @@ func loadChallengeScene(s *Session, entryID, targetGroupID, monsterID, eventID u
}
sceneInfo.LightenSectionList = scene.Sections
// load props for group 1, target group, and common prop groups (7/8)
// load all props in the arena scene (do not filter out prop groups like group 2 / group 3)
propEntityID := uint32(1000)
s.PropEntities = map[uint32]PropEntry{}
for _, gid := range sortedU32Keys2(scene.Scenes) {
if gid != 1 && gid != targetGroupID && gid != 7 && gid != 8 {
continue
}
group := scene.Scenes[gid]
groupInfo := &goproto.SceneEntityGroupInfo{GroupId: gid}
for i := range group.Props {