2025-08-30 00:36:08 +08:00
|
|
|
|
package xmlres
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"encoding/xml"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 根结构体:对应 <Maps> 节点
|
|
|
|
|
|
type MonsterRoot struct {
|
|
|
|
|
|
XMLName xml.Name `xml:"Maps"`
|
|
|
|
|
|
WorldWildMons WorldWildMons `xml:"WorldWildMons"` // 世界野怪配置
|
|
|
|
|
|
Maps []TMapConfig `xml:"Map"` // 所有地图配置(多个<Map>)
|
|
|
|
|
|
DefaultMaps DefaultMaps `xml:"DefaultMaps"` // 默认登录场景
|
|
|
|
|
|
VersionNumber VersionNumber `xml:"VersionNumber"` // 版本信息
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 世界野怪容器:对应 <WorldWildMons>
|
|
|
|
|
|
type WorldWildMons struct {
|
|
|
|
|
|
WorldWildMonsters []WorldWildMonster `xml:"WorldWildMonster"` // 多个<WorldWildMonster>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 世界野怪配置:对应 <WorldWildMonster>
|
|
|
|
|
|
type WorldWildMonster struct {
|
|
|
|
|
|
WorldWildProb int `xml:"WorldWildProb,attr"` // 变身概率(分子)
|
|
|
|
|
|
WorldWildMonId int `xml:"WorldWildMonId,attr"` // 野怪ID
|
|
|
|
|
|
WorldWildMonLv int `xml:"WorldWildMonLv,attr"` // 野怪等级
|
|
|
|
|
|
WorldWildStart int `xml:"WorldWildStart,attr"` // 出现起始时间(0-23)
|
|
|
|
|
|
WorldWildEnd int `xml:"WorldWildEnd,attr"` // 出现结束时间(0-23)
|
|
|
|
|
|
NewSeIdxs string `xml:"NewSeIdxs,attr"` // 特效ID(可能多个,空格分隔)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 单张地图配置:对应 <Map>
|
|
|
|
|
|
type TMapConfig struct {
|
|
|
|
|
|
ID int `xml:"ID,attr"` // 地图ID
|
|
|
|
|
|
Name string `xml:"Name,attr"` // 地图名称
|
|
|
|
|
|
InitX int `xml:"InitX,attr"` // 玩家初始X坐标
|
|
|
|
|
|
InitY int `xml:"InitY,attr"` // 玩家初始Y坐标
|
|
|
|
|
|
GameTriggerGrps []GameTriggerGrp `xml:"GameTriggerGrp"` // 触发点组(多个)
|
|
|
|
|
|
Monsters *MonstersC `xml:"Monsters"` // 新增:野怪配置(可选,用指针处理“无该节点”的情况)
|
|
|
|
|
|
Bosses []BossConfig `xml:"Bosses>Boss"` // BOSS配置(<Bosses>下的<Boss>)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ########################### 关键新增:MonstersConfig(对应 <Monsters>) ###########################
|
|
|
|
|
|
// 野怪配置容器:包含野怪奖励概率和多只野怪
|
|
|
|
|
|
type MonstersC struct {
|
|
|
|
|
|
WildBonusProb int `xml:"WildBonusProb,attr"` // 打赢野怪给奖励的概率(分子,如300)
|
|
|
|
|
|
WildBonusTotalProb int `xml:"WildBonusTotalProb,attr"` // 打赢野怪给奖励的概率(分母,如1000)
|
|
|
|
|
|
BonusID int `xml:"BonusID,attr"` // 奖励ID(如5239)
|
|
|
|
|
|
ItemBonusID int `xml:"ItemBonusID,attr"` // 物品奖励ID(如1)
|
|
|
|
|
|
Monsters []Monster1 `xml:"Monster"` // 多只野怪(<Monster>子节点)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ########################### 关键新增:Monster(对应 <Monster>) ###########################
|
|
|
|
|
|
// 单只野怪配置:ID可能是多个值(空格分隔),Lv是等级范围(空格分隔)
|
|
|
|
|
|
type Monster1 struct {
|
|
|
|
|
|
ID string `xml:"ID,attr"` // 野怪ID(如"164 0 0..."或"10")
|
|
|
|
|
|
Lv string `xml:"Lv,attr"` // 等级范围(如"1 2"表示1-2级)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 游戏触发点组:对应 <GameTriggerGrp>
|
|
|
|
|
|
type GameTriggerGrp struct {
|
|
|
|
|
|
GameID string `xml:"GameID,attr"` // 游戏ID
|
|
|
|
|
|
TriggerPts []TriggerPt `xml:"TriggerPt"` // 触发点(多个)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 触发点:对应 <TriggerPt>
|
|
|
|
|
|
type TriggerPt struct {
|
|
|
|
|
|
ID int `xml:"ID,attr"` // 触发点ID
|
|
|
|
|
|
Name string `xml:"Name,attr"` // 触发点名称(可选)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// BOSS配置:对应 <Boss>
|
|
|
|
|
|
type BossConfig struct {
|
2025-11-22 22:57:32 +08:00
|
|
|
|
Id *int `xml:"Id,attr"` // BOSSID(可选,XML中有Id="0"/"1")
|
|
|
|
|
|
TaskID *int `xml:"TaskID,attr"` // 关联任务ID(可选,如311/353/541)
|
|
|
|
|
|
BossCatchable int `xml:"BossCatchable,attr"` // 是否可捕捉(0/1,默认0,XML中有BossCatchable="0")
|
|
|
|
|
|
AppearTime string `xml:"AppearTime,attr"` // 出现时间(如"0 23",必选)
|
|
|
|
|
|
BossVisible int `xml:"BossVisible,attr"` // 是否可见(0/1,默认0,必选)
|
|
|
|
|
|
Name string `xml:"Name,attr"` // BOSS名称(可选,如"SPT哈莫雷特")
|
|
|
|
|
|
SptLevel *int `xml:"SptLevel,attr"` // SPT等级(可选,如1/2)
|
|
|
|
|
|
BonusProbability *int `xml:"BonusProbability,attr"` // 奖励概率(可选,如20)
|
|
|
|
|
|
BonusTotalProbability *int `xml:"BonusTotalProbability,attr"` // 奖励总概率(可选,如1000)
|
|
|
|
|
|
BonusID *string `xml:"BonusID,attr"` // 基础奖励ID(可选,如5017)
|
|
|
|
|
|
ItemBonusOutID *int `xml:"ItemBonusOutID,attr"` // 物品奖励输出ID(可选,如2)
|
|
|
|
|
|
BossFinOnce *int `xml:"BossFinOnce,attr"` // 是否仅可完成一次(可选,0/1,如1)
|
|
|
|
|
|
BossFinTaskWay *int `xml:"BossFinTaskWay,attr"` // 任务完成方式(可选,如1)
|
|
|
|
|
|
DailyKey *string `xml:"DailyKey,attr"` // 每日挑战次数Key(可选,XML中未出现,保留)
|
|
|
|
|
|
MaxTimes *int `xml:"MaxTimes,attr"` // 非VIP每日挑战上限(可选,XML中未出现,保留)
|
|
|
|
|
|
VipMaxTimes *int `xml:"VipMaxTimes,attr"` // VIP每日挑战上限(可选,XML中未出现,保留)
|
|
|
|
|
|
WinBonusId *string `xml:"WinBonusId,attr"` // 胜利奖励ID(可选,XML中未出现,保留)
|
|
|
|
|
|
WinOutId *int `xml:"WinOutId,attr"` // 胜利输出ID(可选,XML中未出现,保留)
|
|
|
|
|
|
FailBonusId *string `xml:"FailBonusId,attr"` // 失败奖励ID(可选,XML中未出现,保留)
|
|
|
|
|
|
FailOutId *int `xml:"FailOutId,attr"` // 失败输出ID(可选,XML中未出现,保留)
|
|
|
|
|
|
BossMon []BossMon `xml:"BossMon"` // BOSS对应的精灵列表(必选,多个)
|
2025-08-30 00:36:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// BOSS精灵配置:对应 <BossMon>
|
|
|
|
|
|
type BossMon struct {
|
|
|
|
|
|
MonID string `xml:"MonID,attr"` // 精灵ID(可能多个,空格分隔)
|
|
|
|
|
|
Hp int `xml:"Hp,attr"` // 生命值
|
|
|
|
|
|
Lv int `xml:"Lv,attr"` // 等级
|
|
|
|
|
|
NewSeIdxs string `xml:"NewSeIdxs,attr"` // 特效ID(可选,空格分隔)
|
|
|
|
|
|
Atk *int `xml:"Atk,attr"` // 攻击(可选)
|
|
|
|
|
|
Def *int `xml:"Def,attr"` // 防御(可选)
|
|
|
|
|
|
Spatk *int `xml:"Spatk,attr"` // 特攻(可选)
|
|
|
|
|
|
Spdef *int `xml:"Spdef,attr"` // 特防(可选)
|
|
|
|
|
|
Spd *int `xml:"Spd,attr"` // 速度(可选)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 默认登录场景容器:对应 <DefaultMaps>
|
|
|
|
|
|
type DefaultMaps struct {
|
|
|
|
|
|
DefaultMaps []DefaultMap `xml:"DefaultMap"` // 多个默认场景
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 默认登录场景:对应 <DefaultMap>
|
|
|
|
|
|
type DefaultMap struct {
|
|
|
|
|
|
ID int `xml:"ID,attr"` // 场景ID
|
|
|
|
|
|
RandMaps string `xml:"RandMaps,attr"` // 随机场景列表(逗号分隔)
|
|
|
|
|
|
Desc string `xml:"Desc,attr"` // 场景描述
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 版本信息容器:对应 <VersionNumber>
|
|
|
|
|
|
type VersionNumber struct {
|
|
|
|
|
|
Version Version `xml:"Version"` // 版本详情
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 版本详情:对应 <Version>
|
|
|
|
|
|
type Version struct {
|
|
|
|
|
|
ID string `xml:"ID,attr"` // 版本号(如"20190614")
|
|
|
|
|
|
Desc string `xml:"Desc,attr"` // 版本描述
|
|
|
|
|
|
}
|