update last craftable items

This commit is contained in:
shoopea 2020-02-29 19:03:58 +08:00
parent 20812c9256
commit e8d020b475
3 changed files with 317 additions and 23 deletions

View File

@ -6752,7 +6752,25 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Vial of Nature" "Vial of Nature"
] ],
"craft": {
"cmd": "/brew_p10",
"mana": 10,
"items": [
{
"code": "07",
"quantity": 4
},
{
"code": "41",
"quantity": 1
},
{
"code": "47",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6763,7 +6781,29 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Potion of Nature" "Potion of Nature"
] ],
"craft": {
"cmd": "/brew_p11",
"mana": 15,
"items": [
{
"code": "07",
"quantity": 7
},
{
"code": "47",
"quantity": 3
},
{
"code": "21",
"quantity": 3
},
{
"code": "59",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6774,7 +6814,25 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Bottle of Nature" "Bottle of Nature"
] ],
"craft": {
"cmd": "/brew_p12",
"mana": 30,
"items": [
{
"code": "59",
"quantity": 3
},
{
"code": "24",
"quantity": 1
},
{
"code": "64",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6785,7 +6843,29 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Vial of Mana" "Vial of Mana"
] ],
"craft": {
"cmd": "/brew_p13",
"mana": 15,
"items": [
{
"code": "07",
"quantity": 3
},
{
"code": "51",
"quantity": 2
},
{
"code": "61",
"quantity": 1
},
{
"code": "41",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6796,7 +6876,33 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Potion of Mana" "Potion of Mana"
] ],
"craft": {
"cmd": "/brew_p14",
"mana": 30,
"items": [
{
"code": "41",
"quantity": 3
},
{
"code": "07",
"quantity": 3
},
{
"code": "62",
"quantity": 2
},
{
"code": "56",
"quantity": 2
},
{
"code": "65",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6807,7 +6913,33 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Bottle of Mana" "Bottle of Mana"
] ],
"craft": {
"cmd": "/brew_p15",
"mana": 50,
"items": [
{
"code": "51",
"quantity": 4
},
{
"code": "47",
"quantity": 2
},
{
"code": "61",
"quantity": 2
},
{
"code": "64",
"quantity": 1
},
{
"code": "67",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6818,7 +6950,29 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Vial of Twilight" "Vial of Twilight"
] ],
"craft": {
"cmd": "/brew_p16",
"mana": 15,
"items": [
{
"code": "10",
"quantity": 3
},
{
"code": "51",
"quantity": 2
},
{
"code": "39",
"quantity": 1
},
{
"code": "42",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6829,7 +6983,33 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Potion of Twilight" "Potion of Twilight"
] ],
"craft": {
"cmd": "/brew_p17",
"mana": 30,
"items": [
{
"code": "46",
"quantity": 3
},
{
"code": "50",
"quantity": 2
},
{
"code": "69",
"quantity": 1
},
{
"code": "64",
"quantity": 1
},
{
"code": "65",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6840,7 +7020,37 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Bottle of Twilight" "Bottle of Twilight"
] ],
"craft": {
"cmd": "/brew_p18",
"mana": 50,
"items": [
{
"code": "69",
"quantity": 3
},
{
"code": "39",
"quantity": 3
},
{
"code": "56",
"quantity": 3
},
{
"code": "68",
"quantity": 1
},
{
"code": "64",
"quantity": 1
},
{
"code": "43",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6851,7 +7061,33 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Vial of Morph" "Vial of Morph"
] ],
"craft": {
"cmd": "/brew_p19",
"mana": 15,
"items": [
{
"code": "07",
"quantity": 5
},
{
"code": "62",
"quantity": 1
},
{
"code": "63",
"quantity": 1
},
{
"code": "66",
"quantity": 1
},
{
"code": "48",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6862,7 +7098,37 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Potion of Morph" "Potion of Morph"
] ],
"craft": {
"cmd": "/brew_p20",
"mana": 30,
"items": [
{
"code": "56",
"quantity": 3
},
{
"code": "69",
"quantity": 2
},
{
"code": "62",
"quantity": 1
},
{
"code": "58",
"quantity": 1
},
{
"code": "59",
"quantity": 1
},
{
"code": "68",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",
@ -6873,7 +7139,45 @@
"craftable": true, "craftable": true,
"names": [ "names": [
"Bottle of Morph" "Bottle of Morph"
] ],
"craft": {
"cmd": "/brew_p21",
"mana": 50,
"items": [
{
"code": "69",
"quantity": 6
},
{
"code": "47",
"quantity": 3
},
{
"code": "40",
"quantity": 2
},
{
"code": "63",
"quantity": 1
},
{
"code": "60",
"quantity": 1
},
{
"code": "67",
"quantity": 1
},
{
"code": "59",
"quantity": 1
},
{
"code": "66",
"quantity": 1
}
]
}
}, },
{ {
"item_type": "item_misc", "item_type": "item_misc",

2
job.go
View File

@ -2094,7 +2094,7 @@ func jobAlchAll(j Job) {
// pre-fill maps with references and quantities // pre-fill maps with references and quantities
muxObjItem.RLock() muxObjItem.RLock()
for _, o := range objItems { for _, o := range objItems {
if (o.ItemTypeID == cacheObjSubType[`item_misc`] || o.ItemTypeID == cacheObjSubType[`item_misc`]) && o.Craftable && o.Craft != nil { if (o.ItemTypeID == cacheObjSubType[`item_misc`] || o.ItemTypeID == cacheObjSubType[`item_alch`]) && o.Craftable && o.Craft != nil {
rx := regexp.MustCompile(`\/brew.*`) rx := regexp.MustCompile(`\/brew.*`)
if rx.MatchString(o.Craft.Command) { if rx.MatchString(o.Craft.Command) {
maxManaItems[o.ObjID64] = p.ManaMax / o.Craft.Mana maxManaItems[o.ObjID64] = p.ManaMax / o.Craft.Mana

10
sql.go
View File

@ -459,16 +459,6 @@ func initDB() {
failOnError(err, "initDB : create table obj_job") failOnError(err, "initDB : create table obj_job")
log.Println("initDB : obj_job created ...") log.Println("initDB : obj_job created ...")
_, err = db.Exec(`CREATE TABLE obj_item_craft (
obj_id BIGINT UNSIGNED NOT NULL
,item_id BIGINT UNSIGNED NOT NULL
,quantity INT UNSIGNED NOT NULL
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
,FOREIGN KEY (item_id) REFERENCES obj(id) ON DELETE CASCADE
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_bin;`)
failOnError(err, "initDB : create table obj_item_craft")
log.Println("initDB : obj_item_craft created ...")
_, err = db.Exec(`CREATE TABLE obj_name ( _, err = db.Exec(`CREATE TABLE obj_name (
obj_id BIGINT UNSIGNED NOT NULL obj_id BIGINT UNSIGNED NOT NULL
,name VARCHAR(80) ,name VARCHAR(80)