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) {
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)
}
func botVaultRes(m *tb.Message) {
l := []int64{objSubTypeItemResource}
l := []int64{cacheObjSubType[`item_res`]}
botVault(m, l)
}
func botVaultAlch(m *tb.Message) {
l := []int64{objSubTypeItemAlch}
l := []int64{cacheObjSubType[`item_alch`]}
botVault(m, l)
}
func botVaultMisc(m *tb.Message) {
l := []int64{objSubTypeItemMisc}
l := []int64{cacheObjSubType[`item_misc`]}
botVault(m, l)
}
func botVaultRec(m *tb.Message) {
l := []int64{objSubTypeItemRecipe}
l := []int64{cacheObjSubType[`item_recipe`]}
botVault(m, l)
}
func botVaultPart(m *tb.Message) {
l := []int64{objSubTypeItemPart}
l := []int64{cacheObjSubType[`item_part`]}
botVault(m, l)
}
func botVaultOther(m *tb.Message) {
l := []int64{objSubTypeItemOther}
l := []int64{cacheObjSubType[`item_other`]}
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(`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...)
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...)
/*

12
def.go
View File

@ -592,12 +592,12 @@ const (
cacheObjSubType[`job_msg_del`] = 619
cacheObjSubType[`job_get_hammer_time`] = 620
*/
objSubTypeItemResource = 701
objSubTypeItemAlch = 702
objSubTypeItemMisc = 703
objSubTypeItemRecipe = 704
objSubTypeItemPart = 705
objSubTypeItemOther = 706
cacheObjSubType[`item_res`] = 701
cacheObjSubType[`item_alch`] = 702
cacheObjSubType[`item_misc`] = 703
cacheObjSubType[`item_recipe`] = 704
cacheObjSubType[`item_part`] = 705
cacheObjSubType[`item_other`] = 706
objSubTypeItemUnique = 707
objSubTypeCastle = 801
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 {
totalSize += item.Weight * v.Quantity
switch item.ItemTypeID {
case objSubTypeItemResource:
case cacheObjSubType[`item_res`]:
resSize += item.Weight * v.Quantity
resCount += v.Quantity
case objSubTypeItemAlch:
case cacheObjSubType[`item_alch`]:
alchSize += item.Weight * v.Quantity
alchCount += v.Quantity
case objSubTypeItemMisc:
case cacheObjSubType[`item_misc`]:
miscSize += item.Weight * v.Quantity
miscCount += v.Quantity
case objSubTypeItemRecipe:
case cacheObjSubType[`item_recipe`]:
recSize += item.Weight * v.Quantity
recCount += v.Quantity
case objSubTypeItemPart:
case cacheObjSubType[`item_part`]:
partSize += item.Weight * v.Quantity
partCount += v.Quantity
case objSubTypeItemOther:
case cacheObjSubType[`item_other`]:
otherSize += item.Weight * v.Quantity
otherCount += v.Quantity
}
@ -919,17 +919,17 @@ func jobGDeposit(j Job) {
logOnError(err, "jobGDeposit : getObjItem")
if err == nil {
switch obj.ItemTypeID {
case objSubTypeItemResource:
case cacheObjSubType[`item_res`]:
res = true
case objSubTypeItemAlch:
case cacheObjSubType[`item_alch`]:
alch = true
case objSubTypeItemMisc:
case cacheObjSubType[`item_misc`]:
misc = true
case objSubTypeItemRecipe:
case cacheObjSubType[`item_recipe`]:
craft = true
case objSubTypeItemPart:
case cacheObjSubType[`item_part`]:
craft = true
case objSubTypeItemOther:
case cacheObjSubType[`item_other`]:
equip = true
case objSubTypeItemUnique:
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_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(objSubTypeItemResource) + `, "item_res", "Resource", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemAlch) + `, "item_alch", "Alchemy", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemMisc) + `, "item_misc", "Miscelaneous", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemRecipe) + `, "item_recipe", "Recipe", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemPart) + `, "item_part", "Part", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeItemOther) + `, "item_other", "Other", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_res`]) + `, "item_res", "Resource", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_alch`]) + `, "item_alch", "Alchemy", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_misc`]) + `, "item_misc", "Miscelaneous", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_recipe`]) + `, "item_recipe", "Recipe", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_part`]) + `, "item_part", "Part", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(cacheObjSubType[`item_other`]) + `, "item_other", "Other", ` + strconv.Itoa(objTypeItem) + `)
,(` + strconv.Itoa(objSubTypeCastle) + `, "castle", "Castle", ` + strconv.Itoa(objTypeCastle) + `)
,(` + strconv.Itoa(objSubTypeUnion) + `, "union", "Union", ` + strconv.Itoa(objTypeUnion) + `)
,(` + strconv.Itoa(objSubTypeFair) + `, "fair", "Fair", ` + strconv.Itoa(objTypeFair) + `)