44 lines
1013 B
Go
44 lines
1013 B
Go
|
|
package robot
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"blazing/common/data/xmlres"
|
|||
|
|
"blazing/modules/config/service"
|
|||
|
|
"strings"
|
|||
|
|
|
|||
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|||
|
|
zero "github.com/wdvxdr1123/ZeroBot"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
func init() {
|
|||
|
|
zero.OnCommand("勇者").
|
|||
|
|
Handle(func(ctx *zero.Ctx) {
|
|||
|
|
msgs := strings.Fields(ctx.Event.Message.String())
|
|||
|
|
//eids := dict.NewDictInfoService().GetData("eid")
|
|||
|
|
|
|||
|
|
if len(msgs) > 1 {
|
|||
|
|
count := gconv.Uint32(msgs[1])
|
|||
|
|
if count != 0 {
|
|||
|
|
var cdks []string
|
|||
|
|
r := service.NewTower500Service().Boss(count) //获取第一个配置,因为塔只绑定一组boss,bossid也是0
|
|||
|
|
if len(r) > 0 {
|
|||
|
|
var buf strings.Builder
|
|||
|
|
for _, v := range service.NewBossService().Get(r[0].BossIds[0]) {
|
|||
|
|
buf.WriteString(xmlres.PetMAP[int(v.MonID)].DefName + "\n")
|
|||
|
|
|
|||
|
|
for _, effs := range service.NewEffectService().Args(v.Effect) {
|
|||
|
|
|
|||
|
|
buf.WriteString(effs.Desc + "\n")
|
|||
|
|
}
|
|||
|
|
cdks = append(cdks, buf.String())
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ctx.Send(strings.Join(cdks, "\n"))
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|