From ef2442178abe76a01eb18dd715b935a931751650 Mon Sep 17 00:00:00 2001 From: Dev Date: Mon, 8 Apr 2024 12:31:51 +0100 Subject: [PATCH] Implement weights for food/drink on bots --- .../bots/types/arenafighterevent.json | 16 +++ .../assets/database/bots/types/assault.json | 16 +++ project/assets/database/bots/types/bear.json | 20 +++- .../assets/database/bots/types/bossboar.json | 16 +++ .../database/bots/types/bossboarsniper.json | 16 +++ .../assets/database/bots/types/bossbully.json | 16 +++ .../database/bots/types/bossgluhar.json | 16 +++ .../assets/database/bots/types/bosskilla.json | 16 +++ .../database/bots/types/bossknight.json | 16 +++ .../database/bots/types/bosskojaniy.json | 16 +++ .../database/bots/types/bosskolontay.json | 16 +++ .../database/bots/types/bosssanitar.json | 16 +++ .../database/bots/types/bosstagilla.json | 16 +++ .../assets/database/bots/types/bosstest.json | 16 +++ .../database/bots/types/bosszryachiy.json | 16 +++ .../bots/types/crazyassaultevent.json | 16 +++ .../database/bots/types/cursedassault.json | 16 +++ .../assets/database/bots/types/exusec.json | 16 +++ .../database/bots/types/followerbigpipe.json | 16 +++ .../database/bots/types/followerbirdeye.json | 16 +++ .../database/bots/types/followerboar.json | 16 +++ .../bots/types/followerboarclose1.json | 16 +++ .../bots/types/followerboarclose2.json | 16 +++ .../database/bots/types/followerbully.json | 16 +++ .../bots/types/followergluharassault.json | 16 +++ .../bots/types/followergluharscout.json | 16 +++ .../bots/types/followergluharsecurity.json | 16 +++ .../database/bots/types/followerkojaniy.json | 16 +++ .../bots/types/followerkolontayassault.json | 16 +++ .../bots/types/followerkolontaysecurity.json | 16 +++ .../database/bots/types/followersanitar.json | 16 +++ .../database/bots/types/followerzryachiy.json | 16 +++ .../assets/database/bots/types/gifter.json | 16 +++ .../assets/database/bots/types/marksman.json | 22 +++- .../bots/types/peacefullzryachiyevent.json | 105 +++++++++++++++--- .../assets/database/bots/types/pmcbot.json | 16 +++ .../bots/types/ravangezryachiyevent.json | 16 +++ .../database/bots/types/sectantpriest.json | 16 +++ .../database/bots/types/sectantwarrior.json | 16 +++ .../database/bots/types/shooterbtr.json | 16 +++ project/assets/database/bots/types/test.json | 16 +++ project/assets/database/bots/types/usec.json | 20 +++- project/src/generators/BotLootGenerator.ts | 28 +++++ project/src/generators/PMCLootGenerator.ts | 2 +- .../src/models/eft/common/tables/IBotType.ts | 2 + project/src/models/spt/bots/IBotLootCache.ts | 6 +- project/src/services/BotLootCacheService.ts | 72 +++++++++++- 47 files changed, 856 insertions(+), 29 deletions(-) diff --git a/project/assets/database/bots/types/arenafighterevent.json b/project/assets/database/bots/types/arenafighterevent.json index 93f77a42..2feae98d 100644 --- a/project/assets/database/bots/types/arenafighterevent.json +++ b/project/assets/database/bots/types/arenafighterevent.json @@ -2110,6 +2110,22 @@ "2": 0 }, "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { "weights": { diff --git a/project/assets/database/bots/types/assault.json b/project/assets/database/bots/types/assault.json index 4a036cd9..7d42a23f 100644 --- a/project/assets/database/bots/types/assault.json +++ b/project/assets/database/bots/types/assault.json @@ -2343,6 +2343,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 30, @@ -2351,6 +2359,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 8, diff --git a/project/assets/database/bots/types/bear.json b/project/assets/database/bots/types/bear.json index c3707080..719a337e 100644 --- a/project/assets/database/bots/types/bear.json +++ b/project/assets/database/bots/types/bear.json @@ -2508,11 +2508,27 @@ "2": 1 }, "whitelist": [] + }, + "food": { + "weights": { + "0": 6, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 6, + "1": 5, + "2": 1 + }, + "whitelist": [] }, "grenades": { "weights": { - "0": 1, - "1": 4, + "0": 2, + "1": 6, "2": 5, "3": 2, "4": 1 diff --git a/project/assets/database/bots/types/bossboar.json b/project/assets/database/bots/types/bossboar.json index 0c193649..9e9275a2 100644 --- a/project/assets/database/bots/types/bossboar.json +++ b/project/assets/database/bots/types/bossboar.json @@ -2302,6 +2302,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2310,6 +2318,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bossboarsniper.json b/project/assets/database/bots/types/bossboarsniper.json index 2edd63cb..f68d230d 100644 --- a/project/assets/database/bots/types/bossboarsniper.json +++ b/project/assets/database/bots/types/bossboarsniper.json @@ -2038,6 +2038,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2046,6 +2054,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bossbully.json b/project/assets/database/bots/types/bossbully.json index 83ebfb9d..ef295a8b 100644 --- a/project/assets/database/bots/types/bossbully.json +++ b/project/assets/database/bots/types/bossbully.json @@ -2029,6 +2029,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2036,6 +2044,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bossgluhar.json b/project/assets/database/bots/types/bossgluhar.json index 9ea7ff2d..d272f56b 100644 --- a/project/assets/database/bots/types/bossgluhar.json +++ b/project/assets/database/bots/types/bossgluhar.json @@ -2317,6 +2317,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2324,6 +2332,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosskilla.json b/project/assets/database/bots/types/bosskilla.json index 75d0547e..bc2eed39 100644 --- a/project/assets/database/bots/types/bosskilla.json +++ b/project/assets/database/bots/types/bosskilla.json @@ -2019,6 +2019,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2026,6 +2034,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bossknight.json b/project/assets/database/bots/types/bossknight.json index 764cc833..94da417b 100644 --- a/project/assets/database/bots/types/bossknight.json +++ b/project/assets/database/bots/types/bossknight.json @@ -2167,6 +2167,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2175,6 +2183,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosskojaniy.json b/project/assets/database/bots/types/bosskojaniy.json index 80888a6b..507f96e9 100644 --- a/project/assets/database/bots/types/bosskojaniy.json +++ b/project/assets/database/bots/types/bosskojaniy.json @@ -2070,6 +2070,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2078,6 +2086,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosskolontay.json b/project/assets/database/bots/types/bosskolontay.json index c2da4729..bc63f661 100644 --- a/project/assets/database/bots/types/bosskolontay.json +++ b/project/assets/database/bots/types/bosskolontay.json @@ -2322,6 +2322,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2330,6 +2338,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosssanitar.json b/project/assets/database/bots/types/bosssanitar.json index 46b5e082..aef86e92 100644 --- a/project/assets/database/bots/types/bosssanitar.json +++ b/project/assets/database/bots/types/bosssanitar.json @@ -2114,6 +2114,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2122,6 +2130,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosstagilla.json b/project/assets/database/bots/types/bosstagilla.json index 0ec8b5cf..29aff717 100644 --- a/project/assets/database/bots/types/bosstagilla.json +++ b/project/assets/database/bots/types/bosstagilla.json @@ -2113,6 +2113,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2121,6 +2129,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/bosstest.json b/project/assets/database/bots/types/bosstest.json index e065fa11..42e2e553 100644 --- a/project/assets/database/bots/types/bosstest.json +++ b/project/assets/database/bots/types/bosstest.json @@ -1946,6 +1946,22 @@ "healing": { "max": 2, "min": 1 + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "looseLoot": { "max": 3, diff --git a/project/assets/database/bots/types/bosszryachiy.json b/project/assets/database/bots/types/bosszryachiy.json index 36df4eb2..9726cbd5 100644 --- a/project/assets/database/bots/types/bosszryachiy.json +++ b/project/assets/database/bots/types/bosszryachiy.json @@ -2024,6 +2024,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2032,6 +2040,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/crazyassaultevent.json b/project/assets/database/bots/types/crazyassaultevent.json index a83d5f67..760544df 100644 --- a/project/assets/database/bots/types/crazyassaultevent.json +++ b/project/assets/database/bots/types/crazyassaultevent.json @@ -2365,6 +2365,22 @@ "2": 0 }, "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { "weights": { diff --git a/project/assets/database/bots/types/cursedassault.json b/project/assets/database/bots/types/cursedassault.json index a8bbbba4..c747193a 100644 --- a/project/assets/database/bots/types/cursedassault.json +++ b/project/assets/database/bots/types/cursedassault.json @@ -2391,6 +2391,22 @@ "2": 0 }, "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { "weights": { diff --git a/project/assets/database/bots/types/exusec.json b/project/assets/database/bots/types/exusec.json index c2c3d2a1..74d5ac3a 100644 --- a/project/assets/database/bots/types/exusec.json +++ b/project/assets/database/bots/types/exusec.json @@ -2254,6 +2254,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2261,6 +2269,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerbigpipe.json b/project/assets/database/bots/types/followerbigpipe.json index e71353f4..8f3a4ad0 100644 --- a/project/assets/database/bots/types/followerbigpipe.json +++ b/project/assets/database/bots/types/followerbigpipe.json @@ -2053,6 +2053,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2061,6 +2069,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerbirdeye.json b/project/assets/database/bots/types/followerbirdeye.json index e8c3893a..193ed57b 100644 --- a/project/assets/database/bots/types/followerbirdeye.json +++ b/project/assets/database/bots/types/followerbirdeye.json @@ -2085,6 +2085,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2093,6 +2101,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerboar.json b/project/assets/database/bots/types/followerboar.json index f0901c0a..0052c387 100644 --- a/project/assets/database/bots/types/followerboar.json +++ b/project/assets/database/bots/types/followerboar.json @@ -2253,6 +2253,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 9, @@ -2263,6 +2271,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerboarclose1.json b/project/assets/database/bots/types/followerboarclose1.json index e63103ff..823228c1 100644 --- a/project/assets/database/bots/types/followerboarclose1.json +++ b/project/assets/database/bots/types/followerboarclose1.json @@ -2173,6 +2173,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2181,6 +2189,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerboarclose2.json b/project/assets/database/bots/types/followerboarclose2.json index 9584a752..197acfb2 100644 --- a/project/assets/database/bots/types/followerboarclose2.json +++ b/project/assets/database/bots/types/followerboarclose2.json @@ -2173,6 +2173,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2181,6 +2189,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerbully.json b/project/assets/database/bots/types/followerbully.json index ba12478a..1f0549c9 100644 --- a/project/assets/database/bots/types/followerbully.json +++ b/project/assets/database/bots/types/followerbully.json @@ -2044,6 +2044,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2052,6 +2060,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followergluharassault.json b/project/assets/database/bots/types/followergluharassault.json index c8442a6c..7db40c2d 100644 --- a/project/assets/database/bots/types/followergluharassault.json +++ b/project/assets/database/bots/types/followergluharassault.json @@ -2212,6 +2212,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2220,6 +2228,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followergluharscout.json b/project/assets/database/bots/types/followergluharscout.json index d83921e3..4b0eba82 100644 --- a/project/assets/database/bots/types/followergluharscout.json +++ b/project/assets/database/bots/types/followergluharscout.json @@ -2214,6 +2214,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2222,6 +2230,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followergluharsecurity.json b/project/assets/database/bots/types/followergluharsecurity.json index a17e285f..9d5d212e 100644 --- a/project/assets/database/bots/types/followergluharsecurity.json +++ b/project/assets/database/bots/types/followergluharsecurity.json @@ -2217,6 +2217,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2225,6 +2233,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerkojaniy.json b/project/assets/database/bots/types/followerkojaniy.json index 4100dc55..cced9139 100644 --- a/project/assets/database/bots/types/followerkojaniy.json +++ b/project/assets/database/bots/types/followerkojaniy.json @@ -2099,6 +2099,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2107,6 +2115,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerkolontayassault.json b/project/assets/database/bots/types/followerkolontayassault.json index f9e57771..199ae92e 100644 --- a/project/assets/database/bots/types/followerkolontayassault.json +++ b/project/assets/database/bots/types/followerkolontayassault.json @@ -2232,6 +2232,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2240,6 +2248,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followerkolontaysecurity.json b/project/assets/database/bots/types/followerkolontaysecurity.json index 5eeecb7e..7233ecaa 100644 --- a/project/assets/database/bots/types/followerkolontaysecurity.json +++ b/project/assets/database/bots/types/followerkolontaysecurity.json @@ -2245,6 +2245,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2253,6 +2261,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/followersanitar.json b/project/assets/database/bots/types/followersanitar.json index 25e684f6..ee087bb3 100644 --- a/project/assets/database/bots/types/followersanitar.json +++ b/project/assets/database/bots/types/followersanitar.json @@ -2144,6 +2144,22 @@ "2": 0 }, "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { "weights": { diff --git a/project/assets/database/bots/types/followerzryachiy.json b/project/assets/database/bots/types/followerzryachiy.json index 89c58121..3782be29 100644 --- a/project/assets/database/bots/types/followerzryachiy.json +++ b/project/assets/database/bots/types/followerzryachiy.json @@ -2003,6 +2003,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2011,6 +2019,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/gifter.json b/project/assets/database/bots/types/gifter.json index 44f245c1..471652f3 100644 --- a/project/assets/database/bots/types/gifter.json +++ b/project/assets/database/bots/types/gifter.json @@ -2064,6 +2064,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2072,6 +2080,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/marksman.json b/project/assets/database/bots/types/marksman.json index 95e95344..0fc1004f 100644 --- a/project/assets/database/bots/types/marksman.json +++ b/project/assets/database/bots/types/marksman.json @@ -2298,6 +2298,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2306,6 +2314,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, @@ -2337,10 +2353,10 @@ }, "pocketLoot": { "weights": { - "0": 3, - "1": 10, + "0": 10, + "1": 35, "2": 3, - "3": 1, + "3": 2, "4": 1 }, "whitelist": [] diff --git a/project/assets/database/bots/types/peacefullzryachiyevent.json b/project/assets/database/bots/types/peacefullzryachiyevent.json index ce87db85..e931986c 100644 --- a/project/assets/database/bots/types/peacefullzryachiyevent.json +++ b/project/assets/database/bots/types/peacefullzryachiyevent.json @@ -2004,33 +2004,108 @@ ], "generation": { "items": { + "backpackLoot": { + "weights": { + "0": 1, + "1": 1, + "2": 2, + "3": 1, + "4": 1, + "5": 1, + "6": 1, + "7": 0 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { - "max": 1, - "min": 0 + "weights": { + "0": 1, + "1": 2, + "2": 0 + }, + "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { - "max": 5, - "min": 0 + "weights": { + "0": 1, + "1": 2, + "2": 1, + "3": 1, + "4": 0, + "5": 0 + }, + "whitelist": [] }, "healing": { - "max": 2, - "min": 1 + "weights": { + "0": 1, + "1": 2, + "2": 1 }, - "looseLoot": { - "max": 3, - "min": 0 + "whitelist": [] }, "magazines": { - "max": 4, - "min": 2 + "weights": { + "0": 0, + "1": 0, + "2": 1, + "3": 3, + "4": 1 + }, + "whitelist": [] + }, + "pocketLoot": { + "weights": { + "0": 1, + "1": 6, + "2": 3, + "3": 1, + "4": 1 + }, + "whitelist": [] }, "specialItems": { - "max": 0, - "min": 0 + "weights": { + "0": 1, + "1": 0 + }, + "whitelist": [] }, "stims": { - "max": 1, - "min": 0 + "weights": { + "0": 2, + "1": 1, + "2": 0 + }, + "whitelist": [] + }, + "vestLoot": { + "weights": { + "0": 1, + "1": 1, + "2": 2, + "3": 1, + "4": 0, + "5": 0, + "6": 0 + }, + "whitelist": [] } } }, diff --git a/project/assets/database/bots/types/pmcbot.json b/project/assets/database/bots/types/pmcbot.json index c3f83657..6306a51c 100644 --- a/project/assets/database/bots/types/pmcbot.json +++ b/project/assets/database/bots/types/pmcbot.json @@ -2119,6 +2119,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2127,6 +2135,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/ravangezryachiyevent.json b/project/assets/database/bots/types/ravangezryachiyevent.json index 30c8c85f..8e92b5b8 100644 --- a/project/assets/database/bots/types/ravangezryachiyevent.json +++ b/project/assets/database/bots/types/ravangezryachiyevent.json @@ -2085,6 +2085,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2093,6 +2101,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/sectantpriest.json b/project/assets/database/bots/types/sectantpriest.json index f89ec5cb..8bf5f722 100644 --- a/project/assets/database/bots/types/sectantpriest.json +++ b/project/assets/database/bots/types/sectantpriest.json @@ -2101,6 +2101,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2109,6 +2117,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/sectantwarrior.json b/project/assets/database/bots/types/sectantwarrior.json index ea59e008..9b520b83 100644 --- a/project/assets/database/bots/types/sectantwarrior.json +++ b/project/assets/database/bots/types/sectantwarrior.json @@ -2112,6 +2112,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2120,6 +2128,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/shooterbtr.json b/project/assets/database/bots/types/shooterbtr.json index dcf0f809..ee6adc72 100644 --- a/project/assets/database/bots/types/shooterbtr.json +++ b/project/assets/database/bots/types/shooterbtr.json @@ -2146,6 +2146,14 @@ }, "whitelist": [] }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "drugs": { "weights": { "0": 1, @@ -2154,6 +2162,14 @@ }, "whitelist": [] }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, "grenades": { "weights": { "0": 1, diff --git a/project/assets/database/bots/types/test.json b/project/assets/database/bots/types/test.json index e065fa11..a6756872 100644 --- a/project/assets/database/bots/types/test.json +++ b/project/assets/database/bots/types/test.json @@ -1938,6 +1938,22 @@ "drugs": { "max": 1, "min": 0 + }, + "drink": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "food": { + "weights": { + "0": 10, + "1": 5, + "2": 2 + }, + "whitelist": [] }, "grenades": { "max": 5, diff --git a/project/assets/database/bots/types/usec.json b/project/assets/database/bots/types/usec.json index f896fc54..1c0ee442 100644 --- a/project/assets/database/bots/types/usec.json +++ b/project/assets/database/bots/types/usec.json @@ -2505,11 +2505,27 @@ "2": 1 }, "whitelist": [] + }, + "food": { + "weights": { + "0": 6, + "1": 5, + "2": 2 + }, + "whitelist": [] + }, + "drink": { + "weights": { + "0": 6, + "1": 5, + "2": 1 + }, + "whitelist": [] }, "grenades": { "weights": { - "0": 1, - "1": 4, + "0": 2, + "1": 6, "2": 5, "3": 2, "4": 1 diff --git a/project/src/generators/BotLootGenerator.ts b/project/src/generators/BotLootGenerator.ts index e1c88ad9..f27229bf 100644 --- a/project/src/generators/BotLootGenerator.ts +++ b/project/src/generators/BotLootGenerator.ts @@ -98,6 +98,10 @@ export class BotLootGenerator ); const healingItemCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.healing.weights)); const drugItemCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.drugs.weights)); + + const foodItemCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.food.weights)); + const drinkItemCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.drink.weights)); + const stimItemCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.stims.weights)); const grenadeCount = Number(this.weightedRandomHelper.getWeightedValue(itemCounts.grenades.weights)); @@ -145,6 +149,30 @@ export class BotLootGenerator isPmc, ); + // Food + this.addLootFromPool( + this.botLootCacheService.getLootFromCache(botRole, isPmc, LootCacheType.FOOD_ITEMS, botJsonTemplate), + containersBotHasAvailable, + foodItemCount, + botInventory, + botRole, + null, + 0, + isPmc, + ); + + // Drink + this.addLootFromPool( + this.botLootCacheService.getLootFromCache(botRole, isPmc, LootCacheType.DRINK_ITEMS, botJsonTemplate), + containersBotHasAvailable, + drinkItemCount, + botInventory, + botRole, + null, + 0, + isPmc, + ); + // Stims this.addLootFromPool( this.botLootCacheService.getLootFromCache(botRole, isPmc, LootCacheType.STIM_ITEMS, botJsonTemplate), diff --git a/project/src/generators/PMCLootGenerator.ts b/project/src/generators/PMCLootGenerator.ts index ff7d4f93..f7abc809 100644 --- a/project/src/generators/PMCLootGenerator.ts +++ b/project/src/generators/PMCLootGenerator.ts @@ -192,7 +192,7 @@ export class PMCLootGenerator for (const itemToAdd of itemsToAdd) { - // If pmc has override, use that. Otherwise use flea price + // If pmc has price override, use that. Otherwise use flea price if (pmcPriceOverrides[itemToAdd._id]) { this.backpackLootPool[itemToAdd._id] = pmcPriceOverrides[itemToAdd._id]; diff --git a/project/src/models/eft/common/tables/IBotType.ts b/project/src/models/eft/common/tables/IBotType.ts index 0ca331da..1f168525 100644 --- a/project/src/models/eft/common/tables/IBotType.ts +++ b/project/src/models/eft/common/tables/IBotType.ts @@ -130,6 +130,8 @@ export interface GenerationWeightingItems grenades: GenerationData; healing: GenerationData; drugs: GenerationData; + food: GenerationData; + drink: GenerationData; stims: GenerationData; backpackLoot: GenerationData; pocketLoot: GenerationData; diff --git a/project/src/models/spt/bots/IBotLootCache.ts b/project/src/models/spt/bots/IBotLootCache.ts index c2683770..3dc5e192 100644 --- a/project/src/models/spt/bots/IBotLootCache.ts +++ b/project/src/models/spt/bots/IBotLootCache.ts @@ -1,5 +1,3 @@ -import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; - export interface IBotLootCache { backpackLoot: Record; @@ -11,6 +9,8 @@ export interface IBotLootCache specialItems: Record; healingItems: Record; drugItems: Record; + foodItems: Record; + drinkItems: Record; stimItems: Record; grenadeItems: Record; } @@ -27,4 +27,6 @@ export enum LootCacheType DRUG_ITEMS = "DrugItems", STIM_ITEMS = "StimItems", GRENADE_ITEMS = "GrenadeItems", + FOOD_ITEMS = "FoodItems", + DRINK_ITEMS = "DrinkItems", } diff --git a/project/src/services/BotLootCacheService.ts b/project/src/services/BotLootCacheService.ts index e5904d4c..252846e8 100644 --- a/project/src/services/BotLootCacheService.ts +++ b/project/src/services/BotLootCacheService.ts @@ -89,6 +89,12 @@ export class BotLootCacheService case LootCacheType.DRUG_ITEMS: result = this.lootCache[botRole].drugItems; break; + case LootCacheType.FOOD_ITEMS: + result = this.lootCache[botRole].foodItems; + break; + case LootCacheType.DRINK_ITEMS: + result = this.lootCache[botRole].drinkItems; + break; case LootCacheType.STIM_ITEMS: result = this.lootCache[botRole].stimItems; break; @@ -219,7 +225,7 @@ export class BotLootCacheService ? botJsonTemplate.generation.items.drugs.whitelist : {}; - // no whitelist, find and assign from combined item pool + // no drugs whitelist, find and assign from combined item pool if (Object.keys(drugItems).length === 0) { for (const [tpl, weight] of Object.entries(combinedLootPool)) @@ -232,6 +238,44 @@ export class BotLootCacheService } } + // Assign whitelisted food to bot if any exist + const foodItems: Record = + (Object.keys(botJsonTemplate.generation.items.food.whitelist)?.length > 0) + ? botJsonTemplate.generation.items.food.whitelist + : {}; + + // No food whitelist, find and assign from combined item pool + if (Object.keys(foodItems).length === 0) + { + for (const [tpl, weight] of Object.entries(combinedLootPool)) + { + const itemTemplate = this.itemHelper.getItem(tpl)[1]; + if (this.itemHelper.isOfBaseclass(itemTemplate._id, BaseClasses.FOOD)) + { + foodItems[tpl] = weight; + } + } + } + + // Assign whitelisted drink to bot if any exist + const drinkItems: Record = + (Object.keys(botJsonTemplate.generation.items.food.whitelist)?.length > 0) + ? botJsonTemplate.generation.items.food.whitelist + : {}; + + // No drink whitelist, find and assign from combined item pool + if (Object.keys(drinkItems).length === 0) + { + for (const [tpl, weight] of Object.entries(combinedLootPool)) + { + const itemTemplate = this.itemHelper.getItem(tpl)[1]; + if (this.itemHelper.isOfBaseclass(itemTemplate._id, BaseClasses.DRINK)) + { + drinkItems[tpl] = weight; + } + } + } + // Assign whitelisted stims to bot if any exist const stimItems: Record = (Object.keys(botJsonTemplate.generation.items.stims.whitelist)?.length > 0) @@ -270,7 +314,7 @@ export class BotLootCacheService } } - // Get backpack loot (excluding magazines, bullets, grenades and healing items) + // Get backpack loot (excluding magazines, bullets, grenades, drink, food and healing/stim items) const filteredBackpackItems = {}; for (const itemKey of Object.keys(backpackLootPool)) { @@ -285,6 +329,8 @@ export class BotLootCacheService || this.isMagazine(itemTemplate._props) || this.isMedicalItem(itemTemplate._props) || this.isGrenade(itemTemplate._props) + || this.isFood(itemTemplate._id) + || this.isDrink(itemTemplate._id) ) { // Is type we dont want as backpack loot, skip @@ -294,7 +340,7 @@ export class BotLootCacheService filteredBackpackItems[itemKey] = backpackLootPool[itemKey]; } - // Get pocket loot (excluding magazines, bullets, grenades, medical and healing items) + // Get pocket loot (excluding magazines, bullets, grenades, drink, food medical and healing/stim items) const filteredPocketItems = {}; for (const itemKey of Object.keys(pocketLootPool)) { @@ -309,6 +355,8 @@ export class BotLootCacheService || this.isMagazine(itemTemplate._props) || this.isMedicalItem(itemTemplate._props) || this.isGrenade(itemTemplate._props) + || this.isFood(itemTemplate._id) + || this.isDrink(itemTemplate._id) || !("Height" in itemTemplate._props) // lacks height || !("Width" in itemTemplate._props) // lacks width ) @@ -319,7 +367,7 @@ export class BotLootCacheService filteredPocketItems[itemKey] = pocketLootPool[itemKey]; } - // Get vest loot (excluding magazines, bullets, grenades, medical and healing items) + // Get vest loot (excluding magazines, bullets, grenades, medical and healing/stim items) const filteredVestItems = {}; for (const itemKey of Object.keys(vestLootPool)) { @@ -334,6 +382,8 @@ export class BotLootCacheService || this.isMagazine(itemTemplate._props) || this.isMedicalItem(itemTemplate._props) || this.isGrenade(itemTemplate._props) + || this.isFood(itemTemplate._id) + || this.isDrink(itemTemplate._id) ) { continue; @@ -344,6 +394,8 @@ export class BotLootCacheService this.lootCache[botRole].healingItems = healingItems; this.lootCache[botRole].drugItems = drugItems; + this.lootCache[botRole].foodItems = foodItems; + this.lootCache[botRole].drinkItems = drinkItems; this.lootCache[botRole].stimItems = stimItems; this.lootCache[botRole].grenadeItems = grenadeItems; @@ -429,6 +481,16 @@ export class BotLootCacheService return ("ThrowType" in props); } + protected isFood(tpl: string): boolean + { + return this.itemHelper.isOfBaseclass(tpl, BaseClasses.FOOD); + } + + protected isDrink(tpl: string): boolean + { + return this.itemHelper.isOfBaseclass(tpl, BaseClasses.DRINK); + } + /** * Check if a bot type exists inside the loot cache * @param botRole role to check for @@ -455,6 +517,8 @@ export class BotLootCacheService specialItems: {}, grenadeItems: {}, drugItems: {}, + foodItems: {}, + drinkItems: {}, healingItems: {}, stimItems: {}, };