This commit is contained in:
aozhiwei 2024-06-21 13:31:04 +08:00
parent b0cd82dd97
commit 9bc2e93721
2 changed files with 34355 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ package mt
import ( import (
"q5" "q5"
"f5" "f5"
"os"
"mtb" "mtb"
"jccommon" "jccommon"
"strings" "strings"
@ -29,7 +30,7 @@ func (this *ItemTable) Load() {
func (this *ItemTable) PostInit1() { func (this *ItemTable) PostInit1() {
items := []*struct { items := []*struct {
Id int32 `json:"id"` Id int32 `json:"id"`
Name int32 `json:"name"` Name string `json:"name"`
Type int32 `json:"type"` Type int32 `json:"type"`
SubType int32 `json:"sub_type"` SubType int32 `json:"sub_type"`
}{} }{}
@ -37,11 +38,17 @@ func (this *ItemTable) PostInit1() {
func (ele *Item) bool { func (ele *Item) bool {
if ele.GetType() == jccommon.ITEM_TYPE_HERO || if ele.GetType() == jccommon.ITEM_TYPE_HERO ||
ele.GetType() == jccommon.ITEM_TYPE_GOLD_BULLION { ele.GetType() == jccommon.ITEM_TYPE_GOLD_BULLION {
p := q5.NewSliceElement(&items) p := *q5.NewSliceElement(&items)
p.Id = ele.GetId() p.Id = ele.GetId()
p.Name = ele.GetName()
p.Type = ele.GetType()
p.SubType = ele.GetSubType()
} }
return true return true
}) })
data := q5.EncodeJson(&items)
if err := os.WriteFile("item.json", []byte(data), 0644); err == nil {
}
} }
func (this *ItemTable) Search(name string, itemIds map[int32]int32) { func (this *ItemTable) Search(name string, itemIds map[int32]int32) {