Compare commits

..

26 Commits
1.6.0 ... main

Author SHA1 Message Date
509cdff8b6 Fix marked room loot for AKI 3.5.1 2023-02-16 13:21:06 -05:00
30744551f0 Preliminary update for SPT-AKI 3.5.1 compatibility 2023-02-15 14:00:15 -05:00
23ab7efadf Fix chanceSameSideIsHostilePercent 2023-02-14 21:18:10 -05:00
c3866d0360 Finally, actually fixing the ConvertIntoPmcChance function. 2023-02-14 20:52:30 -05:00
a1f8fe37a1 Hotfixes for update to v1.8.3/ Compatible with AKI 3.5.0
* Bots.json
* Insurance.json
* Traders.json
2023-02-13 17:55:10 -05:00
cc58998345 Hotfixes for update to v1.8.3/ Compatible with AKI 3.5.0
* Bots.json
* Insurance.json
* Traders.json
2023-02-13 17:53:02 -05:00
90db74d535 Update package to v1.8.1 2023-02-13 03:03:57 -05:00
cce9f573ba Update to v1.8.1
* Fixed secure containers in marked room; removed the category and added the individual containers. All containers except Kappa are a probability of 3//Kappa is a probability of 1.
2023-02-13 03:03:26 -05:00
37d356736c Updates for v1.8.0 of Valens-AIO; compatible with SPT-AKI V3.5.0
* Added additional items to Airdrop Blacklist into the airdrop.json
* Added botGenerationBatchSizePerType and reworked maxBotCap to current defaults and to include Streets into bots.json
* Added botRelativeLevelDeltaMax into bots.json
* Added runIntervalSeconds into flea.json; affects how often flea will refresh in-game (so selling faster or slower - is taxing on CPU resources as it calls more often or less often pending how you set it; default is 45 seconds) into flea.json
* Reworked Ragfair Conditions to take current server values into flea.json
* Removed airFilterUnitFlowRate, generatorFuelFlowRate, and gpuBoostRate from hideout.json; these may return in the future however, as of now they have been removed from the server config and I would need to dive deep into server code.
* Consolidated timeLimit into its own boolean and raidTime settings. Restructured AiAmount and AiDifficulty to match the server config in raid.json
* Added new types into the bots.ts config file
* Added new types into the flea.ts config file
* Removed types no longer being used in the hideout.ts config file
* Added new types into the raid.ts config file
* Added Streets Marked Room Loot into the Containers In Marked Room Loot Pool
* General rework and cleanup of code
2023-02-13 01:07:28 -05:00
41c3dd6c83 Types update for 3.5.0 2023-02-12 23:21:14 -05:00
df9a522516 3.5.0 type updates 2023-01-15 00:21:22 -05:00
c145035717 Added coopExtracts 2023-01-14 12:22:28 -05:00
1fc77d6bdf Changes and additions for v1.7.1 2023-01-13 00:20:15 -05:00
7d9783d7b5 Trader config fixes and updates. Update locations to add lighthouse to all extractions available. 2023-01-08 03:55:21 -05:00
4f863a37b0 Bots changes 2023-01-08 03:28:14 -05:00
5ec21767c5 Update bots config to include more of the new additions. 2023-01-08 03:09:19 -05:00
74de872205 Changes to bring airdrop config in line with current airdrops. 2023-01-08 02:33:11 -05:00
a4d907a76b Update types to 3.5.0 2023-01-08 01:06:33 -05:00
2c7493853f Update V-AIO to v1.7.0 compatible with latest SPT-AKI v3.4.0 2022-12-25 19:38:44 -05:00
96301881d1 Upate types for 3.4.0 2022-12-25 18:45:37 -05:00
b9c77b1c13 Remove a 7z file lol 2022-09-11 21:49:37 -04:00
c85b851a38 Final changes for v1.6.1 2022-09-11 21:49:08 -04:00
efb5872836 Changes for SPT-Aki v3.2.3 compatibility, and updating Types. 2022-09-11 20:07:37 -04:00
280c1c6021 Typo correction. 2022-09-10 23:02:58 -04:00
e6765e8c5b Add Zeroing Default Ammo to each individual weapon and caliber. 2022-09-06 03:14:56 -04:00
8d67fcf901 Airdrops. >^) 2022-09-05 19:31:13 -04:00
321 changed files with 6523 additions and 1579 deletions

Binary file not shown.

118
config/airdrop.json Normal file
View File

@ -0,0 +1,118 @@
{
"airdropChancePercent":
{
"bigmap": 20,
"woods": 25,
"lighthouse": 20,
"shoreline": 20,
"interchange": 20,
"reserve": 10,
"tarkovStreets": 12
},
"airdropMinStartTimeSeconds": 60,
"airdropMaxStartTimeSeconds": 300,
"planeMinFlyHeight": 400,
"planeMaxFlyHeight": 500,
"planeVolume": 0.5,
"planeSpeed": 65,
"crateFallSpeed": 3,
"loot": {
"presetCount": {
"min": 3,
"max": 5
},
"itemCount": {
"min": 12,
"max": 25
},
"itemBlacklist": [
"5e997f0b86f7741ac73993e2",
"5b44abe986f774283e2e3512",
"5e99711486f7744bfc4af328",
"5e99735686f7744bfc4af32c",
"6087e570b998180e9f76dc24",
"5d52d479a4b936793d58c76b",
"5e85aac65505fa48730d8af2",
"63495c500c297e20065a08b1",
"5cde8864d7f00c0010373be1",
"5b3b713c5acfc4330140bd8d"
],
"itemTypeWhitelist": [
"543be5dd4bdc2deb348b4569",
"5485a8684bdc2da71d8b4567",
"5d650c3e815116009f6201d2",
"5448e8d64bdc2dce718b4568",
"5448e8d04bdc2ddf718b4569",
"5447e1d04bdc2dff2f8b4567",
"57864ee62459775490116fc1",
"5448e54d4bdc2dcc718b4568",
"5448e5284bdc2dcb718b4567",
"5448e53e4bdc2d60728b4567",
"5448f3a64bdc2d60728b456a",
"5448f3ac4bdc2dce718b4569",
"55818ad54bdc2ddc698b4569",
"55818af64bdc2d5b648b4570",
"55818b0e4bdc2dde698b456e",
"5448bc234bdc2d3c308b4569",
"57864ada245977548638de91",
"5645bcb74bdc2ded0b8b4578",
"5448e5724bdc2ddf718b4568",
"55818add4bdc2d5b648b456f",
"543be6564bdc2df4348b4568",
"57864bb7245977548b3b66c2",
"550aa4cd4bdc2dd8348b456c",
"5448f39d4bdc2d0a728b4568",
"5448f3a14bdc2d27728b4569",
"5447e1d04bdc2dff2f8b4567",
"55818b164bdc2ddc698b456c",
"55818ae44bdc2dde698b456c"
],
"itemLimits": {
"5447b5cf4bdc2d65278b4567": 1,
"5448e8d04bdc2ddf718b4569": 3,
"5448e8d64bdc2dce718b4568": 3,
"5448bc234bdc2d3c308b4569": 3,
"5448f3a64bdc2d60728b456a": 3,
"5448e54d4bdc2dcc718b4568": 3,
"5485a8684bdc2da71d8b4567": 4,
"57864bb7245977548b3b66c2": 2,
"57864ada245977548638de91": 3,
"5d650c3e815116009f6201d2": 2,
"5645bcb74bdc2ded0b8b4578": 2,
"5448e5724bdc2ddf718b4568": 2,
"55818add4bdc2d5b648b456f": 2,
"543be6564bdc2df4348b4568": 3,
"550aa4cd4bdc2dd8348b456c": 2,
"5448f39d4bdc2d0a728b4568": 4,
"5448f3a14bdc2d27728b4569": 2,
"5447e1d04bdc2dff2f8b4567": 1,
"55818ad54bdc2ddc698b4569": 3,
"55818b164bdc2ddc698b456c": 2,
"55818ae44bdc2dde698b456c": 2,
"5448e5284bdc2dcb718b4567": 2
},
"itemStackLimits": {
"5fc382a9d724d907e2077dab": {
"min": 5,
"max": 5
},
"59e690b686f7746c9f75e848": {
"min": 10,
"max": 25
},
"5449016a4bdc2d6f028b456f": {
"min": 5000,
"max": 50000
},
"569668774bdc2da2298b4568": {
"min": 100,
"max": 500
},
"5696686a4bdc2da3298b456a": {
"min": 100,
"max": 500
}
},
"armorLevelWhitelist": [0, 4, 5, 6]
}
}

View File

@ -25,5 +25,30 @@
"a20Gauge": 20,
"a30x29": 1,
"a26x75": 1
},
"zero":
{
"g127x55": "5cadf6ddae9215051e1c23b2",
"g86x70": "5fc275cf85fd526b824a571a",
"g762x54": "5887431f2459777e1612938f",
"g762x51": "58dd3ad986f77403051cba8f",
"g9x39": "57a0dfb82459774d3078b56c",
"g366TKM": "59e655cb86f77411dc52a77b",
"g762x39": "5656d7c34bdc2d9d198b4587",
"g762x35": "5fbe3ffdf8b6a877a729ea82",
"g556x45": "54527a984bdc2d4e668b4567",
"g545x39": "56dff3afd2720bba668b4567",
"g57x28": "5cc80f38e4a949001152b560",
"g46x30": "5ba2678ad4351e44f824b344",
"g9x33R": "62330b3ed4dc74626d570b95",
"g1143x23ACP": "5e81f423763d9f754677bf2e",
"g762x25": "5736026a245977644601dc61",
"g9x21": "5a269f97c4a282000b151807",
"g9x19": "56d59d3ad2720bdb418b4577",
"g9x18": "573719762459775a626ccbc1",
"g23x75": "5e85aa1a988a8701445df1f5",
"g12Gauge": "560d5e524bdc2d25448b4571",
"g20Gauge": "5a38ebd9c4a282000d722a5b"
}
}

View File

@ -1,15 +1,27 @@
{
"bossChance":
{
"activated": false,
"chance": 100
},
{
"activated": false,
"chance": 100
},
"maxBotCap": 20,
"botGenerationBatchSizePerType": 15,
"maxBotCap": {
"factory": 10,
"customs": 15,
"woods": 15,
"shoreline": 15,
"lighthouse": 15,
"reservebase": 15,
"interchange": 15,
"laboratory": 15,
"streets of tarkov": 18,
"default": 15
},
"pmc":
{
"chanceSameSideIsHostile": 50,
"chanceSameSideIsHostilePercent": 80,
"containersOnPMCs": true,
"isUsec": 50,
"lootNValue": 3,
@ -21,29 +33,32 @@
{
"assault":
{
"min": 15,
"max": 40
"min": 20,
"max": 30
},
"cursedAssault":
{
"min": 15,
"max": 40
},
"pmcBot":
"cursedassault":
{
"min": 15,
"max": 30
},
"exUsec":
"pmcbot":
{
"min": 15,
"max": 25
},
"exusec":
{
"min": 5,
"max": 20
"max": 5
}
},
"useDifficultyOverride": false,
"difficulty": "AsOnline",
"botRelativeLevelDeltaMax": 10,
"difficultyWeights":
{
"difficulty": "asonline",
"useWeights": false,
"weights":
{
@ -55,7 +70,7 @@
},
"looseWeaponInBackpackChance": 15,
"looseWeaponInBackpackLoot":
"looseWeaponInBackpackLootMinMax":
{
"min": 1,
"max": 1

View File

@ -1,5 +1,6 @@
{
"minUserLevel": 15,
"runIntervalSeconds": 45,
"blacklist":
{
@ -9,9 +10,48 @@
"condition":
{
"conditionChance": 0.2,
"min": 0.6,
"max": 1.0
"5422acb9af1c889c16000029": {
"_name": "WEAPON",
"conditionChance": 0.2,
"min": 0.6,
"max": 1
},
"543be5664bdc2dd4348b4569": {
"_name": "MEDS",
"conditionChance": 0.2,
"min": 0.6,
"max": 1
},
"5447e0e74bdc2d3c308b4567": {
"_name": "SPEC_ITEM",
"conditionChance": 0.3,
"min": 0.02,
"max": 1
},
"543be5e94bdc2df1348b4568": {
"_name": "KEY",
"conditionChance": 0.02,
"min": 0.97,
"max": 1
},
"5448e5284bdc2dcb718b4567": {
"_name": "VEST",
"conditionChance": 0.2,
"min": 0.05,
"max": 1
},
"57bef4c42459772e8d35a53b": {
"_name": "ARMORED_EQUIPMENT",
"conditionChance": 0.6,
"min": 0.05,
"max": 1
},
"543be6674bdc2df1348b4569": {
"_name": "FOOD_DRINK",
"conditionChance": 0.05,
"min": 0.05,
"max": 1
}
},
"currencies":

View File

@ -1,8 +1,5 @@
{
"airFilterUnitFlowRate": 0.0047222222222222,
"constructionTime": 1,
"generatorFuelFlowRate": 0.0013194444444444,
"gpuBoostRate": 0.015,
"productionTime": 1,
"scavCaseTime": 1
}

View File

@ -7,7 +7,7 @@
"maxHr": 36,
"storageMaxHr": 96,
"priceCoef": 0.16,
"returnChance": 80
"returnChance": 75
},
"therapist":

View File

@ -3,5 +3,6 @@
"freeLabsEntry": false,
"exfilTime": 8,
"extractionsExtended": false,
"enableCoopExtracts": false,
"noExtractRestrictions": false
}

View File

@ -3,9 +3,15 @@
"chompiesBossFix": true,
"fixOpenZones": true,
"scavExtractGain": 0.01,
"timeLimit": 60,
"aiAmount": "asonline",
"aiDifficulty": "asonline",
"timeLimit":
{
"enabled": false,
"raidTime": 60
},
"aiAmount": "AsOnline",
"aiDifficulty": "AsOnline",
"bossEnabled": true,
"scavWars": false,
"taggedAndCursed": false,

View File

@ -41,21 +41,76 @@
}]
},
"minDurabilityForSale": 60,
"updateTimeDefault": 3600,
"durabilityPurchaseThreshhold": {
"54cb50c76803fa8b248b4571": 60,
"54cb57776803fa99248b456e": 60,
"579dc571d53a0658a154fbec": 0,
"58330581ace78e27b8b10cee": 60,
"5935c25fb3acc3127c3d8cd9": 60,
"5a7c2eca46aef81a7ca2145d": 60,
"5ac3b934156ae10c4430e83c": 60,
"5c0647fdd443bc2504c2d371": 60,
"default": 60
},
"traderPriceMultipler": 1,
"fence":
{
"persistPurchaseDataInProfile": true,
"fence": {
"partialRefreshTimeSeconds": 240,
"partialRefreshChangePercent": 15,
"assortSize": 100,
"assortSize": 50,
"maxPresetsPercent": 5,
"presetPriceMult": 2.5,
"blacklist": ["5661632d4bdc2d903d8b456b",
"543be5e94bdc2df1348b4568",
"543be6674bdc2df1348b4569",
"5448bf274bdc2dfc2f8b456a",
"543be5664bdc2dd4348b4569",
"5447bedf4bdc2d87278b4568"]
}
"itemPriceMult": 0.8,
"presetPriceMult": 1.5,
"regenerateAssortsOnRefresh": false,
"itemTypeLimits": {
"550aa4bf4bdc2dd6348b456b": 3,
"55818add4bdc2d5b648b456f": 5,
"5448bc234bdc2d3c308b4569": 5,
"55818b224bdc2dde698b456f": 5,
"555ef6e44bdc2de9068b457e": 5,
"5a341c4086f77401f2541505": 5,
"55818ad54bdc2ddc698b4569": 5,
"5448e53e4bdc2d60728b4567": 5,
"55818ac54bdc2d5b648b456e": 5,
"55818af64bdc2d5b648b4570": 5,
"55818a304bdc2db5418b457d": 4,
"5a74651486f7744e73386dd1": 5,
"55818a594bdc2db9688b456a": 5,
"55818a104bdc2db9688b4569": 5,
"55818a684bdc2ddd698b456d": 3,
"550aa4cd4bdc2dd8348b456c": 3,
"55818acf4bdc2dde698b456b": 5,
"55818a6f4bdc2db9688b456b": 5,
"5447b5f14bdc2d61278b4567": 3,
"5447b5cf4bdc2d65278b4567": 5,
"5447b6094bdc2dc3278b4567": 5,
"5447b5e04bdc2d62278b4567": 5,
"55818b164bdc2ddc698b456c": 3,
"617f1ef5e8b54b0998387733": 2,
"5448ecbe4bdc2d60728b4568": 2,
"57864a66245977548f04a81f": 2,
"5a341c4686f77469e155819e": 3,
"57864a3d24597754843f8721": 2,
"5448e54d4bdc2dcc718b4568": 4,
"5448f39d4bdc2d0a728b4568": 5,
"5795f317245977243854e041": 3
},
"presetMaxDurabilityPercentMinMax":{
"min": 35,
"max": 60
},
"armorMaxDurabilityPercentMinMax":{
"min": 35,
"max": 60
},
"blacklist": [
"5661632d4bdc2d903d8b456b",
"543be5e94bdc2df1348b4568",
"543be6674bdc2df1348b4569",
"5448bf274bdc2dfc2f8b456a",
"5447bedf4bdc2d87278b4568",
"6275303a9f372d6ea97f9ec7"
]
}
}

192
config/ts/WeaponTypes.ts Normal file
View File

@ -0,0 +1,192 @@
export enum Weapons127x55
{
ASH_12 = "5cadfbf7ae92152ac412eeef"
}
export enum Weapons86x70
{
MK_18 = "5fc22d7c187fea44d52eda44",
AXMC = "627e14b21713922ded6f2c15"
}
export enum Weapons9x39
{
AS_VAL = "57c44b372459772d2b39b8ce",
VSS_VINTOREZ = "57838ad32459774a17445cd2"
}
export enum Weapons762x54R
{
SVDS = "5c46fbd72e2216398b5a8c9c",
MP_18 = "61f7c9e189e6fb1a5e3ea78d",
MOSIN_INFANTRY = "5bfd297f0db834001a669119",
MOSIN_SNIPER = "5ae08f0a5acfc408fb1398a1",
SV_98 = "55801eed4bdc2d89578b4588"
}
export enum Weapons762x51
{
VPO_101 = "5c501a4d2e221602b412b540",
DT_MDR_762 = "5dcbd56fdbd3d91b3e5468d5",
SA_58 = "5b0bbe4e5acfc40dc528a72d",
SCARH_BLACK = "6183afd850224f204c1da514",
SCARH_FDE = "6165ac306ef05c2ce828ef74",
HK_G28 = "6176aca650224f204c1da3fb",
M1A = "5aafa857e5b5b00018480968",
RFB = "5f2a9575926fd9352339381f",
RSASS = "5a367e5dc4a282000e49738f",
SR_25 = "5df8ce05b11454561e39243b",
DVL_10 = "588892092459774ac91d4b11",
M700 = "5bfea6e90db834001b7347f3",
T5000M = "5df24cf80dee1b22f862e9bc"
}
export enum Weapons366TKM
{
VPO_209 = "59e6687d86f77411d949b251",
VPO_215 = "5de652c31b7e3716273428be"
}
export enum Weapons762x39
{
OP_SKS = "587e02ff24597743df3deaeb",
SKS = "574d967124597745970e7c94",
AK_103 = "5ac66d2e5acfc43b321d4b53",
AK_104 = "5ac66d725acfc43b321d4b60",
AKM = "59d6088586f774275f37482f",
AKMN = "5a0ec13bfcdbcb00165aa685",
AKMS = "59ff346386f77477562ff5e2",
AKMSN = "5abcbc27d8ce8700182eceeb",
MK47_MUTANT = "606587252535c57a13424cfd",
RD_704 = "628a60ae6b1d481ff772e9c8",
VPO_136 = "59e6152586f77473dc057aa1"
}
export enum Weapons762x35
{
MCX = "5fbcc1d9016cce60e8341ab3"
}
export enum Weapons556x45
{
ADAR_2_15 = "5c07c60e0db834002330051f",
AK_101 = "5ac66cb05acfc40198510a10",
AK_102 = "5ac66d015acfc400180ae6e4",
DT_MDR_556 = "5c488a752e221602b412af63",
HK_416A5 = "5bb2475ed4351e00853264e3",
HK_G36 = "623063e994fc3f7b302a9696",
M4A1 = "5447a9cd4bdc2dbd208b4567",
SCARL_BLACK = "6184055050224f204c1da540",
SCARL_FDE = "618428466ef05c2ce828f218",
TX15_DML = "5d43021ca4b9362eab4b5e25"
}
export enum Weapons545x39
{
AK_105 = "5ac66d9b5acfc4001633997a",
AK_74 = "5bf3e03b0db834001d2c4a9c",
AK_74M = "5ac4cd105acfc40016339859",
AK_74N = "5644bd2b4bdc2d3b4c8b4572",
AKS_74 = "5bf3e0490db83400196199af",
AKS_74N = "5ab8e9fcd8ce870019439434",
AKS_74U = "57dc2fa62459775949412633",
AKS_74UB = "5839a40f24597726f856b511",
AKS_74UN = "583990e32459771419544dd2",
SAG_AK = "628b5638ad252a16da6dd245",
SAG_AK_SHORT = "628b9c37a733087d0d7fe84b",
RPK_16 = "5beed0f50db834001c062b12"
}
export enum Weapons57x28FN
{
FN_57_BLACK = "5d3eb3b0a4b93615055e84d2",
FN_57_FDE = "5d67abc1a4b93614ec50137f",
FN_P90 = "5cc82d76e24e8d00134b4b83"
}
export enum Weapons46x30HK
{
MP7A1 = "5ba26383d4351e00334c93d9",
MP7A2 = "5bd70322209c4d00d7167b8f"
}
export enum Weapons1143x23
{
M1911A1 = "5e81c3cbac2bb513793cdc75",
M45A1 = "5f36a0e5fbf956000b716b65",
USP45 = "6193a720f8ee7e52e42109ed",
UMP45 = "5fc3e272f8b6a877a729eac5",
VECTOR45 = "5fb64bc92b1b027b1f50bcf2"
}
export enum Weapons9x33R
{
CR_50DS = "61a4c8884f95bc3b2c5dc96f"
}
export enum Weapons9x21
{
SR_1MP = "59f98b4986f7746f546d2cef"
}
export enum Weapons9x19
{
GLOCK_17 = "5a7ae0c351dfba0017554310",
GLOCK_18C = "5b1fa9b25acfc40018633c01",
M9A3 = "5cadc190ae921500103bb3b6",
MP_443 = "576a581d2459771e7b1bc4f1",
P226R = "56d59856d2720bd8418b456a",
PL_15 = "602a9740da11d6478d5a06dc",
CR_200DS = "624c2e8614da335f1e034d8c",
MP5 = "5926bb2186f7744b1c6c6e60",
MP5K = "5d2f0d8048f0356c925bc3b0",
MP9 = "5e00903ae9dc277128008b87",
MP9_N = "5de7bd7bfd6b4e6e2276dc25",
MPX = "58948c8e86f77409493f7266",
PP_19_01 = "59984ab886f7743e98271174",
SAIGA_9 = "59f9cabd86f7743a10721f46",
STM_9 = "60339954d62c9b14ed777c06",
VECTOR_9MM = "5fc3f2d5900b1d5091531e57"
}
export enum Weapons9x18
{
APB = "5abccb7dd8ce87001773e277",
APS = "5a17f98cfcdbcb0980087290",
PB_SILENCED = "56e0598dd2720bb5668b45a6",
PM = "5448bd6b4bdc2dfc2f8b4569",
PM_T = "579204f224597773d619e051",
PP9_KLIN = "57f4c844245977379d5c14d1",
PP91_KEDR = "57d14d2524597714373db789",
PP91_KEDRB = "57f3c6bd24597738e730fa2f"
}
export enum Weapons762x25
{
TT = "571a12c42459771f627b58a0",
TT_GOLD = "5b3b713c5acfc4330140bd8d",
PPSH_41 = "5ea03f7400685063ec28bfa8"
}
export enum Weapons12Gauge
{
M3_SUPER90 = "6259b864ebedf17603599e88",
M590A1 = "5e870397991fd70db46995c8",
M870 = "5a7828548dc32e5a9c28b516",
MP_133 = "54491c4f4bdc2db1078b4568",
MP_153 = "56dee2bdd2720bc8328b4567",
MP_155 = "606dae0ab0e443224b421bb7",
MP_43_1C = "5580223e4bdc2d1c128b457f",
MTS_255_12 = "60db29ce99594040e04c4a27",
SAIGA_12GA = "576165642459773c7a400233"
}
export enum Weapons20Gauge
{
TOZ_106 = "5a38e6bac4a2826c6e06d79b"
}
export enum Weapons23x75
{
KS_23M = "5e848cc2988a8701445df1e8"
}

14
config/ts/airdrop.ts Normal file
View File

@ -0,0 +1,14 @@
import { AirdropChancePercent, AirdropLoot } from "@spt-aki/models/spt/config/IAirdropConfig";
export interface AirdropConfig
{
airdropChancePercent: AirdropChancePercent;
planeMinFlyHeight: number;
planeMaxFlyHeight: number;
planeVolume: number;
planeSpeed: number;
crateFallSpeed: number;
airdropMinStartTimeSeconds: number;
airdropMaxStartTimeSeconds: number;
loot: AirdropLoot;
}

View File

@ -1,6 +1,7 @@
export interface AmmoConfig
{
stacks: Ammo
zero: Zero
}
export interface Ammo
@ -30,3 +31,28 @@ export interface Ammo
a30x29: number
a26x75: number
}
export interface Zero
{
g86x70: string
g127x55: string
g762x54: string
g762x51: string
g9x39: string
g366TKM: string
g762x39: string
g762x35: string
g556x45: string
g545x39: string
g57x28: string
g46x30: string
g9x33R: string
g1143x23ACP: string
g762x25: string
g9x21: string
g9x19: string
g9x18: string
g23x75: string
g12Gauge: string
g20Gauge: string
}

View File

@ -1,9 +1,37 @@
import { MinMax } from "@spt-aki/models/common/MinMax";
import { DynamicLoot } from "@spt-aki/models/spt/config/IPmcConfig";
export interface BotsConfig
{
bossChance: BossChance
maxBotCap: number
pmc: Pmc
scav: Scav
bossChance: BossChance;
botGenerationBatchSizePerType: number;
maxBotCap: MaxBotCap;
pmc: IPmcConfig;
scav: Scav;
}
export interface IPmcConfig
{
dynamicLoot: DynamicLoot;
useDifficultyOverride: boolean;
difficulty: string;
looseWeaponInBackpackChancePercent: number;
looseWeaponInBackpackLootMinMax: MinMax;
isUsec: number;
usecType: string;
bearType: string;
chanceSameSideIsHostilePercent: number;
/** key: location, value: type for usec/bear */
pmcType: Record<string, Record<string, Record<string, number>>>;
maxBackpackLootTotalRub: number;
maxPocketLootTotalRub: number;
maxVestLootTotalRub: number;
convertIntoPmcChance: Record<string, MinMax>;
enemyTypes: string[];
botRelativeLevelDeltaMax: number;
containersOnPMCs: boolean;
lootNValue: number;
difficultyWeights: DifficultyWeights;
}
export interface BossChance
@ -12,24 +40,8 @@ export interface BossChance
chance: number
}
export interface Pmc
{
chanceSameSideIsHostile: number
containersOnPMCs: boolean
isUsec: number
lootNValue: number
maxBackpackLootTotalRub: number
maxPocketLootTotalRub: number
maxVestLootTotalRub: number
difficultyWeights: DifficultyWeights
convertIntoPmcChance: ConvertIntoPmcChance
looseWeaponInBackpackChance: number
looseWeaponInBackpackLoot: LooseWeapon
}
export interface DifficultyWeights
{
difficulty: string
useWeights: boolean
weights: Record<string, number>
}
@ -58,3 +70,16 @@ export interface Scav
{
lootNValue: number
}
export interface MaxBotCap
{
factory: number
customs: number
woods: number
shoreline: number
lighthouse: number
reservebase: number
interchange: number
laboratory: number
default: number
}

View File

@ -1,50 +1,51 @@
export interface FleaConfig
{
minUserLevel: number
blacklist: Blacklist
condition: Condition
currencies: Currencies
offerItemCount: OfferItemCount
reputation: Reputation
time: Time
runIntervalSeconds: number;
minUserLevel: number;
blacklist: Blacklist;
condition: Condition;
currencies: Currencies;
offerItemCount: OfferItemCount;
reputation: Reputation;
time: Time;
}
export interface Blacklist
{
enableBsgList: boolean
enableQuestList: boolean
enableBsgList: boolean;
enableQuestList: boolean;
}
export interface Condition
{
conditionChance: number
min: number
max: number
conditionChance: number;
min: number;
max: number;
}
export interface Currencies
{
roubles: number
dollars: number
euros: number
roubles: number;
dollars: number;
euros: number;
}
export interface OfferItemCount
{
min: number
max: number
min: number;
max: number;
}
export interface Reputation
{
gain: number
loss: number
gain: number;
loss: number;
}
export interface Time
{
baseSellTime: number
minSellTime: number
maxSellTime: number
baseSellTime: number;
minSellTime: number;
maxSellTime: number;
}

View File

@ -1,9 +1,6 @@
export interface HideoutConfig
{
airFilterUnitFlowRate: number
constructionTime: number
generatorFuelFlowRate: number
gpuBoostRate: number
productionTime: number
scavCaseTime: number
}

View File

@ -4,5 +4,6 @@ export interface LocationsConfig
freeLabsEntry: boolean
exfilTime: number
extractionsExtended: boolean
enableCoopExtracts: boolean
noExtractRestrictions: boolean
}

View File

@ -1,14 +1,20 @@
export interface RaidConfig
{
carExtractBaseStandingGain: number
chompiesBossFix: boolean
fixOpenZones: boolean
scavExtractGain: number
timeLimit: number
aiAmount: string
aiDifficulty: string
bossEnabled: boolean
scavWars: boolean
taggedAndCursed: boolean
enablePve: boolean
carExtractBaseStandingGain: number;
chompiesBossFix: boolean;
fixOpenZones: boolean;
scavExtractGain: number;
timeLimit: TimeLimit;
aiAmount: string;
aiDifficulty: string;
bossEnabled: boolean;
scavWars: boolean;
taggedAndCursed: boolean;
enablePve: boolean;
}
export interface TimeLimit
{
enabled: boolean;
raidTime: number;
}

View File

@ -1,8 +1,13 @@
import { FenceConfig } from "@spt-aki/models/spt/config/ITraderConfig";
export interface TradersConfig
{
updateTime: UpdateTime;
minDurabilityForSale: number;
updateTimeDefault: number;
/** What % of max durability an item needs to sell to a trader*/
durabilityPurchaseThreshhold: Record<string, number>;
traderPriceMultipler: number;
persistPurchaseDataInProfile: boolean;
fence: FenceConfig;
}
@ -17,14 +22,3 @@ export interface UpdateTime1
traderId: string;
seconds: number;
}
export interface FenceConfig
{
partialRefreshTimeSeconds: number;
partialRefreshChangePercent: number;
assortSize: number;
maxPresetsPercent: number;
presetPriceMult: number;
blacklist: string[];
}

View File

@ -1,10 +1,10 @@
{
"name": "Valens-AIO",
"version": "1.6.0",
"version": "1.8.2",
"main": "src/mod.js",
"license": "CC BY-NC-ND 4.0",
"author": "Valens",
"akiVersion": "3.2.*",
"akiVersion": ">=3.5.0",
"scripts": {
"setup:environment": "npm i",
"build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" \"./**/*.*\" ./dist",

View File

@ -1,14 +1,16 @@
/*import { Config } from "../config/config";
import { Logger } from "./logger";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { AirdropConfig } from "../config/ts/airdrop";
import { Logger } from "./logger";
export class Airdrop
{
private modConfig: Config = require("../config/config.jsonc");
private modConfig: AirdropConfig = require("../config/airdrop.json");
private logger: Logger;
private databaseServer: IDatabaseTables;
private databaseServer: DatabaseServer;
private airdropConfig: IAirdropConfig;
private tables: IDatabaseTables
constructor(logger: Logger, databaseServer: DatabaseServer, airdropConfig: IAirdropConfig)
{
@ -17,23 +19,126 @@ export class Airdrop
this.airdropConfig = airdropConfig;
}
public updateAirdrops();
public updateAirdrops(): void
{
if (this.modConfig.airdropChancePercent != 25)
const mod = this.modConfig;
const airdrop = this.airdropConfig;
// Sets airdropChancePercent to what is configured.
if (mod.airdropChancePercent != airdrop.airdropChancePercent)
{
this.airdropConfig.airdropChancePercent["bigmap"] = this.modConfig.airdrop.airdropChancePercent.bigmap;
this.airdropConfig.airdropChancePercent["woods"] = this.modConfig.airdrop.airdropChancePercent.woods;
this.airdropConfig.airdropChancePercent["lighthouse"] = this.modConfig.airdrop.airdropChancePercent.lighthouse;
this.airdropConfig.airdropChancePercent["shoreline"] = this.modConfig.airdrop.airdropChancePercent.shoreline;
this.airdropConfig.airdropChancePercent["interchange"] = this.modConfig.airdrop.airdropChancePercent.interchange;
this.airdropConfig.airdropChancePercent["reserve"] = this.modConfig.airdrop.airdropChancePercent.reserve;
this.logger.info(`Customs Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.bigmap}`);
this.logger.info(`Woods Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.woods}`);
this.logger.info(`Lighthouse Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.lighthouse}`);
this.logger.info(`Shoreline Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.shoreline}`);
this.logger.info(`Interchange Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.interchange}`);
this.logger.info(`Reserve Airdrop Chance is ${this.modConfig.airdrop.airdropChancePercent.reserve}`);
this.setAirdropChance();
}
// Sets airdropMinStartTime and airdropMaxStartTime in Seconds to what is configured.
if (mod.airdropMinStartTimeSeconds != airdrop.airdropMinStartTimeSeconds || mod.airdropMaxStartTimeSeconds != airdrop.airdropMaxStartTimeSeconds)
{
airdrop.airdropMinStartTimeSeconds = mod.airdropMinStartTimeSeconds;
airdrop.airdropMaxStartTimeSeconds = mod.airdropMaxStartTimeSeconds;
this.logger.info(`Min Start Time is ${mod.airdropMinStartTimeSeconds} seconds. Max is ${mod.airdropMaxStartTimeSeconds}.`)
}
// Sets planeMinFlyHeight and planeMaxFlyHeight in Meters to what is configured.
if (mod.planeMaxFlyHeight != airdrop.planeMaxFlyHeight || mod.planeMinFlyHeight != airdrop.planeMinFlyHeight)
{
airdrop.planeMaxFlyHeight = mod.planeMaxFlyHeight;
airdrop.planeMinFlyHeight = mod.planeMinFlyHeight;
this.logger.info(`Max Fly Height is ${mod.planeMaxFlyHeight}. Min is ${mod.planeMinFlyHeight}.`);
}
// Sets the volume (loudness) of the plane as it flies to what is configured.
if (mod.planeVolume != airdrop.planeVolume)
{
airdrop.planeVolume = mod.planeVolume;
this.logger.info(`Plane Volume is ${mod.planeVolume}`);
}
// Sets the speed of the plane as it flies to what is configured.
if (mod.planeSpeed != airdrop.planeSpeed)
{
airdrop.planeSpeed = mod.planeSpeed;
this.logger.info(`Plane Speed is ${mod.planeSpeed}`);
}
// Sets the fall speed of the cargo crate dropping out of the plate to what is configured.
if (mod.crateFallSpeed != airdrop.crateFallSpeed)
{
airdrop.crateFallSpeed = mod.crateFallSpeed;
this.logger.info(`Crate Fall Speed is ${mod.crateFallSpeed}`);
}
// Airdrop Loot Settings configuration begin.
// Sets the Preset Count to what is configured.
if (mod.loot.presetCount != airdrop.loot.presetCount)
{
airdrop.loot.presetCount = mod.loot.presetCount;
this.logger.info(`Preset Count is ${mod.loot.presetCount}`);
}
// Sets the Item Count to what is configured.
if (mod.loot.itemCount != airdrop.loot.itemCount)
{
airdrop.loot.itemCount = mod.loot.itemCount;
this.logger.info(`Item Count is ${mod.loot.itemCount}`);
}
// Sets the Item Blacklist to what is configured.
if (mod.loot.itemBlacklist != airdrop.loot.itemBlacklist)
{
airdrop.loot.itemBlacklist = mod.loot.itemBlacklist;
this.logger.info(`Item Blacklist is ${mod.loot.itemBlacklist}`);
}
// Sets the itemTypeWhitelist to what is configured.
if (mod.loot.itemTypeWhitelist != airdrop.loot.itemTypeWhitelist)
{
airdrop.loot.itemTypeWhitelist = mod.loot.itemTypeWhitelist;
this.logger.info(`Item Type Whitelist is ${mod.loot.itemTypeWhitelist}`);
}
// Sets the itemLimits to what is configured.
if (mod.loot.itemLimits != airdrop.loot.itemLimits)
{
airdrop.loot.itemLimits = mod.loot.itemLimits;
this.logger.info(`Item Limits is ${mod.loot.itemLimits}`);
}
// Sets the itemStackLimits to what is configured.
if (mod.loot.itemStackLimits != airdrop.loot.itemStackLimits)
{
airdrop.loot.itemStackLimits = mod.loot.itemStackLimits;
this.logger.info(`Item Stack Limits is ${mod.loot.itemStackLimits}`);
}
// Sets the Armor Level Whitelist to what is configured.
if (mod.loot.armorLevelWhitelist != airdrop.loot.armorLevelWhitelist)
{
airdrop.loot.armorLevelWhitelist = mod.loot.armorLevelWhitelist;
this.logger.info(`Armor Level Whitelist is ${mod.loot.armorLevelWhitelist}`);
}
}
// Begin Functions.
private setAirdropChance(): void
{
const mod = this.modConfig.airdropChancePercent;
const chance = this.airdropConfig.airdropChancePercent;
chance["bigmap"] = mod.bigmap;
chance["woods"] = mod.woods;
chance["lighthouse"] = mod.lighthouse;
chance["shoreline"] = mod.shoreline;
chance["interchange"] = mod.interchange;
chance["reserve"] = mod.reserve;
chance["tarkovStreets"] = mod.tarkovStreets;
this.logger.info(`Customs Airdrop Chance is ${mod.bigmap}`);
this.logger.info(`Woods Airdrop Chance is ${mod.woods}`);
this.logger.info(`Lighthouse Airdrop Chance is ${mod.lighthouse}`);
this.logger.info(`Shoreline Airdrop Chance is ${mod.shoreline}`);
this.logger.info(`Interchange Airdrop Chance is ${mod.interchange}`);
this.logger.info(`Reserve Airdrop Chance is ${mod.reserve}`);
this.logger.info(`Streets Airdrop Chance is ${mod.tarkovStreets}`);
}
}
*/

View File

@ -1,263 +1,458 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { Grenade, Ammo762x51, Ammo762x54, Ammo86x70, Ammo46x30, Ammo57x28, Ammo762x25, Ammo9x18, Ammo9x19, Ammo9x21, Ammo9x33R, Ammo1143x23ACP, Ammo545x39, Ammo556x45, Ammo762x35, Ammo762x39, Ammo9x39, Ammo366TKM, Ammo127x55, Ammo12Gauge, Ammo20Gauge, Ammo23x75, Ammo30x29, Ammo26x75 } from "@spt-aki/models/enums/AmmoTypes";
import { Weapons127x55, Weapons86x70, Weapons9x39, Weapons762x54R, Weapons762x51, Weapons366TKM, Weapons762x39, Weapons762x35, Weapons556x45, Weapons545x39, Weapons57x28FN, Weapons46x30HK, Weapons1143x23, Weapons9x33R, Weapons9x21, Weapons9x19, Weapons9x18, Weapons762x25, Weapons12Gauge, Weapons20Gauge, Weapons23x75 } from "@spt-aki/models/enums/WeaponTypes";
import { AmmoConfig } from "../config/ts/ammo";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
export class Ammo
{
private modConfig: AmmoConfig = require("../config/ammo.json")
private logger: Logger;
private tables: DatabaseServer;
private databaseServer: DatabaseServer
private tables: IDatabaseTables;
constructor(logger: Logger, databaseServer: DatabaseServer)
{
this.logger = logger;
this.tables = databaseServer;
this.tables = databaseServer.getTables().templates.items;
}
public updateAmmo(): void
{
const items = this.tables.getTables().templates.items;
const mod = this.modConfig.stacks;
const items = this.tables;
const stacks = this.modConfig.stacks;
// Sets HE grenades from GLaunchers max stacks.
if (mod.grenades != 1)
if (stacks.grenades != 1)
{
for (const value of Object.values(Grenade))
{
items[value]._props.StackMaxSize = mod.grenades;
this.logger.info(`Grenade Max Stacks set to ${mod.grenades}`);
items[value]._props.StackMaxSize = stacks.grenades;
this.logger.info(`Grenade Max Stacks set to ${stacks.grenades}`);
}
}
// Sets .338 Lapua Magnum max stacks.
if (mod.a86x70 != 30)
if (stacks.a86x70 != 30)
{
for (const value of Object.values(Ammo86x70))
{
items[value]._props.StackMaxSize = mod.a86x70;
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a86x70}`);
items[value]._props.StackMaxSize = stacks.a86x70;
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${stacks.a86x70}`);
}
}
// Sets 12.7x55mm max stacks.
if (mod.a127x55 != 30)
if (stacks.a127x55 != 30)
{
for (const value of Object.values(Ammo127x55))
{
items[value]._props.StackMaxSize = mod.a127x55;
this.logger.info(`12.7x55mm Max Stacks set to ${mod.a127x55}`);
items[value]._props.StackMaxSize = stacks.a127x55;
this.logger.info(`12.7x55mm Max Stacks set to ${stacks.a127x55}`);
}
}
// Sets 7.62x54mm max stacks.
if (mod.a762x54 != 40)
if (stacks.a762x54 != 40)
{
for (const value of Object.values(Ammo762x54))
{
items[value]._props.StackMaxSize = mod.a762x54;
this.logger.info(`7.62x54R Max Stacks set to ${mod.a762x54}`);
items[value]._props.StackMaxSize = stacks.a762x54;
this.logger.info(`7.62x54R Max Stacks set to ${stacks.a762x54}`);
}
}
// Sets 7.62x51mm max stacks.
if (mod.a762x51 != 40)
if (stacks.a762x51 != 40)
{
for (const value of Object.values(Ammo762x51))
{
items[value]._props.StackMaxSize = mod.a762x51;
this.logger.info(`7.62x51mm Max Stacks set to ${mod.a762x51}`);
items[value]._props.StackMaxSize = stacks.a762x51;
this.logger.info(`7.62x51mm Max Stacks set to ${stacks.a762x51}`);
}
}
// Sets 9x39mm max stacks.
if (mod.a9x39 != 50)
if (stacks.a9x39 != 50)
{
for (const value of Object.values(Ammo9x39))
{
items[value]._props.StackMaxSize = mod.a9x39;
this.logger.info(`9x39mm Max Stacks set to ${mod.a9x39}`);
items[value]._props.StackMaxSize = stacks.a9x39;
this.logger.info(`9x39mm Max Stacks set to ${stacks.a9x39}`);
}
}
// Sets .366 TKM max stacks.
if (mod.a366TKM != 50)
if (stacks.a366TKM != 50)
{
for (const value of Object.values(Ammo366TKM))
{
items[value]._props.StackMaxSize = mod.a366TKM;
this.logger.info(`.366 TKM Max Stacks set to ${mod.a366TKM}`);
items[value]._props.StackMaxSize = stacks.a366TKM;
this.logger.info(`.366 TKM Max Stacks set to ${stacks.a366TKM}`);
}
}
// Sets 7.62x39mm max stacks.
if (mod.a762x39 != 60)
if (stacks.a762x39 != 60)
{
for (const value of Object.values(Ammo762x39))
{
items[value]._props.StackMaxSize = mod.a762x39;
this.logger.info(`7.62x39mm Max Stacks set to ${mod.a762x39}`);
items[value]._props.StackMaxSize = stacks.a762x39;
this.logger.info(`7.62x39mm Max Stacks set to ${stacks.a762x39}`);
}
}
// Sets 7.62x35mm (.300 Blackout) max stacks.
if (mod.a762x35 != 60)
if (stacks.a762x35 != 60)
{
for (const value of Object.values(Ammo762x35))
{
items[value]._props.StackMaxSize = mod.a762x35;
this.logger.info(`762x35mm Max Stacks set to ${mod.a762x35}`);
items[value]._props.StackMaxSize = stacks.a762x35;
this.logger.info(`762x35mm Max Stacks set to ${stacks.a762x35}`);
}
}
// Sets 5.56x45mm max stacks.
if (mod.a556x45 != 60)
if (stacks.a556x45 != 60)
{
for (const value of Object.values(Ammo556x45))
{
items[value]._props.StackMaxSize = mod.a556x45;
this.logger.info(`5.56x45mm Max Stacks set to ${mod.a556x45}`);
items[value]._props.StackMaxSize = stacks.a556x45;
this.logger.info(`5.56x45mm Max Stacks set to ${stacks.a556x45}`);
}
}
// Sets 5.45x39mm max stacks.
if (mod.a545x39 != 60)
if (stacks.a545x39 != 60)
{
for (const value of Object.values(Ammo545x39))
{
items[value]._props.StackMaxSize = mod.a545x39;
this.logger.info(`5.45x39mm Max Stacks set to ${mod.a545x39}`);
items[value]._props.StackMaxSize = stacks.a545x39;
this.logger.info(`5.45x39mm Max Stacks set to ${stacks.a545x39}`);
}
}
if (mod.a57x28 != 60)
// Sets 5.7x28mm max stacks.
if (stacks.a57x28 != 60)
{
for (const value of Object.values(Ammo57x28))
{
items[value]._props.StackMaxSize = mod.a57x28;
this.logger.info(`5.7x28mm Max Stacks set to ${mod.a57x28}`);
items[value]._props.StackMaxSize = stacks.a57x28;
this.logger.info(`5.7x28mm Max Stacks set to ${stacks.a57x28}`);
}
}
if (mod.a46x30 != 70)
// Sets 4.6x30mm max stacks.
if (stacks.a46x30 != 70)
{
for (const value of Object.values(Ammo46x30))
{
items[value]._props.StackMaxSize = mod.a46x30;
this.logger.info(`4.6x30mm Max Stacks set to ${mod.a46x30}`);
items[value]._props.StackMaxSize = stacks.a46x30;
this.logger.info(`4.6x30mm Max Stacks set to ${stacks.a46x30}`);
}
}
if (mod.a9x33R != 30)
// Sets 9x33R or .357 Mag max stacks.
if (stacks.a9x33R != 30)
{
for (const value of Object.values(Ammo9x33R))
{
items[value]._props.StackMaxSize = mod.a9x33R;
this.logger.info(`.357 Magnum Max Stacks set to ${mod.a9x33R}`);
items[value]._props.StackMaxSize = stacks.a9x33R;
this.logger.info(`.357 Magnum Max Stacks set to ${stacks.a9x33R}`);
}
}
if (mod.a1143x23ACP != 50)
// Sets 1143x23ACP or .45 ACP max stacks.
if (stacks.a1143x23ACP != 50)
{
for (const value of Object.values(Ammo1143x23ACP))
{
items[value]._props.StackMaxSize = mod.a1143x23ACP;
this.logger.info(`.45 ACP Max Stacks set to ${mod.a1143x23ACP}`);
items[value]._props.StackMaxSize = stacks.a1143x23ACP;
this.logger.info(`.45 ACP Max Stacks set to ${stacks.a1143x23ACP}`);
}
}
if (mod.a762x25 != 50)
// Sets 7.62x25mm or .300BLK max stacks.
if (stacks.a762x25 != 50)
{
for (const value of Object.values(Ammo762x25))
{
items[value]._props.StackMaxSize = mod.a762x25;
this.logger.info(`7.62x25mm TT Max Stacks set to ${mod.a762x25}`);
items[value]._props.StackMaxSize = stacks.a762x25;
this.logger.info(`7.62x25mm TT Max Stacks set to ${stacks.a762x25}`);
}
}
if (mod.a9x21 != 50)
// Sets 9x21mm max stacks.
if (stacks.a9x21 != 50)
{
for (const value of Object.values(Ammo9x21))
{
items[value]._props.StackMaxSize = mod.a9x21;
this.logger.info(`9x21mm Max Stacks set to ${mod.a9x21}`);
items[value]._props.StackMaxSize = stacks.a9x21;
this.logger.info(`9x21mm Max Stacks set to ${stacks.a9x21}`);
}
}
if (mod.a9x19 != 50)
// Sets 9x19mm parabellum max stacks.
if (stacks.a9x19 != 50)
{
for (const value of Object.values(Ammo9x19))
{
items[value]._props.StackMaxSize = mod.a9x19;
this.logger.info(`9x19mm Max Stacks set to ${mod.a9x19}`);
items[value]._props.StackMaxSize = stacks.a9x19;
this.logger.info(`9x19mm Max Stacks set to ${stacks.a9x19}`);
}
}
if (mod.a9x18 != 50)
// Sets 9x18mm max stacks.
if (stacks.a9x18 != 50)
{
for (const value of Object.values(Ammo9x18))
{
items[value]._props.StackMaxSize = mod.a9x18;
this.logger.info(`9x18mm Max Stacks set to ${mod.a9x18}`);
items[value]._props.StackMaxSize = stacks.a9x18;
this.logger.info(`9x18mm Max Stacks set to ${stacks.a9x18}`);
}
}
if (mod.a23x75 != 15)
// Sets 23x75 KS-23 max stacks.
if (stacks.a23x75 != 15)
{
for (const value of Object.values(Ammo23x75))
{
items[value]._props.StackMaxSize = mod.a23x75;
this.logger.info(`23x75mm KS-23 Max Stacks set to ${mod.a23x75}`);
items[value]._props.StackMaxSize = stacks.a23x75;
this.logger.info(`23x75mm KS-23 Max Stacks set to ${stacks.a23x75}`);
}
}
if (mod.a12Gauge != 20)
// Sets 12x70 12 Gauge max stacks.
if (stacks.a12Gauge != 20)
{
for (const value of Object.values(Ammo12Gauge))
{
items[value]._props.StackMaxSize = mod.a12Gauge;
this.logger.info(`12 Gauge Max Stacks set to ${mod.a12Gauge}`);
items[value]._props.StackMaxSize = stacks.a12Gauge;
this.logger.info(`12 Gauge Max Stacks set to ${stacks.a12Gauge}`);
}
}
if (mod.a20Gauge != 20)
// Sets 20x70 20 Gauge max stacks.
if (stacks.a20Gauge != 20)
{
for (const value of Object.values(Ammo20Gauge))
{
items[value]._props.StackMaxSize = mod.a20Gauge;
this.logger.info(`20 Gauge Max Stacks set to ${mod.a20Gauge}`);
items[value]._props.StackMaxSize = stacks.a20Gauge;
this.logger.info(`20 Gauge Max Stacks set to ${stacks.a20Gauge}`);
}
}
if (mod.a30x29 != 1)
// Sets 30x29mm max stacks.
if (stacks.a30x29 != 1)
{
for (const value of Object.values(Ammo30x29))
{
items[value]._props.StackMaxSize = mod.a30x29;
this.logger.info(`VOG-30x29mm Max Stacks set to ${mod.a30x29}`);
items[value]._props.StackMaxSize = stacks.a30x29;
this.logger.info(`VOG-30x29mm Max Stacks set to ${stacks.a30x29}`);
}
}
if (mod.a26x75 != 1)
// Sets 26x75mm max stacks.
if (stacks.a26x75 != 1)
{
for (const value of Object.values(Ammo26x75))
{
items[value]._props.StackMaxSize = mod.a26x75;
this.logger.info(`Flare Max Stacks set to ${mod.a26x75}`);
items[value]._props.StackMaxSize = stacks.a26x75;
this.logger.info(`Flare Max Stacks set to ${stacks.a26x75}`);
}
}
const zero = this.modConfig.zero;
// Sets 127x55mm Zeroing default ammo to the configured value.
if (zero.g127x55 != "5cadf6ddae9215051e1c23b2")
{
for (const value of Object.values(Weapons127x55))
{
items[value]._props.defAmmo = zero.g127x55;
this.logger.info("12.7x55mm Weapons Zero Changed");
}
}
if (zero.g86x70 != "5fc275cf85fd526b824a571a")
{
for (const value of Object.values(Weapons86x70))
{
items[value]._props.defAmmo = zero.g86x70;
this.logger.info("86x70mm Weapons Zero Changed");
}
}
if (zero.g762x54 != "5887431f2459777e1612938f")
{
for (const value of Object.values(Weapons762x54R))
{
items[value]._props.defAmmo = zero.g762x54;
this.logger.info("7.62x54mmR Weapons Zero Changed");
}
}
if (zero.g762x51 != "58dd3ad986f77403051cba8f")
{
for (const value of Object.values(Weapons762x51))
{
items[value]._props.defAmmo = zero.g762x51;
this.logger.info("7.62x51mm Weapons Zero Changed");
}
}
if (zero.g9x39 != "57a0dfb82459774d3078b56c")
{
for (const value of Object.values(Weapons9x39))
{
items[value]._props.defAmmo = zero.g9x39;
this.logger.info("9x39mm Weapons Zero Changed");
}
}
if (zero.g366TKM != "59e655cb86f77411dc52a77b")
{
for (const value of Object.values(Weapons366TKM))
{
items[value]._props.defAmmo = zero.g366TKM;
this.logger.info(".366 TKM Weapons Zero Changed");
}
}
if (zero.g762x39 != "5656d7c34bdc2d9d198b4587")
{
for (const value of Object.values(Weapons762x39))
{
items[value]._props.defAmmo = zero.g762x39;
this.logger.info("7.62x39mm Weapons Zero Changed");
}
}
if (zero.g762x35 != "5fbe3ffdf8b6a877a729ea82")
{
for (const value of Object.values(Weapons762x35))
{
items[value]._props.defAmmo = zero.g762x35;
this.logger.info("7.62x35mm Weapons Zero Changed");
}
}
if (zero.g556x45 != "54527a984bdc2d4e668b4567")
{
for (const value of Object.values(Weapons556x45))
{
items[value]._props.defAmmo = zero.g556x45;
this.logger.info("5.56x45mm Weapons Zero Changed");
}
}
if (zero.g545x39 != "56dff3afd2720bba668b4567")
{
for (const value of Object.values(Weapons545x39))
{
items[value]._props.defAmmo = zero.g545x39;
this.logger.info("5.45x39mm Weapons Zero Changed");
}
}
if (zero.g57x28 != "5cc80f38e4a949001152b560")
{
for (const value of Object.values(Weapons57x28FN))
{
items[value]._props.defAmmo = zero.g57x28;
this.logger.info("5.7x28mm Weapons Zero Changed");
}
}
if (zero.g46x30 != "5ba2678ad4351e44f824b344")
{
for (const value of Object.values(Weapons46x30HK))
{
items[value]._props.defAmmo = zero.g46x30;
this.logger.info("4.6x30mm Weapons Zero Changed");
}
}
if (zero.g9x33R != "62330b3ed4dc74626d570b95")
{
for (const value of Object.values(Weapons9x33R))
{
items[value]._props.defAmmo = zero.g9x33R;
this.logger.info("9x33R Weapons Zero Changed");
}
}
if (zero.g1143x23ACP != "5e81f423763d9f754677bf2e")
{
for (const value of Object.values(Weapons1143x23))
{
items[value]._props.defAmmo = zero.g1143x23ACP;
this.logger.info("1143x23ACP Weapons Zero Changed");
}
}
if (zero.g762x25 != "5736026a245977644601dc61")
{
for (const value of Object.values(Weapons762x25))
{
items[value]._props.defAmmo = zero.g762x25;
this.logger.info("7.62x25mm Weapons Zero Changed");
}
}
if (zero.g9x21 != "5a269f97c4a282000b151807")
{
for (const value of Object.values(Weapons9x21))
{
items[value]._props.defAmmo = zero.g9x21;
this.logger.info("9x21mm Weapons Zero Changed");
}
}
if (zero.g9x19 != "56d59d3ad2720bdb418b4577")
{
for (const value of Object.values(Weapons9x19))
{
items[value]._props.defAmmo = zero.g9x19;
this.logger.info("9x19mm Weapons Zero Changed");
}
}
if (zero.g9x18 != "573719762459775a626ccbc1")
{
for (const value of Object.values(Weapons9x18))
{
items[value]._props.defAmmo = zero.g9x18;
this.logger.info("9x18mm Weapons Zero Changed");
}
}
if (zero.g23x75 != "5e85aa1a988a8701445df1f5")
{
for (const value of Object.values(Weapons23x75))
{
items[value]._props.defAmmo = zero.g23x75;
this.logger.info("KS-23M Weapons Zero Changed");
}
}
if (zero.g12Gauge != "560d5e524bdc2d25448b4571")
{
for (const value of Object.values(Weapons12Gauge))
{
items[value]._props.defAmmo = zero.g12Gauge;
this.logger.info("12 Gauge Weapons Zero Changed");
}
}
if (zero.g20Gauge != "5a38ebd9c4a282000d722a5b")
{
for (const value of Object.values(Weapons20Gauge))
{
items[value]._props.defAmmo = zero.g20Gauge;
this.logger.info("20 Gauge Weapons Zero Changed");
}
}
}

View File

@ -1,8 +1,9 @@
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { BotsConfig } from "../config/ts/bots";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { Logger } from "./logger";
export class Bots
{
private modConfig: BotsConfig = require("../config/bots.json");
@ -28,27 +29,28 @@ export class Bots
// Server side variables
const pmc = this.botConfig.pmc;
const bot = this.botConfig;
const lootNValue = this.botConfig.lootNValue;
// Start modifications
// Checks if straight up difficulty selection is used or not to determine if it should use that or if it should then go to use weighted difficulties.
if (modPMC.difficultyWeights.difficulty != "asonline")
if (modPMC.difficultyWeights.useWeights)
{
// Uses PMC difficulty weighting if straight up difficulty selection is not used.
if (modPMC.difficultyWeights.useWeights)
{
const chosenDifficulty = this.chooseRandomWeightedDifficulty();
this.logger.info("PMC Difficulty Chance Weights Patched");
this.logger.info(`PMC Difficulty Chosen: ${chosenDifficulty}`);
}
// Uses PMC difficulty if weighting is disabled.
else
{
pmc.difficulty = modPMC.difficultyWeights.difficulty;
this.logger.info(`PMC Bot Difficulty set to ${modPMC.difficultyWeights.difficulty}`);
}
const chosenDifficulty = this.chooseRandomWeightedDifficulty();
this.logger.info("PMC Difficulty Chance Weights Patched");
this.logger.info(`PMC Difficulty Chosen: ${chosenDifficulty}`)
}
else if (modPMC.difficulty != pmc.difficulty)
{
pmc.difficulty = modPMC.difficulty;
this.logger.info(`PMC Bot Difficulty set to ${modPMC.difficulty}`);
}
else if (modPMC.useDifficultyOverride)
{
pmc.useDifficultyOverride = modPMC.useDifficultyOverride;
this.logger.info("PMC Bot Difficulty now overriden by raid settings");
}
@ -61,7 +63,7 @@ export class Bots
// Chance that PMC bot will be USEC or BEAR. Default is 50%
if (modPMC.isUsec != 50)
if (modPMC.isUsec != pmc.isUsec)
{
pmc.isUsec = modPMC.isUsec;
this.logger.info(`PMC isUsec Chance is: ${modPMC.isUsec}`);
@ -69,9 +71,9 @@ export class Bots
// Max Loot Value in Rubles for PMC bots in Backpack, Pockets, and Vest respectively. Default is 150,000/50,000/50,000
if (modPMC.maxBackpackLootTotalRub != 150000
|| modPMC.maxPocketLootTotalRub !=50000
|| modPMC.maxVestLootTotalRub != 50000)
if (modPMC.maxBackpackLootTotalRub != pmc.maxBackpackLootTotalRub
|| modPMC.maxPocketLootTotalRub != pmc.maxPocketLootTotalRub
|| modPMC.maxVestLootTotalRub != pmc.maxVestLootTotalRub)
{
this.changeMaxLootvalue();
this.logger.info(`PMC Loot Value totals changed! \n Max Backpack Total Value: ${modPMC.maxBackpackLootTotalRub} \n Max Pocket Total Value: ${modPMC.maxPocketLootTotalRub} \n Max Vest Total Value: ${modPMC.maxVestLootTotalRub}`);
@ -79,23 +81,25 @@ export class Bots
// Chance that the PMC bot of your faction (BEAR/USEC) will be hostile or not. Default is 50%.
if (modPMC.chanceSameSideIsHostile != 50)
if (modPMC.chanceSameSideIsHostilePercent != pmc.chanceSameSideIsHostilePercent)
{
pmc.chanceSameSideIsHostilePercent = modPMC.chanceSameSideIsHostile;
this.logger.info(`Chance Same Side Is Hostle is ${modPMC.chanceSameSideIsHostile}`);
pmc.chanceSameSideIsHostilePercent = modPMC.chanceSameSideIsHostilePercent;
this.logger.info(`Chance Same Side Is Hostle is ${modPMC.chanceSameSideIsHostilePercent}`);
}
// Adjusts the Max Bot Cap located in configs/bot.json/maxBotCap
if (mod.maxBotCap != 20)
{
this.botConfig.maxBotCap = mod.maxBotCap;
this.logger.info(`Bot Cap is now ${mod.maxBotCap}`);
for (const [key] of Object.entries(bot.maxBotCap))
{
bot.maxBotCap[key] = mod.maxBotCap[key];
this.logger.info(mod.maxBotCap[key]);
}
}
// Modifies the lootNValue of PMC or Scav if configured outside of the defaults.
if (modPMC.lootNValue != 3 || modScav.lootNValue != 4)
if (modPMC.lootNValue != lootNValue.pmc || modScav.lootNValue != lootNValue.scav)
{
lootNValue.scav = modScav.lootNValue;
lootNValue.pmc = modPMC.lootNValue;
@ -104,26 +108,33 @@ export class Bots
// Adjusts the chance for PMC to spawn instead of the default bot type if configured outside of the default values.
const pmcChance = modPMC.convertIntoPmcChance;
if (pmcChance.assault.min != 15 || pmcChance.assault.max != 40
|| pmcChance.cursedAssault.min != 15 || pmcChance.cursedAssault.max != 40
|| pmcChance.pmcBot.min != 15 || pmcChance.pmcBot.max != 30
|| pmcChance.exUsec.min != 5 || pmcChance.exUsec.max != 20)
if (this.modConfig.pmc.convertIntoPmcChance.assault.min != this.botConfig.pmc.convertIntoPmcChance.assault.min || this.modConfig.pmc.convertIntoPmcChance.assault.max != this.botConfig.pmc.convertIntoPmcChance.assault.max
|| this.modConfig.pmc.convertIntoPmcChance.cursedassault.min != this.botConfig.pmc.convertIntoPmcChance.cursedassault.min || this.modConfig.pmc.convertIntoPmcChance.cursedassault.max != this.botConfig.pmc.convertIntoPmcChance.cursedassault.max
|| this.modConfig.pmc.convertIntoPmcChance.pmcbot.min != this.botConfig.pmc.convertIntoPmcChance.pmcbot.min || this.modConfig.pmc.convertIntoPmcChance.pmcbot.max != this.botConfig.pmc.convertIntoPmcChance.pmcbot.max
|| this.modConfig.pmc.convertIntoPmcChance.exusec.min != this.botConfig.pmc.convertIntoPmcChance.exusec.min || this.modConfig.pmc.convertIntoPmcChance.exusec.max != this.botConfig.pmc.convertIntoPmcChance.exusec.max)
{
this.adjustPmcChance();
this.logger.info("Chance to Convert Bots into PMC Patched");
}
// Modfiies the botRelativeLevelDeltaMax which alters the relative level delta maximum of PMC bots.
if (mod.pmc.botRelativeLevelDeltaMax != this.botConfig.pmc.botRelativeLevelDeltaMax)
{
this.botConfig.pmc.botRelativeLevelDeltaMax = mod.pmc.botRelativeLevelDeltaMax;
this.logger.info(`Bot Relative Delta Max Level set to ${mod.pmc.botRelativeLevelDeltaMax}`);
}
// Makes *all* bosses spawn chance configurable.
if (mod.bossChance.activated)
{
this.configureBossChance();
this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`)
this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`);
}
if (modPMC.looseWeaponInBackpackChance != 15 || modPMC.looseWeaponInBackpackLoot.max != 1 || modPMC.looseWeaponInBackpackLoot.min != 1)
if (modPMC.looseWeaponInBackpackChancePercent != 15 || modPMC.looseWeaponInBackpackLootMinMax.max != 1 || modPMC.looseWeaponInBackpackLootMinMax.min != 1)
{
this.changeLooseWeapon();
this.logger.info("Loose Weapon In PMC Backpack Values Patched");
@ -135,10 +146,10 @@ export class Bots
// Function to enable secured and common containers on PMCs.
private containersOnPMCs(): void
{
const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist;
const backpackLoot = this.botConfig.pmc.backpackLoot.whitelist;
dynaLoot.push("5448bf274bdc2dfc2f8b456a");
dynaLoot.push("5795f317245977243854e041");
backpackLoot.push("5448bf274bdc2dfc2f8b456a");
backpackLoot.push("5795f317245977243854e041");
}
private chooseRandomWeightedDifficulty(): string
@ -156,12 +167,12 @@ export class Bots
pmcConfig.assault.min = modConfig.assault.min;
pmcConfig.assault.max = modConfig.assault.max;
pmcConfig.cursedassault.min = modConfig.cursedAssault.min;
pmcConfig.cursedassault.max = modConfig.cursedAssault.max;
pmcConfig.pmcbot.min = modConfig.pmcBot.min;
pmcConfig.pmcbot.max = modConfig.pmcBot.max;
pmcConfig.exusec.min = modConfig.exUsec.min;
pmcConfig.exusec.max = modConfig.exUsec.max;
pmcConfig.cursedassault.min = modConfig.cursedassault.min;
pmcConfig.cursedassault.max = modConfig.cursedassault.max;
pmcConfig.pmcbot.min = modConfig.pmcbot.min;
pmcConfig.pmcbot.max = modConfig.pmcbot.max;
pmcConfig.exusec.min = modConfig.exusec.min;
pmcConfig.exusec.max = modConfig.exusec.max;
}
@ -184,12 +195,9 @@ export class Bots
{
if (i !== "base")
{
if (locations[i].base.BossLocationSpawn !== [])
for (const x in locations[i].base.BossLocationSpawn)
{
for (const x in locations[i].base.BossLocationSpawn)
{
locations[i].base.BossLocationSpawn[x].BossChance = this.modConfig.bossChance.chance;
}
locations[i].base.BossLocationSpawn[x].BossChance = this.modConfig.bossChance.chance;
}
}
}
@ -200,9 +208,9 @@ export class Bots
const pmcConfig = this.botConfig.pmc;
const modConfig = this.modConfig.pmc;
pmcConfig.looseWeaponInBackpackChancePercent = modConfig.looseWeaponInBackpackChance;
pmcConfig.looseWeaponInBackpackLootMinMax.min = modConfig.looseWeaponInBackpackLoot.min;
pmcConfig.looseWeaponInBackpackLootMinMax.max = modConfig.looseWeaponInBackpackLoot.max;
pmcConfig.looseWeaponInBackpackChancePercent = modConfig.looseWeaponInBackpackChancePercent;
pmcConfig.looseWeaponInBackpackLootMinMax.min = modConfig.looseWeaponInBackpackLootMinMax.min;
pmcConfig.looseWeaponInBackpackLootMinMax.max = modConfig.looseWeaponInBackpackLootMinMax.max;
}
}

View File

@ -1,7 +1,7 @@
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { FleaConfig } from "../config/ts/flea";
import { Logger } from "./logger";
export class Flea
{
@ -25,20 +25,35 @@ export class Flea
const global = this.tables.getTables().globals;
const ragfair = this.ragfairConfig.dynamic;
if (mod.minUserLevel != 15)
if (mod.runIntervalSeconds != this.ragfairConfig.runIntervalSeconds)
{
this.ragfairConfig.runIntervalSeconds = mod.runIntervalSeconds;
this.logger.info(`Run Interval Seconds patched to ${mod.runIntervalSeconds} seconds`);
}
if (mod.minUserLevel != global.config.RagFair.minUserLevel)
{
global.config.RagFair.minUserLevel = mod.minUserLevel;
this.logger.info(`Fleamarket unlocked at level ${mod.minUserLevel}`)
}
if (!mod.blacklist.enableBsgList || !mod.blacklist.enableQuestList)
if (!mod.blacklist.enableBsgList)
{
ragfair.blacklist.enableBsgList = mod.blacklist.enableBsgList;
ragfair.blacklist.enableQuestList = mod.blacklist.enableQuestList;
ragfair.blacklist.enableBsgList = false;
this.logger.info("Fleamarket Blacklists patched");
}
if (mod.condition.conditionChance != 0.2 || mod.condition.min != 0.6 || mod.condition.max != 1)
if (!mod.blacklist.enableQuestList)
{
ragfair.blacklist.enableQuestList = false;
this.logger.info("Fleamarket Blacklists patched");
}
if (mod.condition.conditionChance != ragfair.condition.conditionChance || mod.condition.min != ragfair.condition.min || mod.condition.max != ragfair.condition.max)
{
ragfair.condition.conditionChance = mod.condition.conditionChance;
ragfair.condition.min = mod.condition.min;
@ -46,7 +61,8 @@ export class Flea
this.logger.info("Fleamarket Condition patched");
}
if (mod.currencies.roubles != 78 || mod.currencies.dollars != 20 || mod.currencies.euros != 2)
if (mod.currencies.roubles != ragfair.currencies.roubles || mod.currencies.dollars != ragfair.currencies.dollars || mod.currencies.euros != ragfair.currencies.euros)
{
ragfair.currencies["5449016a4bdc2d6f028b456f"] = mod.currencies.roubles;
ragfair.currencies["5696686a4bdc2da3298b456a"] = mod.currencies.dollars;
@ -54,26 +70,30 @@ export class Flea
this.logger.info("Fleamarket Currencies patched")
}
if (mod.offerItemCount.min != 8 || mod.offerItemCount.max != 15)
if (mod.offerItemCount.min != ragfair.offerItemCount.min || mod.offerItemCount.max != ragfair.offerItemCount.max)
{
ragfair.offerItemCount.min = mod.offerItemCount.min;
ragfair.offerItemCount.max = mod.offerItemCount.max;
this.logger.info("Fleamarket Offer Item Count patched");
}
if (mod.reputation.gain != 0.0000002 || mod.reputation.loss != 0.0000002)
if (mod.reputation.gain != this.ragfairConfig.sell.reputation.gain || mod.reputation.loss != this.ragfairConfig.sell.reputation.loss)
{
ragfair.offerItemCount.min = mod.offerItemCount.min;
ragfair.offerItemCount.max = mod.offerItemCount.max;
this.logger.info("Fleamarket Reputation patched");
}
if (mod.time.baseSellTime != 15 || mod.time.minSellTime != 5 || mod.time.maxSellTime != 15)
if (mod.time.baseSellTime != this.ragfairConfig.sell.time.base || mod.time.minSellTime != this.ragfairConfig.sell.time.min || mod.time.maxSellTime != this.ragfairConfig.sell.time.max)
{
const sell = this.ragfairConfig.sell;
sell.time.base = mod.time.baseSellTime;
sell.time.min = mod.time.minSellTime;
sell.time.max = mod.time.maxSellTime;
const sell = this.ragfairConfig.sell.time;
const mod = this.modConfig.time;
sell.base = mod.baseSellTime;
sell.min = mod.minSellTime;
sell.max = mod.maxSellTime;
this.logger.info("Fleamarket Sell Times patched");
}
}

View File

@ -1,20 +1,20 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { HideoutConfig } from "../config/ts/hideout";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { HideoutConfig } from "../config/ts/hideout";
import { Logger } from "./logger";
export class Hideout
{
private modConfig: HideoutConfig = require("../config/hideout.json")
private logger: Logger;
private tables: DatabaseServer;
private hideout: IHideoutConfig;
private hideoutConfig: IHideoutConfig;
constructor(logger: Logger, databaseServer: DatabaseServer, hideout: IHideoutConfig)
constructor(logger: Logger, databaseServer: DatabaseServer, hideoutConfig: IHideoutConfig)
{
this.logger = logger;
this.tables = databaseServer;
this.hideout = hideout;
this.hideoutConfig = hideoutConfig;
}
public updateHideout(): void
@ -38,18 +38,6 @@ export class Hideout
this.updateScavCase();
this.logger.info(`Scav Case Time Patched to ${mod.scavCaseTime}`);
}
if (mod.airFilterUnitFlowRate != 0.0047222222222222
||mod.generatorFuelFlowRate != 0.0013194444444444
||mod.gpuBoostRate != 0.015)
{
this.hideout.airFilterUnitFlowRate = mod.airFilterUnitFlowRate;
this.hideout.generatorFuelFlowRate = mod.generatorFuelFlowRate;
this.hideout.gpuBoostRate = mod.gpuBoostRate;
this.logger.info(`Air Filter Flow Rate set to ${mod.airFilterUnitFlowRate}`);
this.logger.info(`Generator Fuel Flow Rate set to ${mod.generatorFuelFlowRate}`);
this.logger.info(`GPU Boost Rate set to ${mod.gpuBoostRate}`);
}
}
private updateConstructionTime()

View File

@ -25,7 +25,7 @@ export class Insurance
{
const mod = this.modConfig;
if (mod.blacklistedEquipment != ["Scabbard", "SecuredContainer", "Compass", "ArmBand"])
if (mod.blacklistedEquipment != this.insuranceConfig.blacklistedEquipment)
{
this.insuranceConfig.blacklistedEquipment = mod.blacklistedEquipment;
this.logger.info("Insurance Blacklitsed Equipment Patched");

View File

@ -39,13 +39,20 @@ export class Locations
this.logger.info("No Extract Restrictions Enabled");
}
// Make all extractions of the map available regardless of the infill
// Make all extractions of the map available regardless of the infil
if (mod.extractionsExtended)
{
this.extractionsExtended();
this.logger.info("Extractions Are Extended");
}
// Enables co-op extractions (PMC w/ Scav)
if (mod.enableCoopExtracts)
{
this.coopExtractsEnabled();
this.logger.info("Coop Extracts Are Enabled");
}
// Remove the access key "5c94bbff86f7747ee735c08f" (Labs access card) from Labs.
if (mod.freeLabsEntry)
{
@ -108,11 +115,32 @@ export class Locations
{
for (const x in locations[i].base.exits)
{
if (locations[i].base.exits[x].Name !== "EXFIL_Train" &&
!locations[i].base.exits[x].Name.includes("lab") ||
locations[i].base.exits[x].Name === "lab_Vent")
if (locations[i].base.exits[x].Name !== "EXFIL_Train")
{
if (locations[i].base.exits[x].PassageRequirement !== "None")
if (locations[i].base.exits[x].Chance !== 100)
{
locations[i].base.exits[x].Chance = 100;
}
}
}
}
}
}
private coopExtractsEnabled(): void
{
const locations = this.tables.getTables().locations;
for (const i in locations)
{
if (i !== "base")
for (const x in locations[i].base.exits)
{
if (locations[i].base.exits[x].Name !== "EXFIL_Train" &&
!locations[i].base.exits[x].Name.includes("lab") ||
locations[i].base.exits[x].Name === "lab_Vent")
{
if (locations[i].base.exits[x].PassageRequirement === "ScavCooperation")
{
locations[i].base.exits[x].PassageRequirement = "None";
}
@ -138,9 +166,8 @@ export class Locations
}
}
}
}
}
}
private extractionsExtended(): void
@ -177,6 +204,12 @@ export class Locations
locations[map].base.exits[extract].EntryPoints = "House,Old Station";
}
break;
case "lighthouse":
for (const extract in locations[map].base.exits)
{
locations[map].base.exits[extract].EntryPoints = "Tunnel, North"
}
break;
default:
break;
}

View File

@ -21,7 +21,7 @@ export class Loot
{
const mod = this.modConfig;
if (mod.looseLootMultiplier > 1)
if (mod.looseLootMultiplier != 1)
{
for (const map in this.locationConfig.looseLootMultiplier)
{
@ -30,7 +30,7 @@ export class Loot
this.logger.info(`Loose Loot Multiplier: ${mod.looseLootMultiplier}`);
}
if (mod.staticLootMultiplier > 1)
if (mod.staticLootMultiplier != 1)
{
for (const map in this.locationConfig.staticLootMultiplier)
{
@ -55,27 +55,29 @@ export class Loot
{
// Customs Marked Room Loot.
let spawnPoints = this.tables.getTables().locations.bigmap.looseLoot.spawnpoints;
const cstmsmarked1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)1203364");
const cstmsmarked2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (9)1198014");
const cstmsmarked3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (8)1207194");
const customsMarked1 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (10)"));
const customsMarked2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (9)"));
const customsMarked3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (8)"));
cstmsmarked1.itemDistribution.push(...this.containers());
cstmsmarked2.itemDistribution.push(...this.containers());
cstmsmarked3.itemDistribution.push(...this.containers());
// Pushing containers into the customs marked room loot pool.
customsMarked1.itemDistribution.push(...this.containers());
customsMarked2.itemDistribution.push(...this.containers());
customsMarked3.itemDistribution.push(...this.containers());
// Reserve Marked Room Loot.
spawnPoints = this.tables.getTables().locations.rezervbase.looseLoot.spawnpoints;
const rsrvRBBK1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)49516");
const rsrvRBBK2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (8)69186");
const rsrvRBBK3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (9)39600");
const rsrvRBBK1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)51646628");
const rsrvRBBK2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (8)"));
const rsrvRBBK3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (9)"));
const rsrvRBPKPM1 = spawnPoints.find(x=>x.template.Id==="cult_Loot 135 (11)56822");
const rsrvRBPKPM2 = spawnPoints.find(x=>x.template.Id==="cult_Loot 135 (12)56254");
const rsrvRBPKPM1 = spawnPoints.find(x=>x.template.Id.startsWith("cult_Loot 135 (11)"));
const rsrvRBPKPM2 = spawnPoints.find(x=>x.template.Id.startsWith("cult_Loot 135 (12)"));
const rsrvRBVO1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)60780");
const rsrvRBVO2 = spawnPoints.find(x=>x.template.Id==="Loot 135 (11)55578");
const rsrvRBVO3 = spawnPoints.find(x=>x.template.Id==="Loot 135 (12)55522");
const rsrvRBVO1 = spawnPoints.find(x=>x.template.Id==="Loot 135 (10)51658080");
const rsrvRBVO2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (11)"));
const rsrvRBVO3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135 (12)"));
// Pushing containers into the reserve base marked room loot pool.
rsrvRBBK1.itemDistribution.push(...this.containers());
rsrvRBBK2.itemDistribution.push(...this.containers());
rsrvRBBK3.itemDistribution.push(...this.containers());
@ -86,6 +88,45 @@ export class Loot
rsrvRBVO1.itemDistribution.push(...this.containers());
rsrvRBVO2.itemDistribution.push(...this.containers());
rsrvRBVO3.itemDistribution.push(...this.containers());
// Streets Marked Room Loot.
spawnPoints = this.tables.getTables().locations.tarkovstreets.looseLoot.spawnpoints;
const streets = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare5491814");
const streets1 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (1)"));
const streets2 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (2)"));
const streets3 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (3)"));
const streets4 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (4)"));
const streets5 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (5)"));
const streets6 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (6)3814146");
const streets6a = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (6)3955044");
const streets7 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (7)"));
const streets8 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (8)"));
const streets9 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (9)"));
const streets10 = spawnPoints.find(x=>x.template.Id==="Loot 135_Leo_Rare (10)5484984");
const streets11 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (11)"));
const streets12 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (12)"));
const streets13 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (13)"));
const streets14 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (14)"));
const streets15 = spawnPoints.find(x=>x.template.Id.startsWith("Loot 135_Leo_Rare (15)"));
// Pushing containers into the streets marked room loot pool.
streets.itemDistribution.push(...this.containers());
streets1.itemDistribution.push(...this.containers());
streets2.itemDistribution.push(...this.containers());
streets3.itemDistribution.push(...this.containers());
streets4.itemDistribution.push(...this.containers());
streets5.itemDistribution.push(...this.containers());
streets6.itemDistribution.push(...this.containers());
streets6a.itemDistribution.push(...this.containers());
streets7.itemDistribution.push(...this.containers());
streets8.itemDistribution.push(...this.containers());
streets9.itemDistribution.push(...this.containers());
streets10.itemDistribution.push(...this.containers());
streets11.itemDistribution.push(...this.containers());
streets12.itemDistribution.push(...this.containers());
streets13.itemDistribution.push(...this.containers());
streets14.itemDistribution.push(...this.containers());
streets15.itemDistribution.push(...this.containers());
}
private containers(): any[]
@ -102,7 +143,11 @@ export class Loot
* Medicine case: 5aafbcd986f7745e590fff23
* Lucky scav junkbox: 5b7c710788a4506dec015957
* Grenade case: 5e2af55f86f7746d4159f07c
* Secure container: 5448bf274bdc2dfc2f8b456a
* Secure container Gamma: 5857a8bc2459772bad15db29
* Secure container Beta: 5857a8b324597729ab0a0e7d
* Secure container Alpha: 544a11ac4bdc2d470e8b456a
* Secure container Epsilon: 59db794186f77448bc595262
* Secure container Kappa: 5c093ca986f7740a1867ab12
*/
const lootItems = [];
@ -117,7 +162,11 @@ export class Loot
lootItems.push({"tpl": "5aafbcd986f7745e590fff23", "relativeProbability": 30});
lootItems.push({"tpl": "5b7c710788a4506dec015957", "relativeProbability": 15});
lootItems.push({"tpl": "5e2af55f86f7746d4159f07c", "relativeProbability": 23});
lootItems.push({"tpl": "5448bf274bdc2dfc2f8b456a", "relativeProbability": 9});
lootItems.push({"tpl": "5857a8bc2459772bad15db29", "relativeProbability": 3});
lootItems.push({"tpl": "5857a8b324597729ab0a0e7d", "relativeProbability": 3});
lootItems.push({"tpl": "544a11ac4bdc2d470e8b456a", "relativeProbability": 3});
lootItems.push({"tpl": "59db794186f77448bc595262", "relativeProbability": 3});
lootItems.push({"tpl": "5c093ca986f7740a1867ab12", "relativeProbability": 1});
return lootItems;
}

View File

@ -1,38 +1,38 @@
import { DependencyContainer } from "tsyringe";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
//import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { IAirdropConfig } from "@spt-aki/models/spt/config/IAirdropConfig";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { DependencyContainer } from "tsyringe";
import { Config } from "../config/ts/config";
import { Airdrop } from "./airdrop";
import { Ammo } from "./ammo";
import { Armor } from "./armor";
import { Bots } from "./bots";
import { Flea } from "./flea";
import { Hideout } from "./hideout";
import { Items } from "./items";
import { Loot } from "./loot";
import { Raid } from "./raid";
import { Globals } from "./globals";
import { Insurance } from "./insurance";
import { Logger } from "./logger";
import { Config } from "../config/ts/config";
import { Weapons } from "./weapons";
import { Containers } from "./containers";
import { Flea } from "./flea";
import { Globals } from "./globals";
import { Hideout } from "./hideout";
import { Insurance } from "./insurance";
import { Items } from "./items";
import { Locations } from "./locations";
import { Quests } from "./quests";
import { Skills } from "./skills";
import { Logger } from "./logger";
import { Loot } from "./loot";
import { Prewipe } from "./prewipe";
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
import { Quests } from "./quests";
import { Raid } from "./raid";
import { Skills } from "./skills";
import { Traders } from "./traders";
import { ITraderConfig } from "@spt-aki/models/spt/config/ITraderConfig";
//import { Airdrop } from "./airdrop";
import { Weapons } from "./weapons";
class ValensAIO implements IPostDBLoadMod
{
@ -44,10 +44,10 @@ class ValensAIO implements IPostDBLoadMod
private insuranceConfig: IInsuranceConfig;
private locationConfig: ILocationConfig;
private ragfairConfig: IRagfairConfig;
//private airdropConfig: IAirdropConfig;
private airdropConfig: IAirdropConfig;
private inRaidConfig: IInRaidConfig;
private weightedRandomHelper : WeightedRandomHelper;
private hideout: IHideoutConfig
private hideoutConfig: IHideoutConfig
private traderConfig: ITraderConfig;
public postDBLoad(container: DependencyContainer): void
@ -63,11 +63,13 @@ class ValensAIO implements IPostDBLoadMod
this.botConfig = this.configServer.getConfig<IBotConfig>(ConfigTypes.BOT);
this.inRaidConfig = this.configServer.getConfig<IInRaidConfig>(ConfigTypes.IN_RAID);
this.insuranceConfig = this.configServer.getConfig<IInsuranceConfig>(ConfigTypes.INSURANCE);
this.hideout = this.configServer.getConfig<IHideoutConfig>(ConfigTypes.HIDEOUT);
this.hideoutConfig = this.configServer.getConfig<IHideoutConfig>(ConfigTypes.HIDEOUT);
this.traderConfig = this.configServer.getConfig<ITraderConfig>(ConfigTypes.TRADER);
this.airdropConfig = this.configServer.getConfig<IAirdropConfig>(ConfigTypes.AIRDROP);
//const airdrop = new Airdrop(this.logger, this.airdropConfig, this.databaseServer)
//airdrop.updateAirdrops();
const airdrops = new Airdrop(vLogger, this.databaseServer, this.airdropConfig);
airdrops.updateAirdrops();
const ammo = new Ammo(vLogger, this.databaseServer);
ammo.updateAmmo();
@ -87,7 +89,7 @@ class ValensAIO implements IPostDBLoadMod
const globals = new Globals(vLogger, this.databaseServer);
globals.updateGlobals();
const hideout = new Hideout(vLogger, this.databaseServer, this.hideout);
const hideout = new Hideout(vLogger, this.databaseServer, this.hideoutConfig);
hideout.updateHideout();
const insurance = new Insurance(vLogger, this.insuranceConfig, this.databaseServer);

View File

@ -158,7 +158,7 @@ export class Prewipe
for (const trader in this.traders)
{
for (const assort in this.traders[trader].assort.barter_scheme)
for (const assort in this.traders[trader]?.assort?.barter_scheme)
{
const itemScheme = this.traders[trader].assort.barter_scheme[assort];
switch (itemScheme[0][0]._tpl)

View File

@ -27,9 +27,12 @@ export class Quests
private onlyFoundInRaid(): void
{
const quests = this.tables.getTables().templates.quests;
Object.values(quests).forEach(quest => {
quest.conditions.AvailableForFinish.forEach((prop, index) => {
if (prop._parent == 'FindItem' || prop._parent == 'HandoverItem') {
Object.values(quests).forEach(quest =>
{
quest.conditions.AvailableForFinish.forEach((prop, index) =>
{
if (prop._parent == "FindItem" || prop._parent == "HandoverItem")
{
prop._props.onlyFoundInRaid = false;
quest.conditions.AvailableForFinish[index] = prop;
}

View File

@ -1,7 +1,7 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { Logger } from "./logger";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { RaidConfig } from "../config/ts/raid";
import { Logger } from "./logger";
export class Raid
{
@ -33,7 +33,7 @@ export class Raid
this.logger.info(`Chompies Boss Fix: ${mod.chompiesBossFix}.`)
}
if (mod.timeLimit)
if (mod.timeLimit.enabled)
{
const maps = this.tables.getTables().locations;
@ -41,14 +41,14 @@ export class Raid
{
if (this.tables.getTables().locations[map].base?.EscapeTimeLimit)
{
this.tables.getTables().locations[map].base.EscapeTimeLimit = this.modConfig.timeLimit;
this.tables.getTables().locations[map].base.EscapeTimeLimit = this.modConfig.timeLimit.raidTime;
}
}
this.logger.info(`Raid Time Limits set to ${mod.timeLimit} minutes.`);
this.logger.info(`Raid Time Limits set to ${mod.timeLimit.raidTime} minutes.`);
}
if (mod.aiAmount.toLowerCase() != "asonline" ||mod.aiDifficulty.toLowerCase() != "asonline" ||mod.bossEnabled != true
||mod.scavWars != false ||mod.taggedAndCursed != false ||mod.enablePve != false)
if (mod.aiAmount.toLowerCase() != this.inRaidConfig.raidMenuSettings.aiAmount || mod.aiDifficulty.toLowerCase() != this.inRaidConfig.raidMenuSettings.aiDifficulty || mod.bossEnabled != true
|| mod.scavWars != this.inRaidConfig.raidMenuSettings.scavWars || mod.taggedAndCursed != this.inRaidConfig.raidMenuSettings.taggedAndCursed || mod.enablePve != this.inRaidConfig.raidMenuSettings.enablePve)
{
const inRaidConfig = this.inRaidConfig;
@ -66,13 +66,13 @@ export class Raid
this.logger.info(`Enable PvE set to ${mod.enablePve}`);
}
if (mod.carExtractBaseStandingGain != 0.25)
if (mod.carExtractBaseStandingGain != this.inRaidConfig.carExtractBaseStandingGain)
{
this.inRaidConfig.carExtractBaseStandingGain = mod.carExtractBaseStandingGain;
this.logger.info(`Car Extract Base Standing Gain set to ${mod.carExtractBaseStandingGain}`);
}
if (mod.scavExtractGain != 0.01)
if (mod.scavExtractGain != this.inRaidConfig.scavExtractGain)
{
this.inRaidConfig.scavExtractGain = mod.scavExtractGain;
this.logger.info(`Scav Extract Gain set to ${mod.scavExtractGain}`);

View File

@ -20,23 +20,34 @@ export class Traders
public updateTraders(): void
{
const mod = this.modConfig;
const trader = this.traderConfig;
if (mod.updateTime.enabled)
{
this.updateTime();
}
if (mod.traderPriceMultipler != 1)
if (trader.updateTimeDefault != mod.updateTimeDefault)
{
trader.updateTimeDefault = mod.updateTimeDefault;
}
if (trader.traderPriceMultipler != mod.traderPriceMultipler)
{
this.traderPriceMultiplier();
}
if (mod.minDurabilityForSale != 60)
if (trader.durabilityPurchaseThreshhold != mod.durabilityPurchaseThreshhold)
{
this.minDurabilityForSale();
}
if (mod.fence.partialRefreshTimeSeconds != 240 || mod.fence.partialRefreshChangePercent != 15 || mod.fence.assortSize != 100 || mod.fence.maxPresetsPercent != 5 || mod.fence.presetPriceMult != 2.5 || mod.fence.blacklist != this.traderConfig.fence.blacklist)
if (trader.persistPurchaseDataInProfile != mod.persistPurchaseDataInProfile)
{
trader.persistPurchaseDataInProfile = mod.persistPurchaseDataInProfile;
}
if (trader.fence != mod.fence)
{
this.updateFence();
}
@ -62,19 +73,27 @@ export class Traders
{
const mod = this.modConfig;
const trader = this.traderConfig;
trader.minDurabilityForSale = mod.minDurabilityForSale;
this.logger.info(`Min Durability For Sale Set to ${mod.minDurabilityForSale}`);
trader.durabilityPurchaseThreshhold = mod.durabilityPurchaseThreshhold;
this.logger.info(`Min Durability For Sale Set to ${mod.durabilityPurchaseThreshhold}`);
}
private updateFence(): void
{
const mod = this.modConfig.fence;
const trader = this.traderConfig.fence;
// Start updating Fence config.
trader.partialRefreshTimeSeconds = mod.partialRefreshTimeSeconds;
trader.partialRefreshChangePercent = mod.partialRefreshChangePercent;
trader.assortSize = mod.assortSize;
trader.discountOptions.assortSize = mod.assortSize;
trader.maxPresetsPercent = mod.maxPresetsPercent;
trader.presetPriceMult = mod.presetPriceMult;
trader.discountOptions.itemPriceMult = mod.itemPriceMult;
trader.discountOptions.presetPriceMult = mod.presetPriceMult;
trader.regenerateAssortsOnRefresh = mod.regenerateAssortsOnRefresh;
trader.itemTypeLimits = mod.itemTypeLimits;
trader.presetMaxDurabilityPercentMinMax = mod.presetMaxDurabilityPercentMinMax;
trader.armorMaxDurabilityPercentMinMax = mod.armorMaxDurabilityPercentMinMax;
trader.blacklist = mod.blacklist;
this.logger.info("Fence Has Been Patched");
}

View File

@ -1,6 +1,8 @@
import { Config, IGlobals } from "@spt-aki/models/eft/common/IGlobals";
import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { WeaponsConfig } from "../config/ts/weapons";
import { GlobalsConfig } from "../config/ts/globals;
import { Logger } from "./logger";
export class Weapons
@ -8,7 +10,8 @@ export class Weapons
private modConfig: WeaponsConfig = require("../config/weapons.json")
private logger: Logger;
private tables: DatabaseServer;
private weapons: any;
private weapons: IDatabaseTables;
private globals: IGlobals;
constructor(logger:Logger, databaseServer: DatabaseServer)
{
@ -20,7 +23,7 @@ export class Weapons
{
const mod = this.modConfig;
this.weapons = this.tables.getTables().templates.items;
const global = this.tables.getTables().globals;
this.globals = this.tables.getTables().globals;
if (mod.malfunctions.overheat || mod.malfunctions.jam || mod.malfunctions.slide || mod.malfunctions.misfeed || mod.malfunctions.misfire)
{
@ -82,23 +85,24 @@ export class Weapons
private recoilTweaks(): void
{
const weapons = this.tables.getTables().templates.items;
const globals = this.tables.getTables().globals.config;
const weapons: IDatabaseTables = this.weapons;
const globals: Config = this.globals.config;
for (let weapon in weapons) {
let fileData = weapons[weapon];
if (fileData._props.weapClass != null && fileData._props.weapClass !== undefined)
for (const weapon in weapons)
{
const weaponData: ITemplateItem = weapons[weapon];
if (weaponData._props.weapClass != null && weaponData._props.weapClass !== undefined)
{
if (fileData._props.weapClass !== "pistol")
{
fileData._props.CameraRecoil *= 0.25;
fileData._props.CameraSnap = 3.5;
}
else
{
fileData._props.CameraRecoil *= 0.45;
fileData._props.CameraSnap = 3.5;
}
if (weaponData._props.weapClass !== "pistol")
{
weaponData._props.CameraRecoil *= 0.25;
weaponData._props.CameraSnap = 3.5;
}
else
{
weaponData._props.CameraRecoil *= 0.45;
weaponData._props.CameraSnap = 3.5;
}
}
}
globals.Aiming.RecoilCrank = true;

6
types/ErrorHandler.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
export declare class ErrorHandler {
private logger;
private readLine;
constructor();
handleCriticalError(err: any): void;
}

1
types/Program.d.ts vendored
View File

@ -1,4 +1,5 @@
export declare class Program {
private errorHandler;
constructor();
start(): void;
}

View File

@ -8,8 +8,29 @@ export declare class BotCallbacks {
protected botController: BotController;
protected httpResponse: HttpResponseUtil;
constructor(botController: BotController, httpResponse: HttpResponseUtil);
/**
* Handle singleplayer/settings/bot/limit
* @returns string
*/
getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle singleplayer/settings/bot/difficulty
* @returns string
*/
getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle client/game/bot/generate
* @returns IGetBodyResponseData
*/
generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): IGetBodyResponseData<IBotBase[]>;
/**
* Handle singleplayer/settings/bot/maxCap
* @returns string
*/
getBotCap(): string;
/**
* Handle singleplayer/settings/bot/getBotBehaviours
* @returns string
*/
getBotBehaviours(): string;
}

View File

@ -1,17 +1,17 @@
import { BundleLoader } from "../loaders/BundleLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { IHttpServer } from "../models/spt/server/IHttpServer";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class BundleCallbacks {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpServer: IHttpServer;
protected httpFileUtil: HttpFileUtil;
protected bundleLoader: BundleLoader;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, bundleLoader: BundleLoader, configServer: ConfigServer);
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, bundleLoader: BundleLoader, configServer: ConfigServer);
sendBundle(sessionID: string, req: any, resp: any, body: any): any;
getBundles(url: string, info: any, sessionID: string): string;
getBundle(url: string, info: any, sessionID: string): string;

View File

@ -3,6 +3,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ISuit } from "../models/eft/common/tables/ITrader";
import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothingRequestData";
import { IGetSuitsResponse } from "../models/eft/customization/IGetSuitsResponse";
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
@ -13,10 +14,15 @@ export declare class CustomizationCallbacks {
protected saveServer: SaveServer;
protected httpResponse: HttpResponseUtil;
constructor(customizationController: CustomizationController, saveServer: SaveServer, httpResponse: HttpResponseUtil);
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<{
_id: string;
suites: string[];
}>;
/**
* Handles client/trading/customization/storage
* @returns
*/
getSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetSuitsResponse>;
/**
* Handles client/trading/customization
* @returns ISuit[]
*/
getTraderSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISuit[]>;
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -1,32 +1,74 @@
import { HideoutController } from "../controllers/HideoutController";
import { RagfairController } from "../controllers/RagfairController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGlobals } from "../models/eft/common/IGlobals";
import { ICustomizationItem } from "../models/eft/common/tables/ICustomizationItem";
import { IHandbookBase } from "../models/eft/common/tables/IHandbookBase";
import { IQuest } from "../models/eft/common/tables/IQuest";
import { IGetItemPricesResponse } from "../models/eft/game/IGetItemPricesResponse";
import { IHideoutArea } from "../models/eft/hideout/IHideoutArea";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { IHideoutSettingsBase } from "../models/eft/hideout/IHideoutSettingsBase";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { ILanguageBase } from "../models/spt/server/ILocaleBase";
import { ISettingsBase } from "../models/spt/server/ISettingsBase";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
/**
* Handle client requests
*/
export declare class DataCallbacks {
protected httpResponse: HttpResponseUtil;
protected databaseServer: DatabaseServer;
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer);
protected ragfairController: RagfairController;
protected hideoutController: HideoutController;
constructor(httpResponse: HttpResponseUtil, databaseServer: DatabaseServer, ragfairController: RagfairController, hideoutController: HideoutController);
/**
* Handles client/settings
* @returns ISettingsBase
*/
getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>;
/**
* Handles client/globals
* @returns IGlobals
*/
getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>;
/**
* Handles client/items
* @returns string
*/
getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string;
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
/**
* Handles client/handbook/templates
* @returns IHandbookBase
*/
getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase>;
/**
* Handles client/customization
* @returns Record<string, ICustomizationItem
*/
getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>>;
/**
* Handles client/account/customization
* @returns string[]
*/
getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>;
getTemplateQuests(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase>;
getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]>;
gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]>;
getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]>;
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILanguageBase[]>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>>;
getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>;
getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle client/hideout/qte/list
*/
getQteList(url: string, info: IEmptyRequestData, sessionID: string): string;
/**
* Handle client/items/prices/
* Called when viewing a traders assorts
* TODO - fully implement this
*/
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse>;
}

View File

@ -1,6 +1,7 @@
import { DialogueController } from "../controllers/DialogueController";
import { OnUpdate } from "../di/OnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IChatServer } from "../models/eft/dialog/IChatServer";
import { IFriendRequestData } from "../models/eft/dialog/IFriendRequestData";
import { IGetAllAttachmentsRequestData } from "../models/eft/dialog/IGetAllAttachmentsRequestData";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
@ -20,26 +21,38 @@ import { DialogueInfo } from "../models/eft/profile/IAkiProfile";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class DialogueCallbacks extends OnUpdate {
export declare class DialogueCallbacks implements OnUpdate {
protected hashUtil: HashUtil;
protected timeUtil: TimeUtil;
protected httpResponse: HttpResponseUtil;
protected dialogueController: DialogueController;
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, dialogueController: DialogueController);
/**
* Handles client/friend/list
* @returns IGetFriendListDataResponse
*/
getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse>;
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<any[]>;
/**
* Handles client/chatServer/list
* @returns
*/
getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]>;
getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData>;
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<any>;
getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo>;
removeDialog(url: string, info: IRemoveDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
pinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
unpinDialog(url: string, info: IPinDialogRequestData, sessionID: string): IGetBodyResponseData<any[]>;
setRead(url: string, info: ISetDialogReadRequestData, sessionID: string): IGetBodyResponseData<any[]>;
/**
* Handles client/mail/dialog/getAllAttachments
* @returns IGetAllAttachmentsResponse
*/
getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse>;
listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>;
friendRequest(url: string, request: IFriendRequestData, sessionID: string): INullResponseData;
sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>;
onUpdate(timeSinceLastRun: number): boolean;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string;
}

View File

@ -1,8 +1,13 @@
import { GameController } from "../controllers/GameController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
import { IGameLogoutResponseData } from "../models/eft/game/IGameLogoutResponseData";
import { IGameStartResponse } from "../models/eft/game/IGameStartResponse";
import { IReportNicknameRequestData } from "../models/eft/game/IReportNicknameRequestData";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IVersionValidateRequestData } from "../models/eft/game/IVersionValidateRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
@ -13,13 +18,37 @@ declare class GameCallbacks {
protected watermark: Watermark;
protected gameController: GameController;
constructor(httpResponse: HttpResponseUtil, watermark: Watermark, gameController: GameController);
/**
* Handle client/game/version/validate
* @returns INullResponseData
*/
versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData;
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
/**
* Handle client/game/start
* @returns IGameStartResponse
*/
gameStart(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameStartResponse>;
/**
* Handle client/game/logout
* @returns IGameLogoutResponseData
*/
gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData>;
/**
* Handle client/game/config
* @returns IGameConfigResponse
*/
getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse>;
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>;
validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse>;
/**
* Handle client/game/keepalive
* @returns IGameKeepAliveResponse
*/
gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameKeepAliveResponse>;
/**
* Handle singleplayer/settings/version
* @returns string
*/
getVersion(url: string, info: IEmptyRequestData, sessionID: string): string;
reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData;
}

View File

@ -1,8 +1,8 @@
import { HandbookController } from "../controllers/HandbookController";
import { OnLoad } from "../di/OnLoad";
export declare class HandbookCallbacks extends OnLoad {
export declare class HandbookCallbacks implements OnLoad {
protected handbookController: HandbookController;
constructor(handbookController: HandbookController);
onLoad(): void;
onLoad(): Promise<void>;
getRoute(): string;
}

View File

@ -7,6 +7,7 @@ import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealReques
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class HealthCallbacks {
protected httpResponse: HttpResponseUtil;
@ -21,7 +22,27 @@ export declare class HealthCallbacks {
* @returns empty response, no data sent back to client
*/
syncHealth(url: string, info: ISyncHealthRequestData, sessionID: string): IGetBodyResponseData<string>;
/**
* Custom aki server request found in modules/QTEPatch.cs
* @param url
* @param info HealthListener.Instance.CurrentHealth class
* @param sessionID session id
* @returns empty response, no data sent back to client
*/
handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData<string>;
/**
* Handle Eat
* @returns IItemEventRouterResponse
*/
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle Heal
* @returns IItemEventRouterResponse
*/
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle RestoreHealth
* @returns IItemEventRouterResponse
*/
healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,7 +1,9 @@
import { HideoutController } from "../controllers/HideoutController";
import { OnUpdate } from "../di/OnUpdate";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
import { IHideoutSingleProductionStartRequestData } from "../models/eft/hideout/IHideoutSingleProductionStartRequestData";
@ -10,24 +12,64 @@ import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideou
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeCompleteRequestData } from "../models/eft/hideout/IHideoutUpgradeCompleteRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ConfigServer } from "../servers/ConfigServer";
export declare class HideoutCallbacks extends OnUpdate {
export declare class HideoutCallbacks implements OnUpdate {
protected hideoutController: HideoutController;
protected configServer: ConfigServer;
protected hideoutConfig: IHideoutConfig;
constructor(hideoutController: HideoutController, // TODO: delay needed
configServer: ConfigServer);
/**
* Handle HideoutUpgrade
*/
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutUpgradeComplete
*/
upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
*/
putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutTakeItemsFromAreaSlots
*/
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutToggleArea
*/
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutSingleProductionStart
*/
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutScavCaseProductionStart
*/
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutContinuousProductionStart
*/
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutTakeProduction
*/
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): boolean;
/**
* Handle HideoutQuickTimeEvent
*/
handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - RecordShootingRangePoints
*/
improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string;
}

View File

@ -1,9 +1,9 @@
import { OnLoad } from "../di/OnLoad";
import { IHttpServer } from "../models/spt/server/IHttpServer";
export declare class HttpCallbacks extends OnLoad {
protected httpServer: IHttpServer;
constructor(httpServer: IHttpServer);
onLoad(): void;
import { HttpServer } from "../servers/HttpServer";
export declare class HttpCallbacks implements OnLoad {
protected httpServer: HttpServer;
constructor(httpServer: HttpServer);
onLoad(): Promise<void>;
getRoute(): string;
getImage(): string;
}

View File

@ -1,23 +1,49 @@
import { InraidController } from "../controllers/InraidController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { INullResponseData } from "../models/eft/httpResponse/INullResponseData";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
/**
* Handle client requests
*/
export declare class InraidCallbacks {
protected inraidController: InraidController;
protected httpResponse: HttpResponseUtil;
protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
protected inraidConfig: IInRaidConfig;
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil, configServer: ConfigServer);
constructor(inraidController: InraidController, httpResponse: HttpResponseUtil);
/**
* Handle client/location/getLocalloot
* @param url
* @param info register player request
* @param sessionID Session id
* @returns Null http response
*/
registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData;
/**
* Handle raid/profile/save
* @param url
* @param info Save progress request
* @param sessionID Session id
* @returns Null http response
*/
saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData;
/**
* Handle singleplayer/settings/raid/endstate
* @returns
*/
getRaidEndState(): string;
getRaidMenuSettings(url: string, info: IEmptyRequestData, sessionID: string): string;
getWeaponDurability(url: string, info: any, sessionID: string): string;
getAirdropConfig(url: string, info: any, sessionID: string): string;
/**
* Handle singleplayer/settings/raid/menu
* @returns JSON as string
*/
getRaidMenuSettings(): string;
/**
* Handle singleplayer/settings/weapon/durability
* @returns
*/
getWeaponDurability(): string;
/**
* Handle singleplayer/airdrop/config
* @returns JSON as string
*/
getAirdropConfig(): string;
}

View File

@ -10,15 +10,23 @@ import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ConfigServer } from "../servers/ConfigServer";
import { InsuranceService } from "../services/InsuranceService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class InsuranceCallbacks extends OnUpdate {
export declare class InsuranceCallbacks implements OnUpdate {
protected insuranceController: InsuranceController;
protected insuranceService: InsuranceService;
protected httpResponse: HttpResponseUtil;
protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig;
constructor(insuranceController: InsuranceController, insuranceService: InsuranceService, httpResponse: HttpResponseUtil, configServer: ConfigServer);
/**
* Handle client/insurance/items/list/cost
* @returns IGetInsuranceCostResponseData
*/
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
/**
* Handle Insure
* @returns IItemEventRouterResponse
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(secondsSinceLastRun: number): boolean;
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
getRoute(): string;
}

View File

@ -16,6 +16,7 @@ import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwa
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
export declare class InventoryCallbacks {
protected inventoryController: InventoryController;
@ -36,4 +37,5 @@ export declare class InventoryCallbacks {
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,4 +1,5 @@
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { Warning } from "../models/eft/itemEvent/IItemEventRouterBase";
import { IItemEventRouterRequest } from "../models/eft/itemEvent/IItemEventRouterRequest";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "../routers/ItemEventRouter";
@ -8,4 +9,5 @@ export declare class ItemEventCallbacks {
protected itemEventRouter: ItemEventRouter;
constructor(httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter);
handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse>;
protected getErrorCode(warnings: Warning[]): number;
}

View File

@ -7,10 +7,10 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData";
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData";
import { DatabaseServer } from "../servers/DatabaseServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@ -34,9 +34,13 @@ export declare class MatchCallbacks {
serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any> | IGetBodyResponseData<true>;
joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult[]>;
getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>;
/**
* Handle client/match/group/status
* @returns
*/
getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>;
createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>;
deleteGroup(url: string, info: any, sessionID: string): INullResponseData;
startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData;
endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData;
getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData;
}

View File

@ -1,22 +1,21 @@
import { OnLoad } from "../di/OnLoad";
import { PostAkiModLoader } from "../loaders/PostAkiModLoader";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { IHttpServer } from "../models/spt/server/IHttpServer";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpFileUtil } from "../utils/HttpFileUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class ModCallbacks extends OnLoad {
declare class ModCallbacks implements OnLoad {
protected logger: ILogger;
protected httpResponse: HttpResponseUtil;
protected httpServer: IHttpServer;
protected httpFileUtil: HttpFileUtil;
protected postAkiModLoader: PostAkiModLoader;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpServer: IHttpServer, postAkiModLoader: PostAkiModLoader, configServer: ConfigServer);
onLoad(): void;
constructor(logger: ILogger, httpResponse: HttpResponseUtil, httpFileUtil: HttpFileUtil, postAkiModLoader: PostAkiModLoader, localisationService: LocalisationService, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
sendBundle(sessionID: string, req: any, resp: any, body: any): void;
getBundles(url: string, info: any, sessionID: string): string;
getBundle(url: string, info: any, sessionID: string): string;
}
export { ModCallbacks };

View File

@ -4,6 +4,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { INotifierChannel } from "../models/eft/notifier/INotifier";
import { ISelectProfileRequestData } from "../models/eft/notifier/ISelectProfileRequestData";
import { ISelectProfileResponse } from "../models/eft/notifier/ISelectProfileResponse";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class NotifierCallbacks {
protected httpServerHelper: HttpServerHelper;
@ -19,6 +20,10 @@ export declare class NotifierCallbacks {
sendNotification(sessionID: string, req: any, resp: any, data: any): void;
getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>;
createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel>;
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<any>;
/**
* Handle client/game/profile/select
* @returns ISelectProfileResponse
*/
selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse>;
notify(url: string, info: any, sessionID: string): string;
}

View File

@ -1,8 +1,8 @@
import { PresetController } from "../controllers/PresetController";
import { OnLoad } from "../di/OnLoad";
export declare class PresetCallbacks extends OnLoad {
export declare class PresetCallbacks implements OnLoad {
protected presetController: PresetController;
constructor(presetController: PresetController);
onLoad(): void;
onLoad(): Promise<void>;
getRoute(): string;
}

View File

@ -21,6 +21,13 @@ export declare class QuestCallbacks {
acceptQuest(pmcData: IPmcData, body: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle client/quest/list
* @param url
* @param info
* @param sessionID
* @returns
*/
listQuests(url: string, info: IListQuestsRequestData, sessionID: string): IGetBodyResponseData<IQuest[]>;
activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]>;
}

View File

@ -1,5 +1,6 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { RagfairController } from "../controllers/RagfairController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
@ -14,7 +15,6 @@ import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferReque
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
@ -22,23 +22,26 @@ import { JsonUtil } from "../utils/JsonUtil";
/**
* Handle ragfair related callback events
*/
export declare class RagfairCallbacks extends OnLoadOnUpdate {
export declare class RagfairCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil;
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected ragfairServer: RagfairServer;
protected ragfairController: RagfairController;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(httpResponse: HttpResponseUtil, logger: ILogger, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
onLoad(): void;
constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, ragfairServer: RagfairServer, ragfairController: RagfairController, configServer: ConfigServer);
onLoad(): Promise<void>;
getRoute(): string;
search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>;
getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>;
getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse;
extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
onUpdate(timeSinceLastRun: number): boolean;
/**
* Handle /client/items/prices
* Called when clicking an item to list on flea
*/
getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>;
onUpdate(timeSinceLastRun: number): Promise<boolean>;
sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData;
}

View File

@ -6,6 +6,20 @@ import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepa
export declare class RepairCallbacks {
protected repairController: RepairController;
constructor(repairController: RepairController);
/**
* use trader to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
/**
* Use repair kit to repair item
* @param pmcData
* @param body
* @param sessionID
* @returns
*/
repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,9 +1,10 @@
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { SaveServer } from "../servers/SaveServer";
export declare class SaveCallbacks extends OnLoadOnUpdate {
export declare class SaveCallbacks implements OnLoad, OnUpdate {
protected saveServer: SaveServer;
constructor(saveServer: SaveServer);
onLoad(): void;
onLoad(): Promise<void>;
getRoute(): string;
onUpdate(secondsSinceLastRun: number): boolean;
onUpdate(secondsSinceLastRun: number): Promise<boolean>;
}

View File

@ -6,6 +6,9 @@ import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRag
export declare class TradeCallbacks {
protected tradeController: TradeController;
constructor(tradeController: TradeController);
/**
* Handle client/game/profile/items/moving TradingConfirm
*/
processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse;
processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,17 +1,22 @@
import { OnLoad } from "../di/OnLoad";
import { OnUpdate } from "../di/OnUpdate";
import { TraderController } from "../controllers/TraderController";
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class TraderCallbacks extends OnLoadOnUpdate {
export declare class TraderCallbacks implements OnLoad, OnUpdate {
protected httpResponse: HttpResponseUtil;
protected traderController: TraderController;
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
onLoad(): void;
onUpdate(): boolean;
onLoad(): Promise<void>;
onUpdate(): Promise<boolean>;
getRoute(): string;
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
/**
* Handle client/trading/api/getUserAssortPrice/trader
* @returns
*/
getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, IBarterScheme[][]>>;
getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>;
getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>;

View File

@ -1,10 +1,15 @@
import { WeatherController } from "../controllers/WeatherController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
export declare class WeatherCallbacks {
protected httpResponse: HttpResponseUtil;
protected weatherController: WeatherController;
constructor(httpResponse: HttpResponseUtil, weatherController: WeatherController);
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any>;
/**
* Handle client/weather
* @returns IWeatherData
*/
getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>;
}

View File

@ -3,6 +3,15 @@ import { ContextVariableType } from "./ContextVariableType";
export declare class ApplicationContext {
private variables;
private static holderMaxSize;
/**
* Called like:
*
* const registerPlayerInfo = this.applicationContext.getLatestValue(ContextVariableType.REGISTER_PLAYER_REQUEST).getValue<IRegisterPlayerRequestData>();
*
* const matchInfo = this.applicationContext.getLatestValue(ContextVariableType.MATCH_INFO).getValue<IStartOfflineRaidRequestData>();
* @param type
* @returns
*/
getLatestValue(type: ContextVariableType): ContextVariable;
getValues(type: ContextVariableType): ContextVariable[];
addValue(type: ContextVariableType, value: any): void;

View File

@ -4,7 +4,7 @@ export declare class ContextVariable {
private timestamp;
private type;
constructor(value: any, type: ContextVariableType);
getValue(): any;
getValue<T>(): T;
getTimestamp(): Date;
getType(): ContextVariableType;
}

View File

@ -1,4 +1,10 @@
export declare enum ContextVariableType {
/** Logged in users session id */
SESSION_ID = 0,
MATCH_INFO = 1
/** Currently acive raid information */
RAID_CONFIGURATION = 1,
/** Timestamp when client first connected */
CLIENT_START_TIMESTAMP = 2,
/** When player is loading into map and loot is requested */
REGISTER_PLAYER_REQUEST = 3
}

View File

@ -1,25 +1,44 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { BotGenerator } from "../generators/BotGenerator";
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { IBotCore } from "../models/eft/common/tables/IBotCore";
import { Difficulty } from "../models/eft/common/tables/IBotType";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { LocalisationService } from "../services/LocalisationService";
import { JsonUtil } from "../utils/JsonUtil";
export declare class BotController {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected botGenerator: BotGenerator;
protected botHelper: BotHelper;
protected botDifficultyHelper: BotDifficultyHelper;
protected botGenerationCacheService: BotGenerationCacheService;
protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
protected configServer: ConfigServer;
protected applicationContext: ApplicationContext;
protected jsonUtil: JsonUtil;
protected botConfig: IBotConfig;
constructor(databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, configServer: ConfigServer);
static readonly pmcTypeLabel = "PMC";
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, profileHelper: ProfileHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
/**
* Return the number of bot loadout varieties to be generated
* @param type bot Type we want the loadout gen count for
* @returns
* @returns number of bots to generate
*/
getBotPresetGenerationLimit(type: string): number;
/**
* Get the core.json difficulty settings from database\bots
* @returns IBotCore
*/
getBotCoreDifficulty(): IBotCore;
/**
* Get bot difficulty settings
@ -29,7 +48,24 @@ export declare class BotController {
* @returns Difficulty object
*/
getBotDifficulty(type: string, difficulty: string): Difficulty;
protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string): Difficulty;
/**
* Generate bot profiles and store in cache
* @param sessionId Session id
* @param info bot generation request info
* @returns IBotBase array
*/
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/**
* Get the difficulty passed in, if its not "asoline", get selected difficulty from config
* @param requestedDifficulty
* @returns
*/
getPMCDifficulty(requestedDifficulty: string): string;
/**
* Get the max number of bots allowed on a map
* Looks up location player is entering when getting cap value
* @returns cap number
*/
getBotCap(): number;
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
}

View File

@ -5,16 +5,18 @@ import { IBuyClothingRequestData } from "../models/eft/customization/IBuyClothin
import { IWearClothingRequestData } from "../models/eft/customization/IWearClothingRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
export declare class CustomizationController {
protected logger: ILogger;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected saveServer: SaveServer;
protected localisationService: LocalisationService;
protected profileHelper: ProfileHelper;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper);
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, saveServer: SaveServer, localisationService: LocalisationService, profileHelper: ProfileHelper);
getTraderSuits(traderID: string, sessionID: string): ISuit[];
wearClothing(pmcData: IPmcData, body: IWearClothingRequestData, sessionID: string): IItemEventRouterResponse;
buyClothing(pmcData: IPmcData, body: IBuyClothingRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -2,24 +2,78 @@ import { DialogueHelper } from "../helpers/DialogueHelper";
import { IGetAllAttachmentsResponse } from "../models/eft/dialog/IGetAllAttachmentsResponse";
import { IGetFriendListDataResponse } from "../models/eft/dialog/IGetFriendListDataResponse";
import { IGetMailDialogViewResponseData } from "../models/eft/dialog/IGetMailDialogViewResponseData";
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
import { DialogueInfo, Message } from "../models/eft/profile/IAkiProfile";
import { SaveServer } from "../servers/SaveServer";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class DialogueController {
protected httpResponse: HttpResponseUtil;
protected saveServer: SaveServer;
protected timeUtil: TimeUtil;
protected dialogueHelper: DialogueHelper;
constructor(httpResponse: HttpResponseUtil, saveServer: SaveServer, dialogueHelper: DialogueHelper);
constructor(saveServer: SaveServer, timeUtil: TimeUtil, dialogueHelper: DialogueHelper);
update(): void;
getFriendList(sessionID: string): IGetFriendListDataResponse;
generateDialogueList(sessionID: string): IGetBodyResponseData<DialogueInfo[]>;
/**
* Create array holding trader dialogs and mail interactions with player
* Set the content of the dialogue on the list tab.
* @param sessionID Session Id
* @returns array of dialogs
*/
generateDialogueList(sessionID: string): DialogueInfo[];
/**
* Get the content of a dialogue
* @param dialogueID Dialog id
* @param sessionID Session Id
* @returns DialogueInfo
*/
getDialogueInfo(dialogueID: string, sessionID: string): DialogueInfo;
/**
* Handle player clicking 'messenger' and seeing all the messages they've recieved
* Set the content of the dialogue on the details panel, showing all the messages
* for the specified dialogue.
* @param dialogueID Dialog id
* @param sessionID Session id
* @returns IGetMailDialogViewResponseData object
*/
generateDialogueView(dialogueID: string, sessionID: string): IGetMailDialogViewResponseData;
/**
* Get a count of messages with attachments from a particular dialog
* @param sessionID Session id
* @param dialogueID Dialog id
* @returns Count of messages with attachments
*/
protected getUnreadMessagesWithAttachmentsCount(sessionID: string, dialogueID: string): number;
/**
* Does array have messages with uncollected rewards (includes expired rewards)
* @param messages Messages to check
* @returns true if uncollected rewards found
*/
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
removeDialogue(dialogueID: string, sessionID: string): void;
setDialoguePin(dialogueID: string, shouldPin: boolean, sessionID: string): void;
setRead(dialogueIDs: string[], sessionID: string): void;
/**
* Get all uncollected items attached to mail in a particular dialog
* @param dialogueID Dialog to get mail attachments from
* @param sessionID Session id
* @returns
*/
getAllAttachments(dialogueID: string, sessionID: string): IGetAllAttachmentsResponse;
protected messagesHaveUncollectedRewards(messages: Message[]): boolean;
/**
* Get messages from a specific dialog that have items not expired
* @param sessionId Session id
* @param dialogueId Dialog to get mail attachments from
* @returns Message array
*/
protected getActiveMessagesFromDialog(sessionId: string, dialogueId: string): Message[];
/**
* Return array of messages with uncollected items (includes expired)
* @param messages Messages to parse
* @returns messages with items to collect
*/
protected getMessagesWithAttachments(messages: Message[]): Message[];
/**
* Delete expired items. triggers when updating traders.
* @param sessionID Session id
*/
protected removeExpiredItems(sessionID: string): void;
update(): void;
}

View File

@ -1,29 +1,80 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { HideoutHelper } from "../helpers/HideoutHelper";
import { HttpServerHelper } from "../helpers/HttpServerHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { PreAkiModLoader } from "../loaders/PreAkiModLoader";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { IPmcData } from "../models/eft/common/IPmcData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IServerDetails } from "../models/eft/game/IServerDetails";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { ICoreConfig } from "../models/spt/config/ICoreConfig";
import { IHttpConfig } from "../models/spt/config/IHttpConfig";
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { LocaleService } from "../services/LocaleService";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomLocationWaveService } from "../services/CustomLocationWaveService";
import { LocalisationService } from "../services/LocalisationService";
import { OpenZoneService } from "../services/OpenZoneService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { Watermark } from "../utils/Watermark";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { TimeUtil } from "../utils/TimeUtil";
export declare class GameController {
protected logger: ILogger;
protected watermark: Watermark;
protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil;
protected preAkiModLoader: PreAkiModLoader;
protected httpServerHelper: HttpServerHelper;
protected localeService: LocaleService;
protected hideoutHelper: HideoutHelper;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected localisationService: LocalisationService;
protected customLocationWaveService: CustomLocationWaveService;
protected openZoneService: OpenZoneService;
protected seasonalEventService: SeasonalEventService;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected httpConfig: IHttpConfig;
protected coreConfig: ICoreConfig;
constructor(logger: ILogger, watermark: Watermark, httpServerHelper: HttpServerHelper, localeService: LocaleService, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string): void;
protected locationConfig: ILocationConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, timeUtil: TimeUtil, preAkiModLoader: PreAkiModLoader, httpServerHelper: HttpServerHelper, hideoutHelper: HideoutHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, customLocationWaveService: CustomLocationWaveService, openZoneService: OpenZoneService, seasonalEventService: SeasonalEventService, applicationContext: ApplicationContext, configServer: ConfigServer);
gameStart(_url: string, _info: IEmptyRequestData, sessionID: string, startTimeStampMS: number): void;
/**
* When player logs in, iterate over all active effects and reduce timer
* TODO - add body part HP regen
* @param pmcProfile
*/
protected updateProfileHealthValues(pmcProfile: IPmcData): void;
/**
* Waves with an identical min/max values spawn nothing, the number of bots that spawn is the difference between min and max
*/
protected fixBrokenOfflineMapWaves(): void;
/**
* Make Rogues spawn later to allow for scavs to spawn first instead of rogues filling up all spawn positions
*/
protected fixRoguesSpawningInstantlyOnLighthouse(): void;
/**
* Get a list of installed mods and save their details to the profile being used
* @param fullProfile Profile to add mod details to
*/
protected saveActiveModsToProfile(fullProfile: IAkiProfile): void;
/**
* Add the logged in players name to PMC name pool
* @param pmcProfile
*/
protected addPlayerToPMCNames(pmcProfile: IPmcData): void;
/**
* Blank out the "test" mail message from prapor
*/
protected removePraporTestMessage(): void;
/**
* Make non-trigger-spawned raiders spawn earlier + always
*/
protected adjustLabsRaiderSpawnRate(): void;
protected logProfileDetails(fullProfile: IAkiProfile): void;
getGameConfig(sessionID: string): IGameConfigResponse;
getServer(): any[];
getValidGameVersion(): any;
getServer(): IServerDetails[];
getValidGameVersion(): ICheckVersionResponse;
}

View File

@ -1,23 +1,28 @@
import { ItemHelper } from "../helpers/ItemHelper";
import { PaymentService } from "../services/PaymentService";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { HealthHelper } from "../helpers/HealthHelper";
import { InventoryHelper } from "../helpers/InventoryHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IHealthTreatmentRequestData } from "../models/eft/health/IHealthTreatmentRequestData";
import { IOffraidEatRequestData } from "../models/eft/health/IOffraidEatRequestData";
import { IOffraidHealRequestData } from "../models/eft/health/IOffraidHealRequestData";
import { ISyncHealthRequestData } from "../models/eft/health/ISyncHealthRequestData";
import { IWorkoutData } from "../models/eft/health/IWorkoutData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HealthController {
protected logger: ILogger;
protected itemEventRouter: ItemEventRouter;
protected jsonUtil: JsonUtil;
protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper;
protected paymentService: PaymentService;
protected inventoryHelper: InventoryHelper;
protected localisationService: LocalisationService;
protected healthHelper: HealthHelper;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper);
constructor(logger: ILogger, jsonUtil: JsonUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, localisationService: LocalisationService, healthHelper: HealthHelper);
/**
* stores in-raid player health
* @param pmcData Player profile
@ -25,7 +30,7 @@ export declare class HealthController {
* @param sessionID
* @param addEffects Should effects found be added or removed from profile
*/
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void;
saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean, deleteExistingEffects?: boolean): void;
/**
* When healing in menu
* @param pmcData
@ -34,13 +39,35 @@ export declare class HealthController {
* @returns
*/
offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Consume food/water outside of a raid
* @param pmcData Player profile
* @param body request Object
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Occurs on post-raid healing page
* @param pmcData player profile
* @param info Request data from client
* @param healthTreatmentRequest Request data from client
* @param sessionID Session id
* @returns
*/
healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
healthTreatment(pmcData: IPmcData, healthTreatmentRequest: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse;
/**
* applies skills from hideout workout.
* @param pmcData Player profile
* @param info Request data
* @param sessionID
*/
applyWorkoutChanges(pmcData: IPmcData, info: IWorkoutData, sessionId: string): void;
/**
* Iterate over treatment request diff and find effects to remove from player limbs
* @param sessionId
* @param profile Profile to update
* @param treatmentRequest client request
* @param output response to send to client
*/
protected removeEffectsAfterPostRaidHeal(sessionId: string, profile: IPmcData, treatmentRequest: IHealthTreatmentRequestData, output: IItemEventRouterResponse): void;
}

View File

@ -7,7 +7,9 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { HideoutArea, Product } from "../models/eft/common/tables/IBotBase";
import { HideoutUpgradeCompleteRequestData } from "../models/eft/hideout/HideoutUpgradeCompleteRequestData";
import { IHideoutContinousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinousProductionStartRequestData";
import { IHandleQTEEventRequestData } from "../models/eft/hideout/IHandleQTEEventRequestData";
import { IHideoutContinuousProductionStartRequestData } from "../models/eft/hideout/IHideoutContinuousProductionStartRequestData";
import { IHideoutImproveAreaRequestData } from "../models/eft/hideout/IHideoutImproveAreaRequestData";
import { IHideoutProduction } from "../models/eft/hideout/IHideoutProduction";
import { IHideoutPutItemInRequestData } from "../models/eft/hideout/IHideoutPutItemInRequestData";
import { IHideoutScavCaseStartRequestData } from "../models/eft/hideout/IHideoutScavCaseStartRequestData";
@ -16,19 +18,23 @@ import { IHideoutTakeItemOutRequestData } from "../models/eft/hideout/IHideoutTa
import { IHideoutTakeProductionRequestData } from "../models/eft/hideout/IHideoutTakeProductionRequestData";
import { IHideoutToggleAreaRequestData } from "../models/eft/hideout/IHideoutToggleAreaRequestData";
import { IHideoutUpgradeRequestData } from "../models/eft/hideout/IHideoutUpgradeRequestData";
import { IQteData } from "../models/eft/hideout/IQteData";
import { IRecordShootingRangePoints } from "../models/eft/hideout/IRecordShootingRangePoints";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IHideoutConfig } from "../models/spt/config/IHideoutConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { JsonUtil } from "../utils/JsonUtil";
export declare class HideoutController {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -40,19 +46,36 @@ export declare class HideoutController {
protected playerService: PlayerService;
protected presetHelper: PresetHelper;
protected paymentHelper: PaymentHelper;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected httpResponse: HttpResponseUtil;
protected profileHelper: ProfileHelper;
protected hideoutHelper: HideoutHelper;
protected scavCaseRewardGenerator: ScavCaseRewardGenerator;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected jsonUtil: JsonUtil;
protected fenceService: FenceService;
protected static nameBackendCountersCrafting: string;
protected hideoutConfig: IHideoutConfig;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, configServer: ConfigServer, jsonUtil: JsonUtil);
upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
upgradeComplete(pmcData: IPmcData, body: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, inventoryHelper: InventoryHelper, saveServer: SaveServer, playerService: PlayerService, presetHelper: PresetHelper, paymentHelper: PaymentHelper, eventOutputHolder: EventOutputHolder, httpResponse: HttpResponseUtil, profileHelper: ProfileHelper, hideoutHelper: HideoutHelper, scavCaseRewardGenerator: ScavCaseRewardGenerator, localisationService: LocalisationService, configServer: ConfigServer, jsonUtil: JsonUtil, fenceService: FenceService);
/**
* Start a hideout area upgrade
* @param pmcData Player profile
* @param request upgrade start request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
startUpgrade(pmcData: IPmcData, request: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Complete a hideout area upgrade
* @param pmcData Player profile
* @param request Completed upgrade request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
upgradeComplete(pmcData: IPmcData, request: HideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle HideoutPutItemsInAreaSlots
* Create item in hideout slot item array, remove item from player inventory
* @param pmcData Profile data
* @param addItemToHideoutRequest reqeust from client to place item in area slot
@ -60,7 +83,14 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse object
*/
putItemsInAreaSlots(pmcData: IPmcData, addItemToHideoutRequest: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse;
takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Remove item from hideout area and place into player inventory
* @param pmcData Player profile
* @param request Take item out of area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
takeItemsFromAreaSlots(pmcData: IPmcData, request: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Find resource item in hideout area, add copy to player inventory, remove Item from hideout slot
* @param sessionID Session id
@ -71,7 +101,21 @@ export declare class HideoutController {
* @returns IItemEventRouterResponse response
*/
protected removeResourceFromArea(sessionID: string, pmcData: IPmcData, removeResourceRequest: IHideoutTakeItemOutRequestData, output: IItemEventRouterResponse, hideoutArea: HideoutArea): IItemEventRouterResponse;
toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Toggle area on/off
* @param pmcData Player profile
* @param request Toggle area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
toggleArea(pmcData: IPmcData, request: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Start production for an item from hideout area
* @param pmcData Player profile
* @param body Start prodution of single item request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handles event after clicking 'start' on the scav case hideout page
@ -81,24 +125,96 @@ export declare class HideoutController {
* @returns item event router response
*/
scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Adjust scav case time based on fence standing
*
* @param pmcData Player profile
* @param productionTime Time to complete scav case in seconds
* @returns Adjusted scav case time in seconds
*/
protected getScavCaseTime(pmcData: IPmcData, productionTime: number): number;
/**
* Add generated scav case rewards to player profile
* @param pmcData player profile to add rewards to
* @param rewards reward items to add to profile
* @param recipieId recipie id to save into Production dict
*/
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[]): void;
continuousProductionStart(pmcData: IPmcData, body: IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
protected addScavCaseRewardsToProfile(pmcData: IPmcData, rewards: Product[], recipieId: string): void;
/**
* Start production of continuously created item
* @param pmcData Player profile
* @param request Continious production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
continuousProductionStart(pmcData: IPmcData, request: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take completed item out of hideout area and place into player inventory
* @param pmcData Player profile
* @param request Remove production from area request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
takeProduction(pmcData: IPmcData, request: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Take recipie-type production out of hideout area and place into player inventory
* @param sessionID Session id
* @param recipe Completed recipie of item
* @param pmcData Player profile
* @param request Remove production from area request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleRecipie(sessionID: string, recipe: IHideoutProduction, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Handles giving rewards stored in player profile to player after clicking 'get rewards'
* @param sessionID
* @param pmcData
* @param body
* @param output
* @returns
* @param sessionID Session id
* @param pmcData Player profile
* @param request Get rewards from scavcase craft request
* @param output Output object to update
* @returns IItemEventRouterResponse
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, request: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
/**
* Start area production for item
* @param pmcData Player profile
* @param request Start production request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
registerProduction(pmcData: IPmcData, request: IHideoutSingleProductionStartRequestData | IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get quick time event list for hideout
* // TODO - implement this
* @param sessionId Session id
* @returns IQteData array
*/
getQteList(sessionId: string): IQteData[];
/**
* Handle HideoutQuickTimeEvent on client/game/profile/items/moving
* Called after completing workout at gym
* @param sessionId Session id
* @param pmcData Profile to adjust
* @param request QTE result object
*/
handleQTEEventOutcome(sessionId: string, pmcData: IPmcData, request: IHandleQTEEventRequestData): IItemEventRouterResponse;
/**
* Record a high score from the shooting range into a player profiles overallcounters
* @param sessionId Session id
* @param pmcData Profile to update
* @param request shooting range score request
* @returns IItemEventRouterResponse
*/
recordShootingRangePoints(sessionId: string, pmcData: IPmcData, request: IRecordShootingRangePoints): IItemEventRouterResponse;
/**
* Handle client/game/profile/items/moving - HideoutImproveArea
* @param sessionId Session id
* @param pmcData profile to improve area in
* @param request improve area request data
*/
improveArea(sessionId: string, pmcData: IPmcData, request: IHideoutImproveAreaRequestData): IItemEventRouterResponse;
/**
* Function called every x seconds as part of onUpdate event
*/
protected handleScavCase(sessionID: string, pmcData: IPmcData, body: IHideoutTakeProductionRequestData, output: IItemEventRouterResponse): IItemEventRouterResponse;
registerProduction(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData | IHideoutContinousProductionStartRequestData, sessionID: string): IItemEventRouterResponse;
update(): void;
}

View File

@ -1,3 +1,4 @@
import { ApplicationContext } from "../context/ApplicationContext";
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { HealthHelper } from "../helpers/HealthHelper";
import { InRaidHelper } from "../helpers/InRaidHelper";
@ -6,8 +7,10 @@ import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { IRegisterPlayerRequestData } from "../models/eft/inRaid/IRegisterPlayerRequestData";
import { ISaveProgressRequestData } from "../models/eft/inRaid/ISaveProgressRequestData";
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
@ -16,6 +19,9 @@ import { SaveServer } from "../servers/SaveServer";
import { InsuranceService } from "../services/InsuranceService";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
/**
* Logic for handling In Raid callbacks
*/
export declare class InraidController {
protected logger: ILogger;
protected saveServer: SaveServer;
@ -30,17 +36,47 @@ export declare class InraidController {
protected traderHelper: TraderHelper;
protected insuranceService: InsuranceService;
protected inRaidHelper: InRaidHelper;
protected applicationContext: ApplicationContext;
protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
protected inraidConfig: IInRaidConfig;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, configServer: ConfigServer);
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
saveProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
constructor(logger: ILogger, saveServer: SaveServer, jsonUtil: JsonUtil, timeUtil: TimeUtil, databaseServer: DatabaseServer, questHelper: QuestHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, playerScavGenerator: PlayerScavGenerator, healthHelper: HealthHelper, traderHelper: TraderHelper, insuranceService: InsuranceService, inRaidHelper: InRaidHelper, applicationContext: ApplicationContext, configServer: ConfigServer);
/**
* Handle updating the profile post-pmc raid
* Save locationId to active profiles inraid object AND app context
* @param sessionID Session id
* @param info Register player request
*/
addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void;
/**
* Save profile state to disk
* Handles pmc/pscav
* @param offraidData post-raid request data
* @param sessionID Session id
*/
savePostRaidProgress(offraidData: ISaveProgressRequestData, sessionID: string): void;
/**
* Handle updating player profile post-pmc raid
* @param sessionID session id
* @param offraidData post-raid data of raid
* @param offraidData post-raid data
*/
protected savePmcProgress(sessionID: string, offraidData: ISaveProgressRequestData): void;
/**
* Make changes to pmc profile after they left raid dead,
* alter bodypart hp, handle insurance, delete inventory items, remove carried quest items
* @param postRaidSaveRequest post-raid save request
* @param pmcData pmc profile
* @param insuranceEnabled is insurance enabled
* @param preRaidGear gear player had before raid
* @param sessionID Session id
* @returns Updated profile object
*/
protected performPostRaidActionsWhenDead(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData, insuranceEnabled: boolean, preRaidGear: Item[], sessionID: string): IPmcData;
/**
* Adjust player characters bodypart hp if they left raid early
* @param postRaidSaveRequest post raid data
* @param pmcData player profile
*/
protected updatePmcHealthPostRaid(postRaidSaveRequest: ISaveProgressRequestData, pmcData: IPmcData): void;
/**
* Reduce body part hp to % of max
* @param pmcData profile to edit
@ -66,6 +102,31 @@ export declare class InraidController {
* @param isPlayerScav Was the player a pScav
*/
protected markOrRemoveFoundInRaidItems(offraidData: ISaveProgressRequestData, pmcData: IPmcData, isPlayerScav: boolean): void;
/**
* Update profile after player completes scav raid
* @param scavData Scav profile
* @param sessionID Session id
* @param offraidData Post-raid save request
* @param pmcData Pmc profile
* @param isDead Is player dead
*/
protected handlePostRaidPlayerScavProcess(scavData: IPmcData, sessionID: string, offraidData: ISaveProgressRequestData, pmcData: IPmcData, isDead: boolean): void;
/**
* Update profile with scav karma values based on in-raid actions
* @param pmcData Pmc profile
* @param offraidData Post-raid save request
* @param scavData Scav profile
* @param sessionID Session id
*/
protected handlePostRaidPlayerScavKarmaChanges(pmcData: IPmcData, offraidData: ISaveProgressRequestData, scavData: IPmcData, sessionID: string): void;
/**
* Get the inraid config from configs/inraid.json
* @returns InRaid Config
*/
getInraidConfig(): IInRaidConfig;
/**
* Get airdrop config from configs/airdrop.json
* @returns Airdrop config
*/
getAirdropConfig(): IAirdropConfig;
}

View File

@ -8,7 +8,7 @@ import { IInsureRequestData } from "../models/eft/insurance/IInsureRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IInsuranceConfig } from "../models/spt/config/IInsuranceConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { SaveServer } from "../servers/SaveServer";
@ -19,7 +19,7 @@ import { TimeUtil } from "../utils/TimeUtil";
export declare class InsuranceController {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected timeUtil: TimeUtil;
protected saveServer: SaveServer;
protected databaseServer: DatabaseServer;
@ -30,15 +30,24 @@ export declare class InsuranceController {
protected insuranceService: InsuranceService;
protected configServer: ConfigServer;
protected insuranceConfig: IInsuranceConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, itemEventRouter: ItemEventRouter, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, // TODO: delay required
insuranceService: InsuranceService, configServer: ConfigServer);
constructor(logger: ILogger, randomUtil: RandomUtil, eventOutputHolder: EventOutputHolder, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileHelper: ProfileHelper, dialogueHelper: DialogueHelper, paymentService: PaymentService, insuranceService: InsuranceService, configServer: ConfigServer);
/**
* Process insurance items prior to being given to player in mail
*/
processReturn(): void;
/**
* Add insurance to an item
* @param pmcData Player profile
* @param body Insurance request
* @param sessionID Session id
* @returns IItemEventRouterResponse object to send to client
*/
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Calculate insurance cost
* @param info request object
* @param sessionID session id
* @returns response object to send to client
* @returns IGetInsuranceCostResponseData object to send to client
*/
cost(info: IGetInsuranceCostRequestData, sessionID: string): IGetInsuranceCostResponseData;
}

View File

@ -2,6 +2,7 @@ import { InventoryHelper } from "../helpers/InventoryHelper";
import { PaymentHelper } from "../helpers/PaymentHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IAddItemRequestData } from "../models/eft/inventory/IAddItemRequestData";
import { IInventoryBindRequestData } from "../models/eft/inventory/IInventoryBindRequestData";
@ -20,34 +21,46 @@ import { IInventorySwapRequestData } from "../models/eft/inventory/IInventorySwa
import { IInventoryTagRequestData } from "../models/eft/inventory/IInventoryTagRequestData";
import { IInventoryToggleRequestData } from "../models/eft/inventory/IInventoryToggleRequestData";
import { IInventoryTransferRequestData } from "../models/eft/inventory/IInventoryTransferRequestData";
import { IOpenRandomLootContainerRequestData } from "../models/eft/inventory/IOpenRandomLootContainerRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
import { LocalisationService } from "../services/LocalisationService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { HashUtil } from "../utils/HashUtil";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class InventoryController {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected jsonUtil: JsonUtil;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
protected fenceService: FenceService;
protected presetHelper: PresetHelper;
protected inventoryHelper: InventoryHelper;
protected ragfairOfferService: RagfairOfferService;
protected profileHelper: ProfileHelper;
protected weightedRandomHelper: WeightedRandomHelper;
protected paymentHelper: PaymentHelper;
protected itemEventRouter: ItemEventRouter;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemEventRouter: ItemEventRouter);
protected localisationService: LocalisationService;
protected eventOutputHolder: EventOutputHolder;
protected httpResponseUtil: HttpResponseUtil;
constructor(logger: ILogger, hashUtil: HashUtil, jsonUtil: JsonUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, fenceService: FenceService, presetHelper: PresetHelper, inventoryHelper: InventoryHelper, ragfairOfferService: RagfairOfferService, profileHelper: ProfileHelper, weightedRandomHelper: WeightedRandomHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, eventOutputHolder: EventOutputHolder, httpResponseUtil: HttpResponseUtil);
/**
* Move Item
* change location of item with parentId and slotId
* transfers items from one profile to another if fromOwner/toOwner is set in the body.
* otherwise, move is contained within the same profile_f.
*/
moveItem(pmcData: IPmcData, body: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
* @param pmcData Profile
* @param moveRequest Move request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
moveItem(pmcData: IPmcData, moveRequest: IInventoryMoveRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Remove Item from Profile
* Deep tree item deletion, also removes items from insurance list
@ -116,10 +129,23 @@ export declare class InventoryController {
protected getExaminedItemTpl(body: IInventoryExamineRequestData): string;
readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handles sorting of Inventory.
* Handle ApplyInventoryChanges
* Sorts supplied items.
* @param pmcData Player profile
* @param request sort request
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
sortInventory(pmcData: IPmcData, request: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse;
createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse;
deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse;
editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Handle event fired when a container is unpacked (currently only the halloween pumpkin)
* @param pmcData Profile data
* @param body open loot container request data
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -7,6 +7,7 @@ import { LootItem } from "../models/spt/services/LootItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
@ -15,12 +16,13 @@ export declare class LocationController {
protected hashUtil: HashUtil;
protected logger: ILogger;
protected locationGenerator: LocationGenerator;
protected localisationService: LocalisationService;
protected lootGenerator: LootGenerator;
protected databaseServer: DatabaseServer;
protected timeUtil: TimeUtil;
protected configServer: ConfigServer;
protected airdropConfig: IAirdropConfig;
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
get(location: string): ILocationBase;
generate(name: string): ILocationBase;
generateAll(): ILocationsGenerateAllResponse;

View File

@ -6,15 +6,16 @@ import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequest
import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData";
import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "../models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData";
import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult";
import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { IInRaidConfig } from "../models/spt/config/IInRaidConfig";
import { IMatchConfig } from "../models/spt/config/IMatchConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { SaveServer } from "../servers/SaveServer";
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { MatchLocationService } from "../services/MatchLocationService";
import { ProfileSnapshotService } from "../services/ProfileSnapshotService";
@ -27,11 +28,12 @@ export declare class MatchController {
protected botLootCacheService: BotLootCacheService;
protected configServer: ConfigServer;
protected profileSnapshotService: ProfileSnapshotService;
protected botGenerationCacheService: BotGenerationCacheService;
protected applicationContext: ApplicationContext;
protected matchConfig: IMatchConfig;
protected inraidConfig: IInRaidConfig;
protected botConfig: IBotConfig;
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, applicationContext: ApplicationContext);
constructor(logger: ILogger, saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, botLootCacheService: BotLootCacheService, configServer: ConfigServer, profileSnapshotService: ProfileSnapshotService, botGenerationCacheService: BotGenerationCacheService, applicationContext: ApplicationContext);
getEnabled(): boolean;
getProfile(info: IGetProfileRequestData): IPmcData[];
createGroup(sessionID: string, info: ICreateGroupRequestData): any;
@ -39,6 +41,17 @@ export declare class MatchController {
joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[];
protected getMatch(location: string): any;
getGroupStatus(info: IGetGroupStatusRequestData): any;
startOfflineRaid(info: IStartOfflineRaidRequestData, sessionID: string): void;
/**
* Handle /client/raid/configuration
* @param request
* @param sessionID
*/
startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void;
/**
* Convert a difficulty value from pre-raid screen to a bot difficulty
* @param botDifficulty dropdown difficulty value
* @returns bot difficulty
*/
protected convertDifficultyDropdownIntoBotDifficulty(botDifficulty: string): string;
endOfflineRaid(info: IEndOfflineRaidRequestData, sessionID: string): void;
}

View File

@ -1,10 +1,10 @@
import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { INoteActionData } from "../models/eft/notes/INoteActionData";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
export declare class NoteController {
protected itemEventRouter: ItemEventRouter;
constructor(itemEventRouter: ItemEventRouter);
protected eventOutputHolder: EventOutputHolder;
constructor(eventOutputHolder: EventOutputHolder);
addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;
deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse;

View File

@ -3,15 +3,15 @@ import { IPmcData } from "../models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IPresetBuildActionRequestData } from "../models/eft/presetBuild/IPresetBuildActionRequestData";
import { WeaponBuild } from "../models/eft/profile/IAkiProfile";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { SaveServer } from "../servers/SaveServer";
import { HashUtil } from "../utils/HashUtil";
export declare class PresetBuildController {
protected hashUtil: HashUtil;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected itemHelper: ItemHelper;
protected saveServer: SaveServer;
constructor(hashUtil: HashUtil, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, saveServer: SaveServer);
constructor(hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, itemHelper: ItemHelper, saveServer: SaveServer);
getUserBuilds(sessionID: string): WeaponBuild[];
saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;
removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse;

View File

@ -1,6 +1,7 @@
import { PlayerScavGenerator } from "../generators/PlayerScavGenerator";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IMiniProfile } from "../models/eft/launcher/IMiniProfile";
@ -24,8 +25,9 @@ export declare class ProfileController {
protected profileFixerService: ProfileFixerService;
protected playerScavGenerator: PlayerScavGenerator;
protected traderHelper: TraderHelper;
protected questHelper: QuestHelper;
protected profileHelper: ProfileHelper;
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, profileHelper: ProfileHelper);
constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper);
getMiniProfiles(): IMiniProfile[];
getMiniProfile(sessionID: string): any;
getCompleteProfile(sessionID: string): IPmcData[];

View File

@ -5,22 +5,26 @@ import { QuestConditionHelper } from "../helpers/QuestConditionHelper";
import { QuestHelper } from "../helpers/QuestHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IQuest, Reward } from "../models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "../models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "../models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "../models/eft/quests/ICompleteQuestRequestData";
import { IHandoverQuestRequestData } from "../models/eft/quests/IHandoverQuestRequestData";
import { IQuestConfig } from "../models/spt/config/IQuestConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { LocaleService } from "../services/LocaleService";
import { LocalisationService } from "../services/LocalisationService";
import { PlayerService } from "../services/PlayerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class QuestController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected itemEventRouter: ItemEventRouter;
protected httpResponseUtil: HttpResponseUtil;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected dialogueHelper: DialogueHelper;
@ -29,9 +33,10 @@ export declare class QuestController {
protected questConditionHelper: QuestConditionHelper;
protected playerService: PlayerService;
protected localeService: LocaleService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, configServer: ConfigServer);
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponseUtil: HttpResponseUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, itemHelper: ItemHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, questHelper: QuestHelper, questConditionHelper: QuestConditionHelper, playerService: PlayerService, localeService: LocaleService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Get all quests visible to player
* Exclude quests with incomplete preconditions (level/loyalty)
@ -55,7 +60,30 @@ export declare class QuestController {
* @returns client response
*/
acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead
* @param startedMessageTextId startedMessageText property from IQuest
* @param questDescriptionId description property from IQuest
* @returns message id
*/
protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string;
/**
* Handle the client accepting a repeatable quest and starting it
* Send starting rewards if any to player and
* Send start notification if any to player
* @param pmcData Profile to update with new quest
* @param acceptedQuest Quest being accepted
* @param sessionID Session id
* @returns IItemEventRouterResponse
*/
acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Look for an accepted quest inside player profile, return matching
* @param pmcData Profile to search through
* @param acceptedQuest Quest to search for
* @returns IRepeatableQuest
*/
protected getRepeatableQuestFromProfile(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData): IRepeatableQuest;
/**
* Update completed quest in profile
* Add newly unlocked quests to profile
@ -67,13 +95,20 @@ export declare class QuestController {
*/
completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse;
/**
* Send a popup to player on completion of a quest
* Send a popup to player on successful completion of a quest
* @param sessionID session id
* @param pmcData player profile
* @param completedQuestId completed quest id
* @param questRewards rewards given to player
* @param pmcData Player profile
* @param completedQuestId Completed quest id
* @param questRewards Rewards given to player
*/
protected sendDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
protected sendSuccessDialogMessageOnQuestComplete(sessionID: string, pmcData: IPmcData, completedQuestId: string, questRewards: Reward[]): void;
/**
* Look for newly available quests after completing a quest with a requirement to wait x minutes (time-locked) before being available and add data to profile
* @param pmcData Player profile to update
* @param quests Quests to look for wait conditions in
* @param completedQuestId Quest just completed
*/
protected addTimeLockedQuestsToProfile(pmcData: IPmcData, quests: IQuest[], completedQuestId: string): void;
/**
* Returns a list of quests that should be failed when a quest is completed
* @param completedQuestId quest completed id

View File

@ -12,6 +12,7 @@ import { RagfairTaxHelper } from "../helpers/RagfairTaxHelper";
import { TraderHelper } from "../helpers/TraderHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { Item } from "../models/eft/common/tables/IItem";
import { ITraderAssort } from "../models/eft/common/tables/ITrader";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IAkiProfile } from "../models/eft/profile/IAkiProfile";
import { IAddOfferRequestData, Requirement } from "../models/eft/ragfair/IAddOfferRequestData";
@ -23,11 +24,12 @@ import { IRagfairOffer } from "../models/eft/ragfair/IRagfairOffer";
import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RagfairServer } from "../servers/RagfairServer";
import { SaveServer } from "../servers/SaveServer";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { RagfairOfferService } from "../services/RagfairOfferService";
import { RagfairPriceService } from "../services/RagfairPriceService";
@ -41,7 +43,7 @@ export declare class RagfairController {
protected logger: ILogger;
protected timeUtil: TimeUtil;
protected httpResponse: HttpResponseUtil;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected ragfairServer: RagfairServer;
protected ragfairPriceService: RagfairPriceService;
protected databaseServer: DatabaseServer;
@ -61,22 +63,64 @@ export declare class RagfairController {
protected ragfairOfferService: RagfairOfferService;
protected ragfairRequiredItemsService: RagfairRequiredItemsService;
protected ragfairOfferGenerator: RagfairOfferGenerator;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, itemEventRouter: ItemEventRouter, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, configServer: ConfigServer);
getOffers(sessionID: string, info: ISearchRequestData): IGetOffersResult;
constructor(logger: ILogger, timeUtil: TimeUtil, httpResponse: HttpResponseUtil, eventOutputHolder: EventOutputHolder, ragfairServer: RagfairServer, ragfairPriceService: RagfairPriceService, databaseServer: DatabaseServer, itemHelper: ItemHelper, saveServer: SaveServer, ragfairSellHelper: RagfairSellHelper, ragfairTaxHelper: RagfairTaxHelper, ragfairSortHelper: RagfairSortHelper, ragfairOfferHelper: RagfairOfferHelper, profileHelper: ProfileHelper, paymentService: PaymentService, handbookHelper: HandbookHelper, paymentHelper: PaymentHelper, inventoryHelper: InventoryHelper, traderHelper: TraderHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, ragfairRequiredItemsService: RagfairRequiredItemsService, ragfairOfferGenerator: RagfairOfferGenerator, localisationService: LocalisationService, configServer: ConfigServer);
getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult;
/**
* Get offers for the client based on type of search being performed
* @param searchRequest Client search request data
* @param itemsToAdd
* @param traderAssorts Trader assorts
* @param pmcProfile Player profile
* @returns array of offers
*/
protected getOffersForSearchType(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
/**
* Get categories for the type of search being performed, linked/required/all
* @param searchRequest Client search request data
* @param offers ragfair offers to get categories for
* @returns record with tpls + counts
*/
protected getSpecificCategories(searchRequest: ISearchRequestData, offers: IRagfairOffer[]): Record<string, number>;
/**
* Add Required offers to offers result
* @param searchRequest Client search request data
* @param assorts
* @param pmcProfile Player profile
* @param result Result object being sent back to client
*/
protected addRequiredOffersToResult(searchRequest: ISearchRequestData, assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData, result: IGetOffersResult): void;
/**
* Add index to all offers passed in (0-indexed)
* @param offers Offers to add index value to
*/
protected addIndexValueToOffers(offers: IRagfairOffer[]): void;
/**
* Update a trader flea offer with buy restrictions stored in the traders assort
* @param offer flea offer to update
* @param profile full profile of player
*/
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer): void;
protected setTraderOfferPurchaseLimits(offer: IRagfairOffer, profile: IAkiProfile): void;
/**
* Adjust ragfair offer stack count to match same value as traders assort stack count
* @param offer Flea offer to adjust
*/
protected setTraderOfferStackSize(offer: IRagfairOffer): void;
protected isLinkedSearch(info: ISearchRequestData): boolean;
protected isRequiredSearch(info: ISearchRequestData): boolean;
update(): void;
getItemPrice(info: IGetMarketPriceRequestData): IGetItemPriceResult;
/**
* Called when creating an offer on flea, fills values in top right corner
* @param getPriceRequest
* @returns min/avg/max values for an item based on flea offers available
*/
getItemMinAvgMaxFleaPriceValues(getPriceRequest: IGetMarketPriceRequestData): IGetItemPriceResult;
addPlayerOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse;
createPlayerOffer(profile: IAkiProfile, requirements: Requirement[], items: Item[], sellInOnePiece: boolean, amountToSend: number): IRagfairOffer;
getAllFleaPrices(): Record<string, number>;
getStaticPrices(): Record<string, number>;
removeOffer(offerId: string, sessionID: string): IItemEventRouterResponse;
extendOffer(info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -7,35 +7,35 @@ import { IRepairActionDataRequest } from "../models/eft/repair/IRepairActionData
import { ITraderRepairActionDataRequest } from "../models/eft/repair/ITraderRepairActionDataRequest";
import { IRepairConfig } from "../models/spt/config/IRepairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { ConfigServer } from "../servers/ConfigServer";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { DatabaseServer } from "../servers/DatabaseServer";
import { PaymentService } from "../services/PaymentService";
import { RepairService } from "../services/RepairService";
export declare class RepairController {
protected logger: ILogger;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected databaseServer: DatabaseServer;
protected questHelper: QuestHelper;
protected traderHelper: TraderHelper;
protected paymentService: PaymentService;
protected repairHelper: RepairHelper;
protected configServer: ConfigServer;
protected repairService: RepairService;
protected repairConfig: IRepairConfig;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, configServer: ConfigServer);
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, questHelper: QuestHelper, traderHelper: TraderHelper, paymentService: PaymentService, repairHelper: RepairHelper, repairService: RepairService);
/**
* Repair with trader
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action
*/
traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
traderRepair(sessionID: string, body: ITraderRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
/**
* Repair with repair kit
* @param pmcData player profile
* @param body endpoint request data
* @param sessionID session id
* @param body endpoint request data
* @param pmcData player profile
* @returns item event router action
*/
repairWithKit(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse;
repairWithKit(sessionID: string, body: IRepairActionDataRequest, pmcData: IPmcData): IItemEventRouterResponse;
}

View File

@ -1,3 +1,4 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
@ -13,12 +14,14 @@ import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQ
import { ELocationName } from "../models/enums/ELocationName";
import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { PaymentService } from "../services/PaymentService";
import { ProfileFixerService } from "../services/ProfileFixerService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
@ -55,6 +58,7 @@ export declare class RepeatableQuestController {
protected timeUtil: TimeUtil;
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected httpResponse: HttpResponseUtil;
protected mathUtil: MathUtil;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
@ -62,14 +66,16 @@ export declare class RepeatableQuestController {
protected presetHelper: PresetHelper;
protected profileHelper: ProfileHelper;
protected profileFixerService: ProfileFixerService;
protected handbookHelper: HandbookHelper;
protected ragfairServerHelper: RagfairServerHelper;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected localisationService: LocalisationService;
protected paymentService: PaymentService;
protected objectId: ObjectId;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected questConfig: IQuestConfig;
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, ragfairServerHelper: RagfairServerHelper, itemEventRouter: ItemEventRouter, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
constructor(timeUtil: TimeUtil, logger: ILogger, randomUtil: RandomUtil, httpResponse: HttpResponseUtil, mathUtil: MathUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, profileFixerService: ProfileFixerService, handbookHelper: HandbookHelper, ragfairServerHelper: RagfairServerHelper, eventOutputHolder: EventOutputHolder, localisationService: LocalisationService, paymentService: PaymentService, objectId: ObjectId, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* This is the method reached by the /client/repeatalbeQuests/activityPeriods endpoint
* Returns an array of objects in the format of repeatable quests to the client.
@ -96,6 +102,13 @@ export declare class RepeatableQuestController {
* @returns {array} array of "repeatableQuestObjects" as descibed above
*/
getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[];
/**
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
* @param repeatableConfig daily/weekly config
* @param pmcData Profile to search
* @returns IPmcDataRepeatableQuest
*/
protected getRepeatableQuestSubTypeFromProfile(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): IPmcDataRepeatableQuest;
/**
* This method is called by GetClientRepeatableQuests and creates one element of quest type format (see assets/database/templates/repeatableQuests.json).
* It randomly draws a quest type (currently Elimination, Completion or Exploration) as well as a trader who is providing the quest
@ -104,17 +117,18 @@ export declare class RepeatableQuestController {
/**
* Just for debug reasons. Draws dailies a random assort of dailies extracted from dumps
*/
generateDebugDailies(dailiesPool: any, factory: any, number: any): any;
generateDebugDailies(dailiesPool: any, factory: any, number: number): any;
/**
* Generates the base object of quest type format given as templates in assets/database/templates/repeatableQuests.json
* The templates include Elimination, Completion and Extraction quest types
*
* @param {string} type quest type: "Elimination", "Completion" or "Extraction"
* @param {string} traderId trader from which the quest will be provided
* @param {string} side scav daily or pmc daily/weekly quest
* @returns {object} a object which contains the base elements for repeatable quests of the requests type
* (needs to be filled with reward and conditions by called to make a valid quest)
*/
generateRepeatableTemplate(type: string, traderId: string): IRepeatableQuest;
generateRepeatableTemplate(type: string, traderId: string, side: string): IRepeatableQuest;
/**
* Generates a valid Exploration quest
*
@ -144,6 +158,12 @@ export declare class RepeatableQuestController {
* @returns {object} object of quest type format for "Elimination" (see assets/database/templates/repeatableQuests.json)
*/
generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination;
/**
* Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567)
* @param locationKey e.g factory4_day
* @returns guid
*/
protected getQuestLocationByMapId(locationKey: string): string;
/**
* Exploration repeatable quests can specify a required extraction point.
* This method creates the according object which will be appended to the conditions array
@ -219,16 +239,17 @@ export declare class RepeatableQuestController {
generateRewardItem(tpl: string, value: number, index: number, preset?: any): IReward;
debugLogRepeatableQuestIds(pmcData: IPmcData): void;
probabilityObjectArray<K, V>(configArrayInput: ProbabilityObject<K, V>[]): ProbabilityObjectArray<K, V>;
changeRepeatableQuest(pmcDataIn: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse;
/**
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
* Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable)
* @param repeatableQuestConfig config file
* @returns a list of rewardable items [[_tpl, itemTemplate],...]
*/
protected getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig): [string, ITemplateItem][];
/**
* Checks if an id is a valid item. Valid meaning that it's an item that may be a reward
* or content of bot loot. Items that are tested as valid may be in a player backpack or stash.
* @param {*} tpl template id of item to check
* @param {string} tpl template id of item to check
* @returns boolean: true if item is valid reward
*/
isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig): boolean;

View File

@ -1,20 +1,30 @@
import { RagfairServer } from "../servers/RagfairServer";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TradeHelper } from "../helpers/TradeHelper";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { Upd } from "../models/eft/common/tables/IItem";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IProcessBaseTradeRequestData } from "../models/eft/trade/IProcessBaseTradeRequestData";
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { IProcessRagfairTradeRequestData } from "../models/eft/trade/IProcessRagfairTradeRequestData";
import { IRagfairConfig } from "../models/spt/config/IRagfairConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { ConfigServer } from "../servers/ConfigServer";
import { RagfairServer } from "../servers/RagfairServer";
import { LocalisationService } from "../services/LocalisationService";
import { HttpResponseUtil } from "../utils/HttpResponseUtil";
declare class TradeController {
protected logger: ILogger;
protected itemEventRouter: ItemEventRouter;
protected eventOutputHolder: EventOutputHolder;
protected tradeHelper: TradeHelper;
protected itemHelper: ItemHelper;
protected profileHelper: ProfileHelper;
protected ragfairServer: RagfairServer;
constructor(logger: ILogger, itemEventRouter: ItemEventRouter, tradeHelper: TradeHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer);
protected httpResponse: HttpResponseUtil;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, eventOutputHolder: EventOutputHolder, tradeHelper: TradeHelper, itemHelper: ItemHelper, profileHelper: ProfileHelper, ragfairServer: RagfairServer, httpResponse: HttpResponseUtil, localisationService: LocalisationService, configServer: ConfigServer);
confirmTrading(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string, foundInRaid?: boolean, upd?: Upd): IItemEventRouterResponse;
confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -1,3 +1,4 @@
import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { TraderAssortHelper } from "../helpers/TraderAssortHelper";
import { TraderHelper } from "../helpers/TraderHelper";
@ -6,6 +7,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { FenceService } from "../services/FenceService";
import { TraderAssortService } from "../services/TraderAssortService";
import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService";
import { JsonUtil } from "../utils/JsonUtil";
import { TimeUtil } from "../utils/TimeUtil";
export declare class TraderController {
@ -16,9 +18,11 @@ export declare class TraderController {
protected traderHelper: TraderHelper;
protected timeUtil: TimeUtil;
protected traderAssortService: TraderAssortService;
protected traderPurchasePersisterService: TraderPurchasePersisterService;
protected fenceService: FenceService;
protected fenceBaseAssortGenerator: FenceBaseAssortGenerator;
protected jsonUtil: JsonUtil;
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, fenceService: FenceService, jsonUtil: JsonUtil);
constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil);
/**
* Runs when onLoad event is fired
* Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService
@ -38,6 +42,13 @@ export declare class TraderController {
* @returns array if ITraderBase objects
*/
getAllTraders(sessionID: string): ITraderBase[];
/**
* Order traders by their traderId (Ttid)
* @param traderA First trader to compare
* @param traderB Second trader to compare
* @returns 1,-1 or 0
*/
protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number;
getTrader(sessionID: string, traderID: string): ITraderBase;
getAssort(sessionId: string, traderId: string): ITraderAssort;
getPurchasesData(sessionID: string, traderID: string): Record<string, IBarterScheme[][]>;

View File

@ -1,11 +1,18 @@
import { WeatherGenerator } from "../generators/WeatherGenerator";
import { IWeatherData } from "../models/eft/weather/IWeatherData";
import { IWeatherConfig } from "../models/spt/config/IWeatherConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
export declare class WeatherController {
protected weatherGenerator: WeatherGenerator;
protected logger: ILogger;
protected configServer: ConfigServer;
protected weatherConfig: IWeatherConfig;
constructor(weatherGenerator: WeatherGenerator, configServer: ConfigServer);
constructor(weatherGenerator: WeatherGenerator, logger: ILogger, configServer: ConfigServer);
generate(): IWeatherData;
/**
* Get the current in-raid time (MUST HAVE PLAYER LOGGED INTO CLIENT TO WORK)
* @returns Date object
*/
getCurrentInRaidTime(): Date;
}

View File

@ -1,10 +1,10 @@
import { ItemEventRouter } from "../routers/ItemEventRouter";
import { EventOutputHolder } from "../routers/EventOutputHolder";
import { IPmcData } from "../models/eft/common/IPmcData";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse";
import { IWishlistActionData } from "../models/eft/wishlist/IWishlistActionData";
export declare class WishlistController {
protected itemEvenRouter: ItemEventRouter;
constructor(itemEvenRouter: ItemEventRouter);
protected eventOutputHolder: EventOutputHolder;
constructor(eventOutputHolder: EventOutputHolder);
addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse;
}

View File

@ -3,6 +3,7 @@ import { DependencyContainer } from "tsyringe";
* Handle the registration of classes to be used by the Dependency Injection code
*/
export declare class Container {
static registerPostLoadTypes(container: DependencyContainer, childContainer: DependencyContainer): void;
static registerTypes(depContainer: DependencyContainer): void;
static registerListTypes(depContainer: DependencyContainer): void;
private static registerUtils;

View File

@ -1,4 +1,4 @@
export declare class OnLoad {
onLoad(): void;
export interface OnLoad {
onLoad(): Promise<void>;
getRoute(): string;
}

View File

@ -1,7 +0,0 @@
import { OnLoad } from "./OnLoad";
import { OnUpdate } from "./OnUpdate";
export declare class OnLoadOnUpdate implements OnLoad, OnUpdate {
onUpdate(timeSinceLastRun: number): boolean;
onLoad(): void;
getRoute(): string;
}

View File

@ -1,4 +1,4 @@
export declare class OnUpdate {
onUpdate(timeSinceLastRun: number): boolean;
export interface OnUpdate {
onUpdate(timeSinceLastRun: number): Promise<boolean>;
getRoute(): string;
}

View File

@ -1,5 +1,6 @@
import { IHttpServer } from "../models/spt/server/IHttpServer";
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "http";
export declare class Serializer {
serialize(sessionID: string, req: any, resp: any, body: any, httpServer: IHttpServer): void;
serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void;
canHandle(something: string): boolean;
}

View File

@ -0,0 +1,200 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ProbabilityHelper } from "../helpers/ProbabilityHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem, Slot } from "../models/eft/common/tables/ITemplateItem";
import { EquipmentFilterDetails, IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class BotEquipmentModGenerator {
protected logger: ILogger;
protected jsonUtil: JsonUtil;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected probabilityHelper: ProbabilityHelper;
protected databaseServer: DatabaseServer;
protected itemHelper: ItemHelper;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected itemFilterService: ItemFilterService;
protected profileHelper: ProfileHelper;
protected botWeaponModLimitService: BotWeaponModLimitService;
protected botHelper: BotHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected localisationService: LocalisationService;
protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer);
/**
* Check mods are compatible and add to array
* @param equipment Equipment item to add mods to
* @param modPool Mod list to choose frm
* @param parentId parentid of item to add mod to
* @param parentTemplate template objet of item to add mods to
* @param modSpawnChances dictionary of mod items and their chance to spawn for this bot type
* @param botRole the bot role being generated for
* @param forceSpawn should this mod be forced to spawn
* @returns Item + compatible mods as an array
*/
generateModsForEquipment(equipment: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, botRole: string, forceSpawn?: boolean): Item[];
/**
* Add mods to a weapon using the provided mod pool
* @param sessionId session id
* @param weapon Weapon to add mods to
* @param modPool Pool of compatible mods to attach to weapon
* @param weaponParentId parentId of weapon
* @param parentTemplate Weapon which mods will be generated on
* @param modSpawnChances Mod spawn chances
* @param ammoTpl Ammo tpl to use when generating magazines/cartridges
* @param botRole Role of bot weapon is generated for
* @param botLevel lvel of the bot weapon is being generated for
* @param modLimits limits placed on certian mod types per gun
* @param botEquipmentRole role of bot when accessing bot.json equipment config settings
* @returns Weapon + mods array
*/
generateModsForWeapon(sessionId: string, weapon: Item[], modPool: Mods, weaponParentId: string, parentTemplate: ITemplateItem, modSpawnChances: ModsChances, ammoTpl: string, botRole: string, botLevel: number, modLimits: BotModLimits, botEquipmentRole: string): Item[];
/**
* Is this modslot a front or rear sight
* @param modSlot Slot to check
* @returns true if it's a front/rear sight
*/
protected modIsFrontOrRearSight(modSlot: string): boolean;
/**
* Does the provided mod details show the mod can hold a scope
* @param modSlot e.g. mod_scope, mod_mount
* @param modsParentId Parent id of mod item
* @returns true if it can hold a scope
*/
protected modSlotCanHoldScope(modSlot: string, modsParentId: string): boolean;
/**
* Set all scope mod chances to 100%
* @param modSpawnChances Chances objet to update
*/
protected setScopeSpawnChancesToFull(modSpawnChances: ModsChances): void;
protected sortModKeys(unsortedKeys: string[]): string[];
/**
* Get a Slot property for an item (chamber/cartridge/slot)
* @param modSlot e.g patron_in_weapon
* @param parentTemplate item template
* @returns Slot item
*/
protected getModItemSlot(modSlot: string, parentTemplate: ITemplateItem): Slot;
/**
* randomly choose if a mod should be spawned, 100% for required mods OR mod is ammo slot
* never return true for an item that has 0% spawn chance
* @param itemSlot slot the item sits in
* @param modSlot slot the mod sits in
* @param modSpawnChances Chances for various mod spawns
* @returns boolean true if it should spawn
*/
protected shouldModBeSpawned(itemSlot: Slot, modSlot: string, modSpawnChances: ModsChances): boolean;
/**
*
* @param modSlot Slot mod will fit into
* @param isRandomisableSlot Will generate a randomised mod pool if true
* @param modsParent Parent slot the item will be a part of
* @param botEquipBlacklist Blacklist to prevent mods from being picked
* @param itemModPool Pool of items to pick from
* @param weapon array with only weapon tpl in it, ready for mods to be added
* @param ammoTpl ammo tpl to use if slot requires a cartridge to be added (e.g. mod_magazine)
* @param parentTemplate Parent item the mod will go into
* @returns ITemplateItem
*/
protected chooseModToPutIntoSlot(modSlot: string, isRandomisableSlot: boolean, botWeaponSightWhitelist: Record<string, string[]>, botEquipBlacklist: EquipmentFilterDetails, itemModPool: Record<string, string[]>, weapon: Item[], ammoTpl: string, parentTemplate: ITemplateItem): [boolean, ITemplateItem];
/**
* Create a mod item with parameters as properties
* @param modId _id
* @param modTpl _tpl
* @param parentId parentId
* @param modSlot slotId
* @param modTemplate Used to add additional properites in the upd object
* @returns Item object
*/
protected createModItem(modId: string, modTpl: string, parentId: string, modSlot: string, modTemplate: ITemplateItem, botRole: string): Item;
/**
* Get a list of containers that hold ammo
* e.g. mod_magazine / patron_in_weapon_000
* @returns string array
*/
protected getAmmoContainers(): string[];
/**
* Get a random mod from an items compatible mods Filter array
* @param modTpl ???? default value to return if nothing found
* @param parentSlot item mod will go into, used to get combatible items
* @param modSlot Slot to get mod to fill
* @param items items to ensure picked mod is compatible with
* @returns item tpl
*/
protected getModTplFromItemDb(modTpl: string, parentSlot: Slot, modSlot: string, items: Item[]): string;
/**
* Log errors if mod is not compatible with slot
* @param modToAdd template of mod to check
* @param itemSlot slot the item will be placed in
* @param modSlot slot the mod will fill
* @param parentTemplate template of the mods parent item
* @returns true if valid
*/
protected isModValidForSlot(modToAdd: [boolean, ITemplateItem], itemSlot: Slot, modSlot: string, parentTemplate: ITemplateItem): boolean;
/**
* Find mod tpls of a provided type and add to modPool
* @param desiredSlotName slot to look up and add we are adding tpls for (e.g mod_scope)
* @param modTemplate db object for modItem we get compatible mods from
* @param modPool Pool of mods we are adding to
*/
protected addCompatibleModsForProvidedMod(desiredSlotName: string, modTemplate: ITemplateItem, modPool: Mods, botEquipBlacklist: EquipmentFilterDetails): void;
/**
* Get the possible items that fit a slot
* @param parentItemId item tpl to get compatible items for
* @param modSlot Slot item should fit in
* @param botEquipBlacklist equipment that should not be picked
* @returns array of compatible items for that slot
*/
protected getDynamicModPool(parentItemId: string, modSlot: string, botEquipBlacklist: EquipmentFilterDetails): string[];
/**
* Take a list of tpls and filter out blacklisted values using itemFilterService + botEquipmentBlacklist
* @param allowedMods base mods to filter
* @param botEquipBlacklist equipment blacklist
* @param modSlot slot mods belong to
* @returns Filtered array of mod tpls
*/
protected filterWeaponModsByBlacklist(allowedMods: string[], botEquipBlacklist: EquipmentFilterDetails, modSlot: string): string[];
/**
* With the shotgun revolver (60db29ce99594040e04c4a27) 12.12 introduced CylinderMagazines.
* Those magazines (e.g. 60dc519adf4c47305f6d410d) have a "Cartridges" entry with a _max_count=0.
* Ammo is not put into the magazine directly but assigned to the magazine's slots: The "camora_xxx" slots.
* This function is a helper called by generateModsForItem for mods with parent type "CylinderMagazine"
* @param items The items where the CylinderMagazine's camora are appended to
* @param modPool modPool which should include available cartrigdes
* @param parentId The CylinderMagazine's UID
* @param parentTemplate The CylinderMagazine's template
*/
protected fillCamora(items: Item[], modPool: Mods, parentId: string, parentTemplate: ITemplateItem): void;
/**
* Take a record of camoras and merge the compatable shells into one array
* @param camorasWithShells camoras we want to merge into one array
* @returns string array of shells fro luitple camora sources
*/
protected mergeCamoraPoolsTogether(camorasWithShells: Record<string, string[]>): string[];
/**
* Filter out non-whitelisted weapon scopes
* @param weapon Weapon scopes will be added to
* @param scopes Full scope pool
* @param botWeaponSightWhitelist whitelist of scope types by weapon base type
* @returns array of scope tpls that have been filtered
*/
protected filterSightsByWeaponType(weapon: Item, scopes: string[], botWeaponSightWhitelist: Record<string, string[]>): string[];
}

View File

@ -1,38 +1,40 @@
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
import { BotHelper } from "../helpers/BotHelper";
import { GameEventHelper } from "../helpers/GameEventHelper";
import { ProfileHelper } from "../helpers/ProfileHelper";
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase";
import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Health as PmcHealth, IBotBase, Info, Skills } from "../models/eft/common/tables/IBotBase";
import { Health, IBotType } from "../models/eft/common/tables/IBotType";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { TimeUtil } from "../utils/TimeUtil";
import { BotInventoryGenerator } from "./BotInventoryGenerator";
declare namespace BotGenerator {
interface IRandomisedBotLevelResult {
level: number;
exp: number;
}
}
import { BotLevelGenerator } from "./BotLevelGenerator";
export declare class BotGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected timeUtil: TimeUtil;
protected jsonUtil: JsonUtil;
protected profileHelper: ProfileHelper;
protected databaseServer: DatabaseServer;
protected botInventoryGenerator: BotInventoryGenerator;
protected botLevelGenerator: BotLevelGenerator;
protected botEquipmentFilterService: BotEquipmentFilterService;
protected weightedRandomHelper: WeightedRandomHelper;
protected botHelper: BotHelper;
protected gameEventHelper: GameEventHelper;
protected botDifficultyHelper: BotDifficultyHelper;
protected seasonalEventService: SeasonalEventService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer);
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer);
/**
* Generate a player scav bot object
* @param role e.g. assault / pmcbot
@ -41,29 +43,40 @@ export declare class BotGenerator {
* @returns
*/
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
/**
* Choose if a bot should become a PMC by checking if bot type is allowed to become a Pmc in botConfig.convertFromChances and doing a random int check
* @param botRole the bot role to check if should be a pmc
* @returns true if should be a pmc
* Create x number of bots of the type/side/difficulty defined in botGenerationDetails
* @param sessionId Session id
* @param botGenerationDetails details on how to generate bots
* @returns array of bots
*/
protected shouldBotBePmc(botRole: string): boolean;
/**
* Get a randomised PMC side based on bot config value 'isUsec'
* @returns pmc side as string
*/
protected getRandomisedPmcSide(): string;
prepareAndGenerateBots(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase[];
/**
* Get a clone of the database\bots\base.json file
* @returns IBotBase object
*/
protected getCloneOfBotBase(): IBotBase;
protected generateBot(sessionId: string, bot: IBotBase, role: string, node: IBotType, isPmc: boolean, isPlayerScav?: boolean): IBotBase;
/**
* Create a IBotBase object with equipment/loot/exp etc
* @param sessionId Session id
* @param bot bots base file
* @param botJsonTemplate Bot template from db/bots/x.json
* @param botGenerationDetails details on how to generate the bot
* @returns IBotBase object
*/
protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase;
/**
* Create a bot nickname
* @param botJsonTemplate x.json from database
* @param isPlayerScav Will bot be player scav
* @param botRole role of bot e.g. assault
* @returns Nickname for bot
*/
protected generateBotNickname(botJsonTemplate: IBotType, isPlayerScav: boolean, botRole: string): string;
/**
* Log the number of PMCs generated to the debug console
* @param output Generated bot array, ready to send to client
*/
protected logPmcGeneratedCount(output: IBotBase[]): void;
protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult;
/**
* Converts health object to the required format
* @param healthObj health object from bot json
@ -73,19 +86,19 @@ export declare class BotGenerator {
protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth;
protected generateSkills(skillsObj: Skills): Skills;
/**
* Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType)
* @param pmcSide eft side (usec/bear)
* @returns pmc side as defined in config
* Generate a random Id for a bot and apply to bots _id and aid value
* @param bot bot to update
* @returns updated IBotBase object
*/
protected getPmcRole(pmcSide: string): string;
/**
* Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper)
* @param nodeInventory Bots inventory to iterate over
*/
protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void;
protected generateId(bot: IBotBase): IBotBase;
protected generateInventoryID(profile: IBotBase): IBotBase;
protected getPMCDifficulty(requestedDifficulty: string): string;
/**
* Randomise a bots game version and account category
* Chooses from all the game versions (standard, eod etc)
* Chooses account type (default, Sherpa, etc)
* @param botInfo bot info object to update
*/
protected getRandomisedGameVersionAndCategory(botInfo: Info): void;
/**
* Add a side-specific (usec/bear) dogtag item to a bots inventory
* @param bot bot to add dogtag to
@ -93,4 +106,3 @@ export declare class BotGenerator {
*/
protected generateDogtag(bot: IBotBase): IBotBase;
}
export {};

View File

@ -1,13 +1,20 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotHelper } from "../helpers/BotHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Inventory, Chances, Generation, Mods } from "../models/eft/common/tables/IBotType";
import { Chances, Generation, IBotType, Inventory, Mods } from "../models/eft/common/tables/IBotType";
import { EquipmentSlots } from "../models/enums/EquipmentSlots";
import { EquipmentFilterDetails, IBotConfig, RandomisationDetails } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { BotLootGenerator } from "./BotLootGenerator";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
export declare class BotInventoryGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
@ -16,9 +23,90 @@ export declare class BotInventoryGenerator {
protected botWeaponGenerator: BotWeaponGenerator;
protected botLootGenerator: BotLootGenerator;
protected botGeneratorHelper: BotGeneratorHelper;
protected botHelper: BotHelper;
protected weightedRandomHelper: WeightedRandomHelper;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, weightedRandomHelper: WeightedRandomHelper);
generateInventory(sessionId: string, templateInventory: Inventory, equipmentChances: Chances, generation: Generation, botRole: string, isPmc: boolean): PmcInventory;
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory): void;
protected localisationService: LocalisationService;
protected botEquipmentModPoolService: BotEquipmentModPoolService;
protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, botWeaponGenerator: BotWeaponGenerator, botLootGenerator: BotLootGenerator, botGeneratorHelper: BotGeneratorHelper, botHelper: BotHelper, weightedRandomHelper: WeightedRandomHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, botEquipmentModGenerator: BotEquipmentModGenerator, configServer: ConfigServer);
/**
* Add equipment/weapons/loot to bot
* @param sessionId Session id
* @param botJsonTemplate bot/x.json data from db
* @param botRole Role bot has (assault/pmcBot)
* @param isPmc Is bot being converted into a pmc
* @param botLevel Level of bot being generated
* @returns PmcInventory object with equipment/weapons/loot
*/
generateInventory(sessionId: string, botJsonTemplate: IBotType, botRole: string, isPmc: boolean, botLevel: number): PmcInventory;
/**
* Create a pmcInventory object with all the base/generic items needed
* @returns PmcInventory object
*/
protected generateInventoryBase(): PmcInventory;
/**
* Add equipment to a bot
* @param templateInventory bot/x.json data from db
* @param equipmentChances Chances items will be added to bot
* @param botRole Role bot has (assault/pmcBot)
* @param botInventory Inventory to add equipment to
* @param botLevel Level of bot
*/
protected generateAndAddEquipmentToBot(templateInventory: Inventory, equipmentChances: Chances, botRole: string, botInventory: PmcInventory, botLevel: number): void;
/**
* Add a piece of equipment with mods to inventory from the provided pools
* @param equipmentSlot Slot to select an item for
* @param equipmentPool Possible items to choose from
* @param modPool Possible mods to apply to item chosen
* @param spawnChances Chances items will be chosen to be added
* @param botRole Role of bot e.g. assault
* @param inventory Inventory to add item into
* @param randomisationDetails settings from bot.json to adjust how item is generated
*/
protected generateEquipment(equipmentSlot: string, equipmentPool: Record<string, number>, modPool: Mods, spawnChances: Chances, botRole: string, inventory: PmcInventory, randomisationDetails: RandomisationDetails): void;
/**
* Get all possible mods for item and filter down based on equipment blacklist from bot.json config
* @param itemTpl Item mod pool is being retreived and filtered
* @param equipmentBlacklist blacklist to filter mod pool with
* @returns Filtered pool of mods
*/
protected getFilteredDynamicModsForItem(itemTpl: string, equipmentBlacklist: EquipmentFilterDetails[]): Record<string, string[]>;
/**
* Work out what weapons bot should have equipped and add them to bot inventory
* @param templateInventory bot/x.json data from db
* @param equipmentChances Chances bot can have equipment equipped
* @param sessionId Session id
* @param botInventory Inventory to add weapons to
* @param botRole assault/pmcBot/bossTagilla etc
* @param isPmc Is the bot being generated as a pmc
* @param botLevel level of bot having weapon generated
* @param itemGenerationLimitsMinMax Limits for items the bot can have
*/
protected generateAndAddWeaponsToBot(templateInventory: Inventory, equipmentChances: Chances, sessionId: string, botInventory: PmcInventory, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
/**
* Calculate if the bot should have weapons in Primary/Secondary/Holster slots
* @param equipmentChances Chances bot has certain equipment
* @returns What slots bot should have weapons generated for
*/
protected getDesiredWeaponsForBot(equipmentChances: Chances): {
slot: EquipmentSlots;
shouldSpawn: boolean;
}[];
/**
* Add weapon + spare mags/ammo to bots inventory
* @param sessionId Session id
* @param weaponSlot Weapon slot being generated
* @param templateInventory bot/x.json data from db
* @param botInventory Inventory to add weapon+mags/ammo to
* @param equipmentChances Chances bot can have equipment equipped
* @param botRole assault/pmcBot/bossTagilla etc
* @param isPmc Is the bot being generated as a pmc
* @param itemGenerationLimitsMinMax
*/
protected addWeaponAndMagazinesToInventory(sessionId: string, weaponSlot: {
slot: EquipmentSlots;
shouldSpawn: boolean;
}, templateInventory: Inventory, botInventory: PmcInventory, equipmentChances: Chances, botRole: string, isPmc: boolean, itemGenerationLimitsMinMax: Generation, botLevel: number): void;
}

29
types/generators/BotLevelGenerator.d.ts vendored Normal file
View File

@ -0,0 +1,29 @@
import { MinMax } from "../models/common/MinMax";
import { IRandomisedBotLevelResult } from "../models/eft/bot/IRandomisedBotLevelResult";
import { ExpTable } from "../models/eft/common/IGlobals";
import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { BotGenerationDetails } from "../models/spt/bots/BotGenerationDetails";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { RandomUtil } from "../utils/RandomUtil";
export declare class BotLevelGenerator {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected databaseServer: DatabaseServer;
constructor(logger: ILogger, randomUtil: RandomUtil, databaseServer: DatabaseServer);
/**
* Return a randomised bot level and exp value
* @param levelDetails min and max of level for bot
* @param botGenerationDetails Deatils to help generate a bot
* @param bot being level is being generated for
* @returns IRandomisedBotLevelResult object
*/
generateBotLevel(levelDetails: MinMax, botGenerationDetails: BotGenerationDetails, bot: IBotBase): IRandomisedBotLevelResult;
/**
* Get the highest level a bot can be relative to the players level, but no futher than the max size from globals.exp_table
* @param playerLevel Players current level
* @param relativeDeltaMax max delta above player level to go
* @returns highest level possible for bot
*/
protected getHighestRelativeBotLevel(playerLevel: number, relativeDeltaMax: number, levelDetails: MinMax, expTable: ExpTable[]): number;
}

View File

@ -1,5 +1,7 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase";
import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
@ -9,6 +11,7 @@ import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotLootCacheService } from "../services/BotLootCacheService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotWeaponGenerator } from "./BotWeaponGenerator";
@ -16,15 +19,29 @@ export declare class BotLootGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;
protected botGeneratorHelper: BotGeneratorHelper;
protected botWeaponGenerator: BotWeaponGenerator;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botLootCacheService: BotLootCacheService;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected botConfig: IBotConfig;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botLootCacheService: BotLootCacheService, configServer: ConfigServer);
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances): void;
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer);
/**
* Add loot to bots containers
* @param sessionId Session id
* @param templateInventory x.json from database/bots
* @param itemCounts Liits on item types to be added as loot
* @param isPmc Will bot be a pmc
* @param botRole Role of bot, e.g. asssult
* @param botInventory Inventory to add loot to
* @param equipmentChances
* @param botLevel Level of bot
*/
generateLoot(sessionId: string, templateInventory: Inventory, itemCounts: ItemMinMax, isPmc: boolean, botRole: string, botInventory: PmcInventory, equipmentChances: Chances, botLevel: number): void;
protected getRandomisedCount(min: number, max: number, nValue: number): number;
/**
* Take random items from a pool and add to an inventory until totalItemCount or totalValueLimit is reached
@ -47,7 +64,7 @@ export declare class BotLootGenerator {
* @param botRole bots role, .e.g. pmcBot
* @param isPmc are we generating for a pmc
*/
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean): void;
protected addLooseWeaponsToInventorySlot(sessionId: string, botInventory: PmcInventory, equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): void;
/**
* Get a random item from the pool parameter using the biasedRandomNumber system
* @param pool pool of items to pick an item from
@ -111,7 +128,7 @@ export declare class BotLootGenerator {
* If no limit found for a non pmc bot, fall back to defaults
* @param isPmc is the bot we want limits for a pmc
* @param botRole what role does the bot have
* @returns dictionary of tplIds and limit
* @returns Dictionary of tplIds and limit
*/
protected getItemSpawnLimitsForBotType(isPmc: boolean, botRole: string): Record<string, number>;
/**

View File

@ -1,4 +1,5 @@
import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { MinMax } from "../models/common/MinMax";
@ -11,9 +12,13 @@ import { IBotConfig } from "../models/spt/config/IBotConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { BotWeaponModLimitService } from "../services/BotWeaponModLimitService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
import { BotEquipmentModGenerator } from "./BotEquipmentModGenerator";
import { IInventoryMagGen } from "./weapongen/IInventoryMagGen";
export declare class BotWeaponGenerator {
protected jsonUtil: JsonUtil;
protected logger: ILogger;
@ -24,9 +29,14 @@ export declare class BotWeaponGenerator {
protected botGeneratorHelper: BotGeneratorHelper;
protected randomUtil: RandomUtil;
protected configServer: ConfigServer;
protected botWeaponGeneratorHelper: BotWeaponGeneratorHelper;
protected botWeaponModLimitService: BotWeaponModLimitService;
protected botEquipmentModGenerator: BotEquipmentModGenerator;
protected localisationService: LocalisationService;
protected inventoryMagGenComponents: IInventoryMagGen[];
protected readonly modMagazineSlotId = "mod_magazine";
protected botConfig: IBotConfig;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer);
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil, configServer: ConfigServer, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botWeaponModLimitService: BotWeaponModLimitService, botEquipmentModGenerator: BotEquipmentModGenerator, localisationService: LocalisationService, inventoryMagGenComponents: IInventoryMagGen[]);
/**
* Pick a random weapon based on weightings and generate a functional weapon
* @param equipmentSlot Primary/secondary/holster
@ -37,7 +47,7 @@ export declare class BotWeaponGenerator {
* @param isPmc Is weapon generated for a pmc
* @returns GenerateWeaponResult object
*/
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
generateRandomWeapon(sessionId: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
/**
* Get a random weighted weapon from a bots pool of weapons
* @param equipmentSlot Primary/secondary/holster
@ -56,7 +66,7 @@ export declare class BotWeaponGenerator {
* @param isPmc
* @returns GenerateWeaponResult object
*/
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean): GenerateWeaponResult;
generateWeaponByTpl(sessionId: string, weaponTpl: string, equipmentSlot: string, botTemplateInventory: Inventory, weaponParentId: string, modChances: ModsChances, botRole: string, isPmc: boolean, botLevel: number): GenerateWeaponResult;
/**
* Create array with weapon base as only element and
* add additional properties based on weapon type
@ -67,7 +77,7 @@ export declare class BotWeaponGenerator {
* @param botRole for durability values
* @returns Base weapon item in array
*/
constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
protected constructWeaponBaseArray(weaponTpl: string, weaponParentId: string, equipmentSlot: string, weaponItemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for
@ -79,42 +89,26 @@ export declare class BotWeaponGenerator {
/**
* Checks if all required slots are occupied on a weapon and all it's mods
* @param weaponItemArray Weapon + mods
* @param botRole role of bot weapon is for
* @returns true if valid
*/
protected isWeaponValid(weaponItemArray: Item[]): boolean;
protected isWeaponValid(weaponItemArray: Item[], botRole: string): boolean;
/**
* Generates extra magazines or bullets (if magazine is internal) and adds them to TacticalVest and Pockets.
* Additionally, adds extra bullets to SecuredContainer
* @param weaponMods mods to attach to weapon
* @param weaponTemplate db template for weapon
* @param magCounts magazine count to add to inventory
* @param ammoTpl ammo templateId to add to magazines
* @param inventory inventory to add magazines to
* @param botRole the bot type we're getting generating extra mags for
* @returns
* @param generatedWeaponResult object with properties for generated weapon (weapon mods pool / weapon template / ammo tpl)
* @param magCounts Magazine count to add to inventory
* @param inventory Inventory to add magazines to
* @param botRole The bot type we're getting generating extra mags for
*/
addExtraMagazinesToInventory(weaponMods: Item[], weaponTemplate: ITemplateItem, magCounts: MinMax, ammoTpl: string, inventory: PmcInventory, botRole: string): void;
addExtraMagazinesToInventory(generatedWeaponResult: GenerateWeaponResult, magCounts: MinMax, inventory: PmcInventory, botRole: string): void;
/**
* Create a magazine using the parameters given
* @param magazineTpl Tpl of the magazine to create
* @param ammoTpl Ammo to add to magazine
* @param magTemplate template object of magazine
* @returns Item array
* Add Grendaes for UBGL to bots vest and secure container
* @param weaponMods Weapon array with mods
* @param generatedWeaponResult result of weapon generation
* @param inventory bot inventory to add grenades to
*/
protected createMagazine(magazineTpl: string, ammoTpl: string, magTemplate: ITemplateItem): Item[];
/**
* Get a randomised number of bullets for a specific magazine
* @param magCounts min and max count of magazines
* @param magTemplate magazine to generate bullet count for
* @returns bullet count number
*/
protected getRandomisedBulletCount(magCounts: MinMax, magTemplate: ITemplateItem): number;
/**
* Get a randomised count of magazines
* @param magCounts min and max value returned value can be between
* @returns numberical value of magazine count
*/
protected getRandomisedMagazineCount(magCounts: MinMax): number;
protected addUbglGrenadesToBotInventory(weaponMods: Item[], generatedWeaponResult: GenerateWeaponResult, inventory: PmcInventory): void;
/**
* Add ammo to the secure container
* @param stackCount How many stacks of ammo to add
@ -131,13 +125,6 @@ export declare class BotWeaponGenerator {
* @returns magazine tpl string
*/
protected getMagazineTplFromWeaponTemplate(weaponMods: Item[], weaponTemplate: ITemplateItem, botRole: string): string;
/**
* Get a weapons default magazine template id
* @param weaponTemplate weapon to get default magazine for
* @returns tpl of magazine
*/
protected getWeaponsDefaultMagazineTpl(weaponTemplate: ITemplateItem): string;
protected addBulletsToVestAndPockets(ammoTpl: string, bulletCount: number, inventory: PmcInventory): void;
/**
* Finds and return a compatible ammo tpl based on the bots ammo weightings (x.json/inventory/equipment/ammo)
* @param ammo a list of ammo tpls the weapon can use
@ -158,6 +145,13 @@ export declare class BotWeaponGenerator {
* @param ammoTpl
*/
protected fillExistingMagazines(weaponMods: Item[], magazine: Item, ammoTpl: string): void;
/**
* Add desired ammo tpl as item to weaponmods array, placed as child to UBGL
* @param weaponMods
* @param ubglMod
* @param ubglAmmoTpl
*/
protected fillUbgl(weaponMods: Item[], ubglMod: Item, ubglAmmoTpl: string): void;
/**
* Add cartridge item to weapon Item array, if it already exists, update
* @param weaponMods Weapon items array to amend

View File

@ -0,0 +1,28 @@
import { HandbookHelper } from "../helpers/HandbookHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ITraderConfig } from "../models/spt/config/ITraderConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
export declare class FenceBaseAssortGenerator {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
protected handbookHelper: HandbookHelper;
protected itemHelper: ItemHelper;
protected itemFilterService: ItemFilterService;
protected configServer: ConfigServer;
protected traderConfig: ITraderConfig;
constructor(logger: ILogger, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, itemHelper: ItemHelper, itemFilterService: ItemFilterService, configServer: ConfigServer);
/**
* Create base fence assorts dynamically and store in db
*/
generateFenceBaseAssorts(): void;
/**
* Check if item is valid for being added to fence assorts
* @param item Item to check
* @returns true if valid fence item
*/
protected isValidFenceItem(item: ITemplateItem): boolean;
}

View File

@ -1,5 +1,4 @@
import { ContainerHelper } from "../helpers/ContainerHelper";
import { GameEventHelper } from "../helpers/GameEventHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { PresetHelper } from "../helpers/PresetHelper";
import { RagfairServerHelper } from "../helpers/RagfairServerHelper";
@ -9,6 +8,8 @@ import { IStaticAmmoDetails, IStaticContainerProps, IStaticForcedProps, IStaticL
import { ILocationConfig } from "../models/spt/config/ILocationConfig";
import { ILogger } from "../models/spt/utils/ILogger";
import { ConfigServer } from "../servers/ConfigServer";
import { LocalisationService } from "../services/LocalisationService";
import { SeasonalEventService } from "../services/SeasonalEventService";
import { JsonUtil } from "../utils/JsonUtil";
import { MathUtil } from "../utils/MathUtil";
import { ObjectId } from "../utils/ObjectId";
@ -26,12 +27,13 @@ export declare class LocationGenerator {
protected ragfairServerHelper: RagfairServerHelper;
protected itemHelper: ItemHelper;
protected mathUtil: MathUtil;
protected gameEventHelper: GameEventHelper;
protected seasonalEventService: SeasonalEventService;
protected containerHelper: ContainerHelper;
protected presetHelper: PresetHelper;
protected localisationService: LocalisationService;
protected configServer: ConfigServer;
protected locationConfig: ILocationConfig;
constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, gameEventHelper: GameEventHelper, containerHelper: ContainerHelper, presetHelper: PresetHelper, configServer: ConfigServer);
constructor(logger: ILogger, jsonUtil: JsonUtil, objectId: ObjectId, randomUtil: RandomUtil, ragfairServerHelper: RagfairServerHelper, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer);
generateContainerLoot(containerIn: IStaticContainerProps, staticForced: IStaticForcedProps[], staticLootDist: Record<string, IStaticLootDetails>, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, locationName: string): IStaticContainerProps;
protected getLooseLootMultiplerForLocation(location: string): number;
protected getStaticLootMultiplerForLocation(location: string): number;
@ -47,7 +49,8 @@ export declare class LocationGenerator {
* Add forced spawn point loot into loot parameter array
* @param loot array to add forced loot to
* @param forcedSpawnPoints forced loot to add
* @param name of map currently generating forced loot for
*/
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[]): void;
protected addForcedLoot(loot: SpawnpointTemplate[], forcedSpawnPoints: SpawnpointsForced[], locationName: string): void;
protected createItem(tpl: string, staticAmmoDist: Record<string, IStaticAmmoDetails[]>, parentId?: string): IContainerItem;
}

View File

@ -6,17 +6,21 @@ import { LootRequest } from "../models/spt/services/LootRequest";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
import { ItemFilterService } from "../services/ItemFilterService";
import { LocalisationService } from "../services/LocalisationService";
import { HashUtil } from "../utils/HashUtil";
import { RandomUtil } from "../utils/RandomUtil";
export declare class LootGenerator {
protected logger: ILogger;
protected hashUtil: HashUtil;
protected databaseServer: DatabaseServer;
protected randomUtil: RandomUtil;
protected itemHelper: ItemHelper;
protected localisationService: LocalisationService;
protected itemFilterService: ItemFilterService;
constructor(logger: ILogger, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, itemFilterService: ItemFilterService);
constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, itemHelper: ItemHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService);
/**
* Generate a list of items based on options passed in
* @param options parameters to adjust what loot is generated
* Generate a list of items based on configuration options parameter
* @param options parameters to adjust how loot is generated
* @returns An array of loot items
*/
createRandomloot(options: LootRequest): LootItem[];
@ -33,23 +37,31 @@ export declare class LootGenerator {
* Find a random item in items.json and add to result array
* @param items items to choose from
* @param itemTypeCounts item limit counts
* @param options item filters
* @param result array to add found item to
* @returns true if item was valid and added to pool
*/
protected findAndAddRandomItemToLoot(items: [string, ITemplateItem][], itemTypeCounts: Record<string, {
current: number;
max: number;
}>, result: LootItem[]): boolean;
}>, options: LootRequest, result: LootItem[]): boolean;
/**
* Get a randomised stack count for an item between its StackMinRandom and StackMaxSize values
* @param item item to get stack count of
* @param options loot options
* @returns stack count
*/
protected getRandomisedStackCount(item: ITemplateItem, options: LootRequest): number;
/**
*
* Find a random item in items.json and add to result array
* @param globalDefaultPresets presets to choose from
* @param itemTypeCounts item limit counts
* @param itemBlacklist items to skip
* @param result array to add found preset to
* @returns true if preset was valid and added to pool
*/
protected findAndAddRandomPresetToLoot(globalDefaultPresets: [string, Preset][], itemTypeCounts: Record<string, {
current: number;
max: number;
}>, result: LootItem[]): boolean;
}>, itemBlacklist: string[], result: LootItem[]): boolean;
}

Some files were not shown because too many files have changed in this diff Show More