增加时间锁定、天气锁定属性判断

This commit is contained in:
unkown committed 2024-04-05 22:42:16 +08:00
1 parent 6af98227c7
commit fd937a7095
9 files changed
+54 -43

No files matched your search

+5 -10
View File
@@ -770,7 +770,7 @@ func (c *CommandManager) NewWeatherCommandController() *CommandController {
AliasList: []string{"weather"},
Description: "<color=#FFFFCC>{alias}</color> <color=#FFCC99>天气</color>",
UsageList: []string{
"{alias} [天气区域ID] <气象类型> 更改天气",
"{alias} <气象类型> 更改天气",
},
Perm: CommandPermNormal,
Func: c.WeatherCommand,
@@ -778,21 +778,16 @@ func (c *CommandManager) NewWeatherCommandController() *CommandController {
}
func (c *CommandManager) WeatherCommand(content *CommandContent) bool {
var weatherAreaId = content.AssignPlayer.WeatherInfo.WeatherAreaId // 天气区域id
var climateType uint32 // 气象类型
var climateType uint32 // 气象类型
return content.Option("uint32", func(param any) bool {
// 天气区域id
weatherAreaId = param.(uint32)
return true
}).Dynamic("uint32", func(param any) bool {
return content.Dynamic("uint32", func(param any) bool {
// 气象类型
climateType = param.(uint32)
return true
}).Execute(func() bool {
// 设置天气
c.gmCmd.GMSetWeather(content.AssignPlayer.PlayerId, weatherAreaId, climateType)
content.SendSuccMessage(content.Executor, "已更改天气,指定UID:%v,天气区域ID:%v,气象类型:%v。", content.AssignPlayer.PlayerId, weatherAreaId, climateType)
c.gmCmd.GMSetWeather(content.AssignPlayer.PlayerId, climateType)
content.SendSuccMessage(content.Executor, "已更改天气,指定UID:%v,气象类型:%v。", content.AssignPlayer.PlayerId, climateType)
return true
})
}