This commit is contained in:
shoopea 2020-01-02 20:10:17 +08:00
parent 5aff9b0bd3
commit 09c5eaf3df
5 changed files with 667 additions and 667 deletions

18
bot.go
View File

@ -725,37 +725,37 @@ func botVaultHelp(m *tb.Message) {
} }
func botVaultAll(m *tb.Message) { func botVaultAll(m *tb.Message) {
l := []int64{objSubTypeItemResource, objSubTypeItemAlch, objSubTypeItemMisc, objSubTypeItemRecipe, objSubTypeItemPart, objSubTypeItemOther} l := []int64{cacheObjSubType[`item_res`], cacheObjSubType[`item_alch`], cacheObjSubType[`item_misc`], cacheObjSubType[`item_recipe`], cacheObjSubType[`item_part`], cacheObjSubType[`item_other`]}
botVault(m, l) botVault(m, l)
} }
func botVaultRes(m *tb.Message) { func botVaultRes(m *tb.Message) {
l := []int64{objSubTypeItemResource} l := []int64{cacheObjSubType[`item_res`]}
botVault(m, l) botVault(m, l)
} }
func botVaultAlch(m *tb.Message) { func botVaultAlch(m *tb.Message) {
l := []int64{objSubTypeItemAlch} l := []int64{cacheObjSubType[`item_alch`]}
botVault(m, l) botVault(m, l)
} }
func botVaultMisc(m *tb.Message) { func botVaultMisc(m *tb.Message) {
l := []int64{objSubTypeItemMisc} l := []int64{cacheObjSubType[`item_misc`]}
botVault(m, l) botVault(m, l)
} }
func botVaultRec(m *tb.Message) { func botVaultRec(m *tb.Message) {
l := []int64{objSubTypeItemRecipe} l := []int64{cacheObjSubType[`item_recipe`]}
botVault(m, l) botVault(m, l)
} }
func botVaultPart(m *tb.Message) { func botVaultPart(m *tb.Message) {
l := []int64{objSubTypeItemPart} l := []int64{cacheObjSubType[`item_part`]}
botVault(m, l) botVault(m, l)
} }
func botVaultOther(m *tb.Message) { func botVaultOther(m *tb.Message) {
l := []int64{objSubTypeItemOther} l := []int64{cacheObjSubType[`item_other`]}
botVault(m, l) botVault(m, l)
} }
@ -885,10 +885,10 @@ func botGDepositAll(m *tb.Message) {
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`34`, `Metallic Fiber`)) p.ResObjID64 = append(p.ResObjID64, getObjItemID(`34`, `Metallic Fiber`))
p.ResObjID64 = append(p.ResObjID64, getObjItemID(`35`, `Crafted Leather`)) p.ResObjID64 = append(p.ResObjID64, getObjItemID(`35`, `Crafted Leather`))
list := getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", objSubTypeItemRecipe)) list := getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", cacheObjSubType[`item_recipe`]))
p.ResObjID64 = append(p.ResObjID64, list...) p.ResObjID64 = append(p.ResObjID64, list...)
list = getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", objSubTypeItemPart)) list = getSQLListID64(fmt.Sprintf("select o.id from obj o where o.obj_sub_type_id = %d;", cacheObjSubType[`item_part`]))
p.ResObjID64 = append(p.ResObjID64, list...) p.ResObjID64 = append(p.ResObjID64, list...)
/* /*

12
def.go
View File

@ -592,12 +592,12 @@ const (
cacheObjSubType[`job_msg_del`] = 619 cacheObjSubType[`job_msg_del`] = 619
cacheObjSubType[`job_get_hammer_time`] = 620 cacheObjSubType[`job_get_hammer_time`] = 620
*/ */
objSubTypeItemResource = 701 cacheObjSubType[`item_res`] = 701
objSubTypeItemAlch = 702 cacheObjSubType[`item_alch`] = 702
objSubTypeItemMisc = 703 cacheObjSubType[`item_misc`] = 703
objSubTypeItemRecipe = 704 cacheObjSubType[`item_recipe`] = 704
objSubTypeItemPart = 705 cacheObjSubType[`item_part`] = 705
objSubTypeItemOther = 706 cacheObjSubType[`item_other`] = 706
objSubTypeItemUnique = 707 objSubTypeItemUnique = 707
objSubTypeCastle = 801 objSubTypeCastle = 801
objSubTypeFair = 901 objSubTypeFair = 901

1268
items.go

File diff suppressed because it is too large Load Diff

24
job.go
View File

@ -822,22 +822,22 @@ func jobGStock(j Job) {
if item.Weight != -1 { if item.Weight != -1 {
totalSize += item.Weight * v.Quantity totalSize += item.Weight * v.Quantity
switch item.ItemTypeID { switch item.ItemTypeID {
case objSubTypeItemResource: case cacheObjSubType[`item_res`]:
resSize += item.Weight * v.Quantity resSize += item.Weight * v.Quantity
resCount += v.Quantity resCount += v.Quantity
case objSubTypeItemAlch: case cacheObjSubType[`item_alch`]:
alchSize += item.Weight * v.Quantity alchSize += item.Weight * v.Quantity
alchCount += v.Quantity alchCount += v.Quantity
case objSubTypeItemMisc: case cacheObjSubType[`item_misc`]:
miscSize += item.Weight * v.Quantity miscSize += item.Weight * v.Quantity
miscCount += v.Quantity miscCount += v.Quantity
case objSubTypeItemRecipe: case cacheObjSubType[`item_recipe`]:
recSize += item.Weight * v.Quantity recSize += item.Weight * v.Quantity
recCount += v.Quantity recCount += v.Quantity
case objSubTypeItemPart: case cacheObjSubType[`item_part`]:
partSize += item.Weight * v.Quantity partSize += item.Weight * v.Quantity
partCount += v.Quantity partCount += v.Quantity
case objSubTypeItemOther: case cacheObjSubType[`item_other`]:
otherSize += item.Weight * v.Quantity otherSize += item.Weight * v.Quantity
otherCount += v.Quantity otherCount += v.Quantity
} }
@ -919,17 +919,17 @@ func jobGDeposit(j Job) {
logOnError(err, "jobGDeposit : getObjItem") logOnError(err, "jobGDeposit : getObjItem")
if err == nil { if err == nil {
switch obj.ItemTypeID { switch obj.ItemTypeID {
case objSubTypeItemResource: case cacheObjSubType[`item_res`]:
res = true res = true
case objSubTypeItemAlch: case cacheObjSubType[`item_alch`]:
alch = true alch = true
case objSubTypeItemMisc: case cacheObjSubType[`item_misc`]:
misc = true misc = true
case objSubTypeItemRecipe: case cacheObjSubType[`item_recipe`]:
craft = true craft = true
case objSubTypeItemPart: case cacheObjSubType[`item_part`]:
craft = true craft = true
case objSubTypeItemOther: case cacheObjSubType[`item_other`]:
equip = true equip = true
case objSubTypeItemUnique: case objSubTypeItemUnique:
equip = true equip = true

12
sql.go
View File

@ -579,12 +579,12 @@ func initDB() {
,(` + strconv.Itoa(cacheObjSubType[`job_set_def`]) + `, "job_set_def", "Set Defense job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(cacheObjSubType[`job_set_def`]) + `, "job_set_def", "Set Defense job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(cacheObjSubType[`job_msg_del`]) + `, "job_msg_del", "Msg Del job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(cacheObjSubType[`job_msg_del`]) + `, "job_msg_del", "Msg Del job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(cacheObjSubType[`job_get_hammer_time`]) + `, "job_get_hammer_time", "Get Hammer Time job", ` + strconv.Itoa(objTypeJob) + `) ,(` + strconv.Itoa(cacheObjSubType[`job_get_hammer_time`]) + `, "job_get_hammer_time", "Get Hammer Time job", ` + strconv.Itoa(objTypeJob) + `)
,(` + strconv.Itoa(objSubTypeItemResource) + `, "item_res", "Resource", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_res`]) + `, "item_res", "Resource", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemAlch) + `, "item_alch", "Alchemy", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_alch`]) + `, "item_alch", "Alchemy", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemMisc) + `, "item_misc", "Miscelaneous", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_misc`]) + `, "item_misc", "Miscelaneous", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemRecipe) + `, "item_recipe", "Recipe", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_recipe`]) + `, "item_recipe", "Recipe", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemPart) + `, "item_part", "Part", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_part`]) + `, "item_part", "Part", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemOther) + `, "item_other", "Other", ` + strconv.Itoa(objTypeItem) + `) ,(` + strconv.Itoa(cacheObjSubType[`item_other`]) + `, "item_other", "Other", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeCastle) + `, "castle", "Castle", ` + strconv.Itoa(objTypeCastle) + `) ,(` + strconv.Itoa(objSubTypeCastle) + `, "castle", "Castle", ` + strconv.Itoa(objTypeCastle) + `)
,(` + strconv.Itoa(objSubTypeUnion) + `, "union", "Union", ` + strconv.Itoa(objTypeUnion) + `) ,(` + strconv.Itoa(objSubTypeUnion) + `, "union", "Union", ` + strconv.Itoa(objTypeUnion) + `)
,(` + strconv.Itoa(objSubTypeFair) + `, "fair", "Fair", ` + strconv.Itoa(objTypeFair) + `) ,(` + strconv.Itoa(objSubTypeFair) + `, "fair", "Fair", ` + strconv.Itoa(objTypeFair) + `)