服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
108 lines
2.9 KiB
Go
108 lines
2.9 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"fmt"
|
|
"log"
|
|
"sort"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"longheng.io/server/internal/modules/dnf/worldmap"
|
|
platformpvf "longheng.io/server/internal/platform/pvf"
|
|
)
|
|
|
|
func main() {
|
|
pvfPath := flag.String("pvf", `D:/DNF/runtime/data/dnf/Script.pvf`, "Script.pvf path")
|
|
dungeonIDs := flag.String("dungeons", "62,63,64,65,66,67,4000", "comma-separated dungeon ids")
|
|
flag.Parse()
|
|
|
|
ids, err := parseIDs(*dungeonIDs)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
archive, err := platformpvf.Open(*pvfPath)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
table, err := worldmap.LoadSource(context.Background(), archive, worldmap.Options{})
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
maps := table.Maps()
|
|
for _, dungeonID := range ids {
|
|
dungeon, found := table.FindDungeon(dungeonID)
|
|
if !found {
|
|
fmt.Printf("dungeon=%d missing\n", dungeonID)
|
|
continue
|
|
}
|
|
owned := make([]worldmap.Map, 0)
|
|
for _, mapValue := range maps {
|
|
if mapOwnsDungeon(mapValue, dungeonID) {
|
|
owned = append(owned, mapValue)
|
|
}
|
|
}
|
|
sort.Slice(owned, func(i, j int) bool { return owned[i].ID < owned[j].ID })
|
|
monsterRows, randomRows, fixedRows := 0, 0, 0
|
|
var randomTotal, fixedTotal int64
|
|
for _, mapValue := range owned {
|
|
for _, spawn := range mapValue.Monsters {
|
|
monsterRows++
|
|
if spawn.RandomDropCount > 0 {
|
|
randomRows++
|
|
randomTotal += spawn.RandomDropCount
|
|
}
|
|
if spawn.FixedDropCount > 0 {
|
|
fixedRows++
|
|
fixedTotal += spawn.FixedDropCount
|
|
}
|
|
}
|
|
}
|
|
warpRules := len(dungeon.WarpMapConditions)
|
|
fmt.Printf("dungeon=%d name=%q path=%s mazes=%d owned_maps=%d monster_rows=%d random_rows=%d random_total=%d fixed_rows=%d fixed_total=%d warp_rules=%d\n",
|
|
dungeon.ID, dungeon.Metadata.Name, dungeon.Path, len(dungeon.Mazes), len(owned), monsterRows,
|
|
randomRows, randomTotal, fixedRows, fixedTotal, warpRules)
|
|
for _, mapValue := range owned {
|
|
for index, spawn := range mapValue.Monsters {
|
|
if spawn.RandomDropCount == 0 && spawn.FixedDropCount == 0 {
|
|
continue
|
|
}
|
|
fmt.Printf(" map=%d path=%s monster_index=%d monster=%d rank=%s random=%d fixed=%d\n",
|
|
mapValue.ID, mapValue.Path, index, spawn.MonsterID, spawn.Rank,
|
|
spawn.RandomDropCount, spawn.FixedDropCount)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func parseIDs(value string) ([]int64, error) {
|
|
parts := strings.Split(value, ",")
|
|
ids := make([]int64, 0, len(parts))
|
|
for _, part := range parts {
|
|
part = strings.TrimSpace(part)
|
|
if part == "" {
|
|
continue
|
|
}
|
|
id, err := strconv.ParseInt(part, 10, 64)
|
|
if err != nil || id <= 0 {
|
|
return nil, fmt.Errorf("invalid dungeon id %q", part)
|
|
}
|
|
ids = append(ids, id)
|
|
}
|
|
return ids, nil
|
|
}
|
|
|
|
func mapOwnsDungeon(mapValue worldmap.Map, dungeonID int64) bool {
|
|
if mapValue.DungeonID.Set && mapValue.DungeonID.Value == dungeonID {
|
|
return true
|
|
}
|
|
for _, candidate := range mapValue.DungeonIDs {
|
|
if candidate == dungeonID {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|