Fixing an oopsie from the very beginning.
This commit is contained in:
parent
b7107e1a0e
commit
245754fe4a
4
.gitignore
vendored
4
.gitignore
vendored
@ -29,5 +29,5 @@ config.json.bk
|
||||
desktop.ini
|
||||
*.zip
|
||||
*.js
|
||||
/Valens-AIO/Valens-AIO_*/**/*.*
|
||||
/Valens-AIO/Valens-AIO_*/*.*
|
||||
/Valens-AIO_*/**/*.*
|
||||
/Valens-AIO_*/*.*
|
@ -1,273 +0,0 @@
|
||||
{
|
||||
"DebugMode": false,
|
||||
|
||||
"ammo":
|
||||
{
|
||||
"ammoStacks":
|
||||
{
|
||||
"grenadeCartridges": 1,
|
||||
"marksmanCartridges": 40,
|
||||
"pistolCartridges": 50,
|
||||
"rifleCartridges": 60,
|
||||
"shotgunCartridges": 20
|
||||
}
|
||||
},
|
||||
|
||||
"bots":
|
||||
{
|
||||
"bossChance":
|
||||
{
|
||||
"activated": false,
|
||||
"chance": 100
|
||||
},
|
||||
|
||||
"maxBotCap": 20,
|
||||
|
||||
"pmc":
|
||||
{
|
||||
"chanceSameSideIsHostile": 50,
|
||||
"containersOnPMCs": true,
|
||||
"isUsec": 50,
|
||||
"lootNValue": 3,
|
||||
"maxBackpackLootTotalRub": 150000,
|
||||
"maxPocketLootTotalRub": 50000,
|
||||
"maxVestLootTotalRub": 50000,
|
||||
|
||||
"convertIntoPmcChance":
|
||||
{
|
||||
"assault":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 40
|
||||
},
|
||||
"cursedAssault":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 40
|
||||
},
|
||||
"pmcBot":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 30
|
||||
},
|
||||
"exUsec":
|
||||
{
|
||||
"min": 5,
|
||||
"max": 20
|
||||
}
|
||||
},
|
||||
|
||||
"difficultyWeights":
|
||||
{
|
||||
"difficulty": "asonline",
|
||||
"useWeights": false,
|
||||
"weights":
|
||||
{
|
||||
"easy": 0,
|
||||
"normal": 60,
|
||||
"hard": 20,
|
||||
"impossible": 20
|
||||
}
|
||||
},
|
||||
|
||||
"looseWeaponInBackpackChance": 15,
|
||||
"looseWeaponInBackpackLoot":
|
||||
{
|
||||
"min": 1,
|
||||
"max": 1
|
||||
}
|
||||
},
|
||||
|
||||
"scav":
|
||||
{
|
||||
"lootNValue": 4
|
||||
}
|
||||
},
|
||||
|
||||
"flea":
|
||||
{
|
||||
"minUserLevel": 15,
|
||||
|
||||
"blacklist":
|
||||
{
|
||||
"enableBsgList": true,
|
||||
"enableQuestList": true
|
||||
},
|
||||
|
||||
"condition":
|
||||
{
|
||||
"conditionChance": 0.2,
|
||||
"min": 0.6,
|
||||
"max": 1.0
|
||||
},
|
||||
|
||||
"currencies":
|
||||
{
|
||||
"roubles": 78,
|
||||
"dollars": 20,
|
||||
"euros": 2
|
||||
},
|
||||
|
||||
"offerItemCount":
|
||||
{
|
||||
"min": 8,
|
||||
"max": 15
|
||||
},
|
||||
|
||||
"reputation":
|
||||
{
|
||||
"gain": 0.0000002,
|
||||
"loss": 0.0000002
|
||||
},
|
||||
|
||||
"time":
|
||||
{
|
||||
"baseSellTime": 15,
|
||||
"minSellTime": 5,
|
||||
"maxSellTime": 15
|
||||
}
|
||||
},
|
||||
|
||||
"globals":
|
||||
{
|
||||
|
||||
"damagePerMeter": 9,
|
||||
"safeHeight": 3,
|
||||
"maxLoyaltyTraders": false,
|
||||
"timeBeforeDeployLocal": 10,
|
||||
|
||||
"matchEnd":
|
||||
{
|
||||
"survivedExpRequirement": 200,
|
||||
"survivedSecondsRequirement": 420,
|
||||
"survivedExpReward": 300,
|
||||
"miaExpReward": 200,
|
||||
"runnerExpReward": 200,
|
||||
"leftMult": 0,
|
||||
"miaMult": 1,
|
||||
"survivedMult": 1.3,
|
||||
"runnerMult": 0.5,
|
||||
"killedMult": 1,
|
||||
"headShotMult": 1.2,
|
||||
"expOnDamageAllHealth": 50
|
||||
}
|
||||
},
|
||||
|
||||
"hideout":
|
||||
{
|
||||
"airFilterUnitFlowRate": 0.0047222222222222,
|
||||
"constructionTime": 1,
|
||||
"generatorFuelFlowRate": 0.0013194444444444,
|
||||
"gpuBoostRate": 0.041225,
|
||||
"productionTime": 1,
|
||||
"scavCaseTime": 1
|
||||
},
|
||||
|
||||
"insurance":
|
||||
{
|
||||
"insuranceMultiplier":
|
||||
{
|
||||
"prapor": 0.16,
|
||||
"therapist": 0.25
|
||||
},
|
||||
"returnChancePercent":
|
||||
{
|
||||
"prapor": 80,
|
||||
"therapist": 85
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
"items":
|
||||
{
|
||||
"standardStash":
|
||||
{
|
||||
"vertical": 28,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"behindStash":
|
||||
{
|
||||
"vertical": 38,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"escapeStash":
|
||||
{
|
||||
"vertical": 48,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"eodStash":
|
||||
{
|
||||
"vertical": 68,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"examinedByDefault": false,
|
||||
"removeBackpackFilter": true,
|
||||
"removeKeyUsageMax": false,
|
||||
"roublesMaxStack": 500000,
|
||||
"dollarsMaxStack": 50000,
|
||||
"eurosMaxStack": 50000,
|
||||
"weightModifier": 1
|
||||
},
|
||||
|
||||
"locations":
|
||||
{
|
||||
"allExtractsAvailable": false,
|
||||
"exfilTime": 8,
|
||||
"extractionsExtended": false,
|
||||
"noExtractRestrictions": false
|
||||
},
|
||||
|
||||
"loot":
|
||||
{
|
||||
"containersInMarkedRoom": true,
|
||||
"looseLootMultiplier": 1,
|
||||
"staticLootMultiplier": 1
|
||||
},
|
||||
|
||||
"progression":
|
||||
{
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
"quests":
|
||||
{
|
||||
"onlyFoundInRaid": true
|
||||
},
|
||||
|
||||
"raid":
|
||||
{
|
||||
"carExtractBaseStandingGain": 0.25,
|
||||
"chompiesBossFix": true,
|
||||
"fixOpenZones": true,
|
||||
"scavExtractGain": 0.01,
|
||||
"timeLimit": 60,
|
||||
"aiAmount": "asonline",
|
||||
"aiDifficulty": "asonline",
|
||||
"bossEnabled": true,
|
||||
"scavWars": false,
|
||||
"taggedAndCursed": false,
|
||||
"enablePve": true
|
||||
},
|
||||
|
||||
"prewipeEvents":
|
||||
{
|
||||
"allBossesOnReserve": false,
|
||||
"allTradersSellCheapItems": false,
|
||||
"gluharOnLabs": false,
|
||||
"killaOnFactory": false,
|
||||
"makeObdolbosPowerful": false
|
||||
},
|
||||
|
||||
"weapons":
|
||||
{
|
||||
"jam": false,
|
||||
"misfeed": false,
|
||||
"misfire": false,
|
||||
"overheat": false,
|
||||
"slide": false
|
||||
}
|
||||
}
|
@ -1,284 +0,0 @@
|
||||
export interface Config
|
||||
{
|
||||
DebugMode: boolean
|
||||
ammo: Ammo
|
||||
bots: Bots
|
||||
flea: Flea
|
||||
globals: Globals
|
||||
hideout: Hideout
|
||||
insurance: Insurance
|
||||
items: Items
|
||||
locations: Locations
|
||||
loot: Loot
|
||||
progression: Progression
|
||||
raid: Raid
|
||||
quests: Quests
|
||||
prewipeEvents: PrewipeEvents
|
||||
weapons: Weapons
|
||||
}
|
||||
|
||||
export interface Ammo
|
||||
{
|
||||
ammoStacks: AmmoStacks
|
||||
}
|
||||
|
||||
export interface AmmoStacks
|
||||
{
|
||||
grenadeCartridges: number
|
||||
marksmanCartridges: number
|
||||
pistolCartridges: number
|
||||
rifleCartridges: number
|
||||
shotgunCartridges: number
|
||||
}
|
||||
|
||||
export interface Bots
|
||||
{
|
||||
bossChance: BossChance
|
||||
maxBotCap: number
|
||||
pmc: Pmc
|
||||
scav: Scav
|
||||
}
|
||||
|
||||
export interface BossChance
|
||||
{
|
||||
activated: boolean
|
||||
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: Weights
|
||||
}
|
||||
|
||||
export interface Weights
|
||||
{
|
||||
easy: number
|
||||
normal: number
|
||||
hard: number
|
||||
impossible: number
|
||||
}
|
||||
|
||||
export interface ConvertIntoPmcChance
|
||||
{
|
||||
assault: PmcChance
|
||||
cursedAssault: PmcChance
|
||||
pmcBot : PmcChance
|
||||
exUsec : PmcChance
|
||||
}
|
||||
|
||||
export interface PmcChance
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface LooseWeapon
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Scav
|
||||
{
|
||||
lootNValue: number
|
||||
}
|
||||
|
||||
export interface Flea
|
||||
{
|
||||
minUserLevel: number
|
||||
blacklist: Blacklist
|
||||
condition: Condition
|
||||
currencies: Currencies
|
||||
offerItemCount: OfferItemCount
|
||||
reputation: Reputation
|
||||
time: Time
|
||||
}
|
||||
|
||||
export interface Blacklist
|
||||
{
|
||||
enableBsgList: boolean
|
||||
enableQuestList: boolean
|
||||
}
|
||||
|
||||
export interface Condition
|
||||
{
|
||||
conditionChance: number
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Currencies
|
||||
{
|
||||
roubles: number
|
||||
dollars: number
|
||||
euros: number
|
||||
}
|
||||
|
||||
export interface OfferItemCount
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Reputation
|
||||
{
|
||||
gain: number
|
||||
loss: number
|
||||
}
|
||||
|
||||
export interface Time
|
||||
{
|
||||
baseSellTime: number
|
||||
minSellTime: number
|
||||
maxSellTime: number
|
||||
}
|
||||
|
||||
export interface Globals
|
||||
{
|
||||
damagePerMeter: number
|
||||
safeHeight: number
|
||||
maxLoyaltyTraders: boolean
|
||||
timeBeforeDeployLocal: number
|
||||
matchEnd: MatchEnd
|
||||
}
|
||||
|
||||
export interface MatchEnd
|
||||
{
|
||||
survivedExpRequirement: number
|
||||
survivedSecondsRequirement: number
|
||||
survivedExpReward: number
|
||||
miaExpReward: number
|
||||
runnerExpReward: number
|
||||
leftMult: number
|
||||
miaMult: number
|
||||
survivedMult: number
|
||||
runnerMult: number
|
||||
killedMult: number
|
||||
headShotMult: number
|
||||
expOnDamageAllHealth: number
|
||||
}
|
||||
|
||||
export interface Hideout
|
||||
{
|
||||
airFilterUnitFlowRate: number
|
||||
constructionTime: number
|
||||
generatorFuelFlowRate: number
|
||||
gpuBoostRate: number
|
||||
productionTime: number
|
||||
scavCaseTime: number
|
||||
}
|
||||
|
||||
export interface Insurance
|
||||
{
|
||||
insuranceMultiplier: InsuranceMultiplier
|
||||
returnChancePercent: ReturnChancePercent
|
||||
}
|
||||
|
||||
export interface InsuranceMultiplier
|
||||
{
|
||||
prapor: number
|
||||
therapist: number
|
||||
}
|
||||
|
||||
export interface ReturnChancePercent
|
||||
{
|
||||
prapor: number
|
||||
therapist: number
|
||||
}
|
||||
|
||||
export interface Items
|
||||
{
|
||||
standardStash: Stash
|
||||
behindStash: Stash
|
||||
escapeStash: Stash
|
||||
eodStash: Stash
|
||||
examinedByDefault: boolean
|
||||
removeBackpackFilter: boolean
|
||||
removeKeyUsageMax: boolean
|
||||
dollarsMaxStack: number
|
||||
eurosMaxStack: number
|
||||
roublesMaxStack: number
|
||||
weightModifier: number
|
||||
}
|
||||
|
||||
export interface Stash
|
||||
{
|
||||
vertical: number
|
||||
horizontal: number
|
||||
}
|
||||
|
||||
export interface Locations
|
||||
{
|
||||
allExtractsAvailable: boolean
|
||||
exfilTime: number
|
||||
extractionsExtended: boolean
|
||||
noExtractRestrictions: boolean
|
||||
}
|
||||
|
||||
export interface Loot
|
||||
{
|
||||
containersInMarkedRoom: boolean
|
||||
looseLootMultiplier: number
|
||||
staticLootMultiplier: number
|
||||
}
|
||||
|
||||
export interface Progression
|
||||
{
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export interface Quests
|
||||
{
|
||||
onlyFoundInRaid: boolean
|
||||
}
|
||||
|
||||
export interface Raid
|
||||
{
|
||||
carExtractBaseStandingGain: number
|
||||
chompiesBossFix: boolean
|
||||
fixOpenZones: boolean
|
||||
scavExtractGain: number
|
||||
timeLimit: number
|
||||
aiAmount: string
|
||||
aiDifficulty: string
|
||||
bossEnabled: boolean
|
||||
scavWars: boolean
|
||||
taggedAndCursed: boolean
|
||||
enablePve: boolean
|
||||
}
|
||||
|
||||
export interface PrewipeEvents
|
||||
{
|
||||
allBossesOnReserve: boolean
|
||||
allTradersSellCheapItems: boolean
|
||||
gluharOnLabs: boolean
|
||||
killaOnFactory: boolean
|
||||
makeObdolbosPowerful: boolean
|
||||
}
|
||||
|
||||
export interface Weapons
|
||||
{
|
||||
jam: boolean
|
||||
misfeed: boolean
|
||||
misfire: boolean
|
||||
overheat: boolean
|
||||
slide: boolean
|
||||
}
|
||||
|
@ -1,212 +0,0 @@
|
||||
{
|
||||
"containers":
|
||||
{
|
||||
"commonContainers":
|
||||
{
|
||||
"enabled": false,
|
||||
"AMMO_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"DOCUMENTS_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 1,
|
||||
"cellsH": 4,
|
||||
"cellsV": 4
|
||||
},
|
||||
|
||||
"DOGTAG_CASE":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 10,
|
||||
"cellsV": 10
|
||||
},
|
||||
|
||||
"GRENADE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"INJECTOR_CASE":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"ITEM_CASE":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"KEY_TOOL":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 4,
|
||||
"cellsV": 4
|
||||
},
|
||||
|
||||
"KEYCARD_HOLDER":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"SCAV_JUNKBOX":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"cellsH": 14,
|
||||
"cellsV": 14
|
||||
},
|
||||
|
||||
"MAGAZINE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"MEDICINE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"MONEY_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"HOLODILNICK_THERMAL_BAG":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"PISTOL_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 4,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"SICC_ORGANIZATIONAL_POUCH":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 1,
|
||||
"cellsH": 5,
|
||||
"cellsV": 5
|
||||
},
|
||||
|
||||
"SIMPLE_WALLET":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"THICC_ITEM_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 3,
|
||||
"cellsH": 14,
|
||||
"cellsV": 14
|
||||
},
|
||||
|
||||
"THICC_WEAPON_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 2,
|
||||
"cellsH": 6,
|
||||
"cellsV": 15
|
||||
},
|
||||
|
||||
"WEAPON_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 2,
|
||||
"cellsH": 5,
|
||||
"cellsV": 10
|
||||
},
|
||||
|
||||
"WZ_WALLET":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
}
|
||||
},
|
||||
|
||||
"securedContainers":
|
||||
{
|
||||
"enabled": false,
|
||||
"ALPHA":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"BETA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 3,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"EPSILON":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 2,
|
||||
"cellsH": 4,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"GAMMA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"KAPPA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 3,
|
||||
"cellsV": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import { Grenade, MarksmanCaliber, PistolCaliber, RifleCaliber, Shotguns } from "./ammotypes";
|
||||
import { Config } from "../config/config";
|
||||
|
||||
export class Ammo
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json")
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
}
|
||||
|
||||
public updateAmmo(): void
|
||||
{
|
||||
const items = this.tables.templates.items;
|
||||
const mod = this.modConfig.ammo;
|
||||
|
||||
if (mod.ammoStacks.grenadeCartridges != 1)
|
||||
{
|
||||
for (const value of Object.values(Grenade))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.ammoStacks.grenadeCartridges
|
||||
this.logger.info(`Grenade Cartridges Max Stacks set to ${mod.ammoStacks.grenadeCartridges}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (mod.ammoStacks.marksmanCartridges != 40)
|
||||
{
|
||||
for (const value of Object.values(MarksmanCaliber))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.ammoStacks.marksmanCartridges
|
||||
this.logger.info(`Marksman Cartridges Max Stacks set to ${mod.ammoStacks.marksmanCartridges}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (mod.ammoStacks.pistolCartridges != 50)
|
||||
{
|
||||
for (const value of Object.values(PistolCaliber))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.ammoStacks.pistolCartridges
|
||||
this.logger.info(`Pistol Cartridges Max Stacks set to ${mod.ammoStacks.pistolCartridges}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (mod.ammoStacks.rifleCartridges != 60)
|
||||
{
|
||||
for (const value of Object.values(RifleCaliber))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.ammoStacks.rifleCartridges
|
||||
this.logger.info(`Rifle Cartridges Max Stacks set to ${mod.ammoStacks.rifleCartridges}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (mod.ammoStacks.shotgunCartridges != 20)
|
||||
{
|
||||
for (const value of Object.values(Shotguns))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.ammoStacks.shotgunCartridges
|
||||
this.logger.info(`Shotgun Cartridges Max Stacks set to ${mod.ammoStacks.shotgunCartridges}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,189 +0,0 @@
|
||||
export enum Grenade
|
||||
{
|
||||
M386_HE_GRENADE = "5ede475b549eed7c6d5c18fb",
|
||||
M576_MP_APERS_GRENADE = "5ede475339ee016e8c534742",
|
||||
M433_HEDP_GRENADE = "5f0c892565703e5c461894e9",
|
||||
M406_HE_GRENADE = "5ede4739e0350d05467f73e8",
|
||||
M381_HE_GRENADE = "5ede474b0c226a66f5402622",
|
||||
M441_HE_GRENADE = "5ede47405b097655935d7d16"
|
||||
}
|
||||
|
||||
export enum MarksmanCaliber
|
||||
{
|
||||
M62_TRACER = "5a608bf24f39f98ffc77720e",
|
||||
M80 = "58dd3ad986f77403051cba8f",
|
||||
M61 = "5a6086ea4f39f99cd479502f",
|
||||
BCP_FMJ = "5e023e53d4353e3302577c4c",
|
||||
ULTRA_NOSLER = "5e023e88277cce2b522ff2b1",
|
||||
TCW_SP = "5e023e6e34d52a55c3304f71",
|
||||
M993 = "5efb0c1bd79ff02a1f5e68d9",
|
||||
TAC_X = "5fc382b6d6fa9c00c571bbc3",
|
||||
UCW = "5fc382c1016cce60e8341b20",
|
||||
AP = "5fc382a9d724d907e2077dab",
|
||||
FMJ = "5fc275cf85fd526b824a571a",
|
||||
SNB_GZH = "560d61e84bdc2da74d8b4571",
|
||||
LPS_GZH = "5887431f2459777e1612938f",
|
||||
PS_GZH = "59e77a2386f7742ee578960a",
|
||||
T46M_GZH = "5e023cf8186a883be655e54f",
|
||||
BT_GZH = "5e023d34e8a400319a28ed44",
|
||||
BS_GZH = "5e023d48186a883be655e551"
|
||||
}
|
||||
|
||||
export enum PistolCaliber
|
||||
{
|
||||
AP_SX = "5ba26835d4351e0035628ff5",
|
||||
ACTION_SX = "5ba26812d4351e003201fef1",
|
||||
FMJ_SX = "5ba2678ad4351e44f824b344",
|
||||
SUBSONIC_SX = "5ba26844d4351e00334c9475",
|
||||
SS198LF = "5cc80f79e4a949033c7343b2",
|
||||
R37_F = "5cc86832d7f00c000d3a6e6c",
|
||||
SS190 = "5cc80f38e4a949001152b560",
|
||||
R37_X = "5cc86840d7f00c002412c56c",
|
||||
L191 = "5cc80f53e4a949000e1ea4f8",
|
||||
SS197SR = "5cc80f8fe4a949033b0224a2",
|
||||
SB193 = "5cc80f67e4a949035e43bbba",
|
||||
FMJ43 = "5735ff5c245977640e39ba7e",
|
||||
LRN = "573601b42459776410737435",
|
||||
P_GL = "5736026a245977644601dc61",
|
||||
PST_GZH762 = "573603562459776430731618",
|
||||
LRNPC = "573602322459776445391df1",
|
||||
AKBS = "5735fdcd2459776445391d61",
|
||||
PT_GZH = "573603c924597764442bd9cb",
|
||||
PM_SP8_GZH = "5737218f245977612125ba51",
|
||||
P_GZH18 = "573719762459775a626ccbc1",
|
||||
PSTM_GZH = "57371aab2459775a77142f22",
|
||||
RG028_GZH = "573720e02459776143012541",
|
||||
BZHT_GZH = "573718ba2459775a75491131",
|
||||
PM_PSV = "5737207f24597760ff7b25f2",
|
||||
SP7_GZH = "57372140245977611f70ee91",
|
||||
PBM_GZH = "573719df2459775a626ccbc2",
|
||||
PSO_GZH18 = "57371f8d24597761006c6a81",
|
||||
PST_GZH18 = "5737201124597760fc4431f1",
|
||||
PS_GS_PPO = "57371f2b24597761224311f1",
|
||||
PRS_GS = "57371eb62459776125652ac1",
|
||||
PPT_GZH = "57371e4124597760ff7b25f1",
|
||||
PPE_GZH = "57371b192459775a9f58a5e0",
|
||||
PSO_GZH = "58864a4f2459770fcc257101",
|
||||
PST_GZH19 = "56d59d3ad2720bdb418b4577",
|
||||
GREEN_TRACER = "5c3df7d588a4501f290594e5",
|
||||
RIP19 = "5c0d56a986f774449d5de529",
|
||||
AP_63 = "5c925fa22e221601da359b7b",
|
||||
LUGER_CCI = "5a3c16fe86f77452b62de32a",
|
||||
PBP_GZH = "5efb0da7a29a85116f6ea05f",
|
||||
QUAKEMAKER = "5efb0e16aeb21837e749c7ff",
|
||||
P_GZH = "5a26abfac4a28232980eabff",
|
||||
PS_GZH = "5a269f97c4a282000b151807",
|
||||
PE_GZH = "5a26ac06c4a282000c5a90a8",
|
||||
BT_GZH = "5a26ac0ec4a28200741e1e18",
|
||||
FMJ = "62330b3ed4dc74626d570b95",
|
||||
HOLLOW_POINT = "62330bfadc5883093563729b",
|
||||
SOFT_POINT = "62330c40bdd19b369e1e53d1",
|
||||
JACKET_HP = "62330c18744e5e31df12f516",
|
||||
MATCH_FMJ = "5e81f423763d9f754677bf2e",
|
||||
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
|
||||
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
|
||||
AP = "5efb0cabfb3e451d70735af5",
|
||||
RIP45 = "5ea2a8e200685063ec28c05a"
|
||||
}
|
||||
|
||||
export enum RifleCaliber
|
||||
{
|
||||
PS_GS = "56dff3afd2720bba668b4567",
|
||||
SP = "56dff421d2720b5f5a8b4567",
|
||||
PPBS_GS_IGOLNIK = "5c0d5e4486f77478390952fe",
|
||||
BS_7N40 = "61962b617c6c7b169525f168",
|
||||
PRS_GS = "56dff338d2720bbd668b4569",
|
||||
BT_GS = "56dff061d2720bb5668b4567",
|
||||
US_GS = "56dff4ecd2720b5f5a8b4568",
|
||||
BP_GS_545 = "56dfef82d2720bbd668b4567",
|
||||
HP_545 = "56dff216d2720bbd668b4568",
|
||||
BS_GS = "56dff026d2720bb8668b4567",
|
||||
T_GS = "56dff4a2d2720bbd668b456a",
|
||||
PP_GS = "56dff2ced2720bb4668b4567",
|
||||
FMJ_545 = "56dff0bed2720bb0668b4567",
|
||||
M856 = "59e68f6f86f7746c9f75e846",
|
||||
MK255_MOD_0_RRLP = "59e6918f86f7746c9f75e849",
|
||||
M995 = "59e690b686f7746c9f75e848",
|
||||
M855A1 = "54527ac44bdc2d36668b4567",
|
||||
M856A1 = "59e6906286f7746c9f75e847",
|
||||
M855 = "54527a984bdc2d4e668b4567",
|
||||
HP_556 = "59e6927d86f77411da468256",
|
||||
FMJ_556 = "59e6920f86f77411d82aa167",
|
||||
WARMAGEDDON = "5c0d5ae286f7741e46554302",
|
||||
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
|
||||
SSA_AP = "601949593ae8f707c4608daa",
|
||||
M62_TRACER = "619636be6db0f2477964e710",
|
||||
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
|
||||
AP = "5fd20ff893a8961fc660a954",
|
||||
V_MAX = "6196364158ef8c428c287d9f",
|
||||
WHISPER = "6196365d58ef8c428c287da1",
|
||||
PS_GZH = "5656d7c34bdc2d9d198b4587",
|
||||
HP_762 = "59e4d3d286f774176a36250a",
|
||||
US_GZH = "59e4d24686f7741776641ac7",
|
||||
T45M1_GZH = "59e4cf5286f7741778269d8a",
|
||||
BP_GZH = "59e0d99486f7744a32234762",
|
||||
MAI_AP = "601aa3d2b2bcb34913271e6d",
|
||||
SP5_GS = "57a0dfb82459774d3078b56c",
|
||||
BP_GS = "5c0d688c86f77413ae3407b2",
|
||||
SP6_GS = "57a0e5022459774d1673f889",
|
||||
SPP_GS = "5c0d668f86f7747ccb7f13b2",
|
||||
PAB9_GS = "61962d879bb3d20b0946d385",
|
||||
FMJ_366 = "59e6542b86f77411dc52a77a",
|
||||
GEKSA = "59e6658b86f77411d949b250",
|
||||
EKO = "59e655cb86f77411dc52a77b",
|
||||
APM = "5f0596629e22f464da6bbdd9",
|
||||
PS12 = "5cadf6ddae9215051e1c23b2",
|
||||
PS12B = "5cadf6eeae921500134b2799",
|
||||
PS12A = "5cadf6e5ae921500113bb973"
|
||||
}
|
||||
|
||||
export enum Shotguns
|
||||
{
|
||||
BUCKSHOT_7MM = "560d5e524bdc2d25448b4571",
|
||||
MAGNUM_85MM = "5d6e6806a4b936088465b17e",
|
||||
RIP = "5c0d591486f7744c505b416f",
|
||||
BMG_SLUG_50CAL = "5d6e68c4a4b9361b93413f79",
|
||||
BUCKSHOT_525MM = "5d6e6772a4b936088465b17c",
|
||||
EXPRESS_65MM = "5d6e67fba4b9361bc73bc779",
|
||||
FLECHETTE = "5d6e6911a4b9361bd5780d52",
|
||||
FTX_CUSTOM_LITE_SLUG = "5d6e68e6a4b9361c140bcfe0",
|
||||
AP20_ARMOR_PIERCING_SLUG = "5d6e68a8a4b9360b6c0d54e2",
|
||||
DUAL_SABOT_SLUG = "5d6e68dea4b9361bcc29e659",
|
||||
POLEVA_6U_SLUG_12GA = "5d6e689ca4b9361bc8618956",
|
||||
POLEVA_3_SLUG_12GA = "5d6e6891a4b9361bd473feea",
|
||||
GRIZZLY_40_SLUG = "5d6e6869a4b9361c140bcfde",
|
||||
SUPERFORMANCE_HP_SLUG = "5d6e68d1a4b93622fe60e845",
|
||||
COPPER_SABOT_PREMIER_HP_SLUG = "5d6e68b3a4b9361bca7e50b5",
|
||||
LEAD_SLUG = "58820d1224597753c90aeb13",
|
||||
BUCKSHOT_75MM = "5a38ebd9c4a282000d722a5b",
|
||||
STAR_SLUG = "5d6e6a05a4b93618084f58d0",
|
||||
BUCKSHOT_73MM = "5d6e69c7a4b9360b6c0d54e4",
|
||||
DEVASTATOR_SLUG = "5d6e6a5fa4b93614ec501745",
|
||||
BUCKSHOT_56MM = "5d6e695fa4b936359b35d852",
|
||||
POLEVA_6U_SLUG_20GA = "5d6e6a42a4b9364f07165f52",
|
||||
POLEVA_3_SLUG_20GA = "5d6e6a53a4b9361bd473feec",
|
||||
BUCKSHOT_62MM = "5d6e69b9a4b9361bc8618958",
|
||||
SHRAPNEL10_BUCKSHOT = "5e85a9a6eacf8c039e4e2ac1",
|
||||
SHRAPNEL25_BUCKSHOT = "5f647f31b6238e5dd066e196",
|
||||
ZVEZDA_FLASHBANG = "5e85a9f4add9fe03027d9bf1",
|
||||
BARRIKADA_SLUG = "5e85aa1a988a8701445df1f5"
|
||||
}
|
||||
|
||||
export enum Ammo30x29
|
||||
{
|
||||
VOG_30 = "5d70e500a4b9364de70d38ce"
|
||||
}
|
||||
|
||||
export enum Ammo127x108
|
||||
{
|
||||
B32 = "5cde8864d7f00c0010373be1",
|
||||
BZT_44M = "5d2f2ab648f03550091993ca"
|
||||
}
|
||||
|
||||
export enum Ammo26x75
|
||||
{
|
||||
GREEN_FLARE = "62389aaba63f32501b1b444f",
|
||||
RED_FLARE = "62389ba9a63f32501b1b4451",
|
||||
WHITE_FLARE = "62389bc9423ed1685422dc57",
|
||||
YELLOW_FLARE = "62389be94d5d474bf712e709"
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
export enum CommonContainers
|
||||
{
|
||||
AMMO_CASE = "5aafbde786f774389d0cbc0f",
|
||||
DOCUMENTS_CASE = "590c60fc86f77412b13fddcf",
|
||||
DOGTAG_CASE = "5c093e3486f77430cb02e593",
|
||||
GRENADE_CASE = "5e2af55f86f7746d4159f07c",
|
||||
INJECTOR_CASE = "619cbf7d23893217ec30b689",
|
||||
ITEM_CASE = "59fb042886f7746c5005a7b2",
|
||||
KEY_TOOL = "59fafd4b86f7745ca07e1232",
|
||||
KEYCARD_HOLDER = "619cbf9e0a7c3a1a2731940a",
|
||||
SCAV_JUNKBOX = "5b7c710788a4506dec015957",
|
||||
MAGAZINE_CASE = "5c127c4486f7745625356c13",
|
||||
MEDICINE_CASE = "5aafbcd986f7745e590fff23",
|
||||
MONEY_CASE = "59fb016586f7746d0d4b423a",
|
||||
HOLODILNICK_THERMAL_BAG = "5c093db286f7740a1b2617e3",
|
||||
PISTOL_CASE = "567143bf4bdc2d1a0f8b4567",
|
||||
SICC_ORGANIZATIONAL_POUCH = "5d235bb686f77443f4331278",
|
||||
SIMPLE_WALLET = "5783c43d2459774bbe137486",
|
||||
THICC_ITEM_CASE = "5c0a840b86f7742ffa4f2482",
|
||||
THICC_WEAPON_CASE = "5b6d9ce188a4501afc1b2b25",
|
||||
WEAPON_CASE = "59fb023c86f7746d0d4b423c",
|
||||
WZ_WALLET = "60b0f6c058e0b0481a09ad11"
|
||||
}
|
||||
|
||||
export enum SecuredContainers
|
||||
{
|
||||
ALPHA = "544a11ac4bdc2d470e8b456a",
|
||||
BETA = "5857a8b324597729ab0a0e7d",
|
||||
EPSILON = "59db794186f77448bc595262",
|
||||
GAMMA = "5857a8bc2459772bad15db29",
|
||||
KAPPA = "5c093ca986f7740a1867ab12"
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
|
||||
import { Config } from "../config/config";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Insurance
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private logger: Logger;
|
||||
private insuranceConfig: IInsuranceConfig;
|
||||
|
||||
|
||||
constructor(logger:Logger, insuranceConfig: IInsuranceConfig)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.insuranceConfig = insuranceConfig;
|
||||
}
|
||||
|
||||
public updateInsurance(): void
|
||||
{
|
||||
const mod = this.modConfig.insurance;
|
||||
|
||||
if (mod.insuranceMultiplier.prapor != 0.16 || mod.insuranceMultiplier.therapist != 0.25)
|
||||
{
|
||||
this.insuranceConfig.insuranceMultiplier["54cb50c76803fa8b248b4571"] = mod.insuranceMultiplier.prapor;
|
||||
this.insuranceConfig.insuranceMultiplier["54cb57776803fa99248b456e"] = mod.insuranceMultiplier.therapist;
|
||||
this.logger.info(`Prapor Insurance Price Multiplier Set to ${mod.insuranceMultiplier.prapor}`);
|
||||
} this.logger.info(`Therapist Insurance Price Multiplier Set to ${mod.insuranceMultiplier.therapist}`);
|
||||
|
||||
if (mod.returnChancePercent.prapor != 80 || mod.returnChancePercent.therapist != 85)
|
||||
{
|
||||
this.insuranceConfig.returnChancePercent["54cb50c76803fa8b248b4571"] = mod.returnChancePercent.prapor;
|
||||
this.insuranceConfig.returnChancePercent["54cb57776803fa99248b456e"] = mod.returnChancePercent.therapist;
|
||||
this.logger.info(`Prapor Insurance Return Chance Set to ${mod.returnChancePercent.prapor}`);
|
||||
this.logger.info(`Therapist Insurance Return Chance set to ${mod.returnChancePercent.therapist}`);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
export declare enum Effect {
|
||||
Fracture = "Fracture",
|
||||
LightBleeding = "LightBleeding",
|
||||
HeavyBleeding = "HeavyBleeding"
|
||||
}
|
7
Valens-AIO/types/models/enums/BotAmount.d.ts
vendored
7
Valens-AIO/types/models/enums/BotAmount.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
export declare enum BotAmount {
|
||||
AsOnline = "AsOnline",
|
||||
Low = "Low",
|
||||
Medium = "Medium",
|
||||
High = "High",
|
||||
Horde = "Horde"
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
export declare enum BotDifficulty {
|
||||
AsOnline = "AsOnline",
|
||||
Easy = "Easy",
|
||||
Medium = "Medium",
|
||||
Hard = "Hard",
|
||||
Impossible = "Impossible",
|
||||
Random = "Random"
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
export declare enum MemberCategory {
|
||||
Default = 0,
|
||||
Developer = 1,
|
||||
UniqueId = 2,
|
||||
Trader = 4,
|
||||
Group = 8,
|
||||
System = 16,
|
||||
ChatModerator = 32,
|
||||
ChatModeratorWithPermanentBan = 64,
|
||||
UnitTest = 128,
|
||||
Sherpa = 256,
|
||||
Emissary = 512
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
export declare enum QuestRewardType {
|
||||
Skill = "Skill",
|
||||
Experience = "Experience",
|
||||
TraderStanding = "TraderStanding",
|
||||
TraderUnlock = "TraderUnlock",
|
||||
Item = "Item",
|
||||
AssortmentUnlock = "AssortmentUnlock"
|
||||
}
|
5
Valens-AIO/types/models/enums/RaidMode.d.ts
vendored
5
Valens-AIO/types/models/enums/RaidMode.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export declare enum RaidMode {
|
||||
Online = "Online",
|
||||
Local = "Local",
|
||||
Coop = "Coop"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
export declare enum LogBackgroundColor {
|
||||
default = "",
|
||||
black = "blackBG",
|
||||
red = "redBG",
|
||||
green = "greenBG",
|
||||
yellow = "yellowBG",
|
||||
blue = "blueBG",
|
||||
magenta = "magentaBG",
|
||||
cyan = "cyanBG",
|
||||
white = "whiteBG"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
export declare enum LogTextColor {
|
||||
black = "black",
|
||||
red = "red",
|
||||
green = "green",
|
||||
yellow = "yellow",
|
||||
blue = "blue",
|
||||
magenta = "magenta",
|
||||
cyan = "cyan",
|
||||
white = "white",
|
||||
gray = ""
|
||||
}
|
29
config/ammo.json
Normal file
29
config/ammo.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"stacks":
|
||||
{
|
||||
"grenades": 1,
|
||||
"a338lapua": 30,
|
||||
"a127x55": 30,
|
||||
"a762x54": 40,
|
||||
"a762x51": 40,
|
||||
"a9x39": 50,
|
||||
"a366TKM": 50,
|
||||
"a762x39": 60,
|
||||
"a762x35": 60,
|
||||
"a556x45": 60,
|
||||
"a545x39": 60,
|
||||
"a57x28": 60,
|
||||
"a46x30": 70,
|
||||
"a357Mag": 30,
|
||||
"a1143x23ACP": 50,
|
||||
"a762x25": 50,
|
||||
"a9x21": 50,
|
||||
"a9x19": 50,
|
||||
"a9x18": 50,
|
||||
"a23x75": 15,
|
||||
"a12Gauge": 20,
|
||||
"a20Gauge": 20,
|
||||
"a30x29": 1,
|
||||
"a26x75": 1
|
||||
}
|
||||
}
|
32
config/ammo.ts
Normal file
32
config/ammo.ts
Normal file
@ -0,0 +1,32 @@
|
||||
export interface AmmoConfig
|
||||
{
|
||||
stacks: Ammo
|
||||
}
|
||||
|
||||
export interface Ammo
|
||||
{
|
||||
grenades: number
|
||||
a338Lapua: number
|
||||
a127x55: number
|
||||
a762x54: number
|
||||
a762x51: number
|
||||
a9x39: number
|
||||
a366TKM: number
|
||||
a762x39: number
|
||||
a762x35: number
|
||||
a556x45: number
|
||||
a545x39: number
|
||||
a57x28: number
|
||||
a46x30: number
|
||||
a357Mag: number
|
||||
a1143x23ACP: number
|
||||
a762x25: number
|
||||
a9x21: number
|
||||
a9x19: number
|
||||
a9x18: number
|
||||
a23x75: number
|
||||
a12Gauge: number
|
||||
a20Gauge: number
|
||||
a30x29: number
|
||||
a26x75: number
|
||||
}
|
69
config/bots.json
Normal file
69
config/bots.json
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"bossChance":
|
||||
{
|
||||
"activated": false,
|
||||
"chance": 100
|
||||
},
|
||||
|
||||
"maxBotCap": 20,
|
||||
|
||||
"pmc":
|
||||
{
|
||||
"chanceSameSideIsHostile": 50,
|
||||
"containersOnPMCs": true,
|
||||
"isUsec": 50,
|
||||
"lootNValue": 3,
|
||||
"maxBackpackLootTotalRub": 150000,
|
||||
"maxPocketLootTotalRub": 50000,
|
||||
"maxVestLootTotalRub": 50000,
|
||||
|
||||
"convertIntoPmcChance":
|
||||
{
|
||||
"assault":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 40
|
||||
},
|
||||
"cursedAssault":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 40
|
||||
},
|
||||
"pmcBot":
|
||||
{
|
||||
"min": 15,
|
||||
"max": 30
|
||||
},
|
||||
"exUsec":
|
||||
{
|
||||
"min": 5,
|
||||
"max": 20
|
||||
}
|
||||
},
|
||||
|
||||
"difficultyWeights":
|
||||
{
|
||||
"difficulty": "asonline",
|
||||
"useWeights": false,
|
||||
"weights":
|
||||
{
|
||||
"easy": 0,
|
||||
"normal": 60,
|
||||
"hard": 20,
|
||||
"impossible": 20
|
||||
}
|
||||
},
|
||||
|
||||
"looseWeaponInBackpackChance": 15,
|
||||
"looseWeaponInBackpackLoot":
|
||||
{
|
||||
"min": 1,
|
||||
"max": 1
|
||||
}
|
||||
},
|
||||
|
||||
"scav":
|
||||
{
|
||||
"lootNValue": 4
|
||||
}
|
||||
}
|
68
config/bots.ts
Normal file
68
config/bots.ts
Normal file
@ -0,0 +1,68 @@
|
||||
export interface BotsConfig
|
||||
{
|
||||
bossChance: BossChance
|
||||
maxBotCap: number
|
||||
pmc: Pmc
|
||||
scav: Scav
|
||||
}
|
||||
|
||||
export interface BossChance
|
||||
{
|
||||
activated: boolean
|
||||
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: Weights
|
||||
}
|
||||
|
||||
export interface Weights
|
||||
{
|
||||
easy: number
|
||||
normal: number
|
||||
hard: number
|
||||
impossible: number
|
||||
}
|
||||
|
||||
export interface ConvertIntoPmcChance
|
||||
{
|
||||
assault: PmcChance
|
||||
cursedAssault: PmcChance
|
||||
pmcBot : PmcChance
|
||||
exUsec : PmcChance
|
||||
}
|
||||
|
||||
export interface PmcChance
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface LooseWeapon
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Scav
|
||||
{
|
||||
lootNValue: number
|
||||
}
|
33
config/config.json
Normal file
33
config/config.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"DebugMode": false,
|
||||
|
||||
|
||||
"quests":
|
||||
{
|
||||
"onlyFoundInRaid": true
|
||||
},
|
||||
|
||||
"raid":
|
||||
{
|
||||
"carExtractBaseStandingGain": 0.25,
|
||||
"chompiesBossFix": true,
|
||||
"fixOpenZones": true,
|
||||
"scavExtractGain": 0.01,
|
||||
"timeLimit": 60,
|
||||
"aiAmount": "asonline",
|
||||
"aiDifficulty": "asonline",
|
||||
"bossEnabled": true,
|
||||
"scavWars": false,
|
||||
"taggedAndCursed": false,
|
||||
"enablePve": true
|
||||
},
|
||||
|
||||
"weapons":
|
||||
{
|
||||
"jam": false,
|
||||
"misfeed": false,
|
||||
"misfire": false,
|
||||
"overheat": false,
|
||||
"slide": false
|
||||
}
|
||||
}
|
37
config/config.ts
Normal file
37
config/config.ts
Normal file
@ -0,0 +1,37 @@
|
||||
export interface Config
|
||||
{
|
||||
DebugMode: boolean
|
||||
raid: Raid
|
||||
quests: Quests
|
||||
weapons: Weapons
|
||||
}
|
||||
|
||||
export interface Quests
|
||||
{
|
||||
onlyFoundInRaid: boolean
|
||||
}
|
||||
|
||||
export interface Raid
|
||||
{
|
||||
carExtractBaseStandingGain: number
|
||||
chompiesBossFix: boolean
|
||||
fixOpenZones: boolean
|
||||
scavExtractGain: number
|
||||
timeLimit: number
|
||||
aiAmount: string
|
||||
aiDifficulty: string
|
||||
bossEnabled: boolean
|
||||
scavWars: boolean
|
||||
taggedAndCursed: boolean
|
||||
enablePve: boolean
|
||||
}
|
||||
|
||||
export interface Weapons
|
||||
{
|
||||
jam: boolean
|
||||
misfeed: boolean
|
||||
misfire: boolean
|
||||
overheat: boolean
|
||||
slide: boolean
|
||||
}
|
||||
|
209
config/containers.json
Normal file
209
config/containers.json
Normal file
@ -0,0 +1,209 @@
|
||||
{
|
||||
"commonContainers":
|
||||
{
|
||||
"enabled": false,
|
||||
"AMMO_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"DOCUMENTS_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 1,
|
||||
"cellsH": 4,
|
||||
"cellsV": 4
|
||||
},
|
||||
|
||||
"DOGTAG_CASE":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 10,
|
||||
"cellsV": 10
|
||||
},
|
||||
|
||||
"GRENADE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"INJECTOR_CASE":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"ITEM_CASE":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"KEY_TOOL":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 4,
|
||||
"cellsV": 4
|
||||
},
|
||||
|
||||
"KEYCARD_HOLDER":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"SCAV_JUNKBOX":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"cellsH": 14,
|
||||
"cellsV": 14
|
||||
},
|
||||
|
||||
"MAGAZINE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"MEDICINE_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"MONEY_CASE":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 7,
|
||||
"cellsV": 7
|
||||
},
|
||||
|
||||
"HOLODILNICK_THERMAL_BAG":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 8,
|
||||
"cellsV": 8
|
||||
},
|
||||
|
||||
"PISTOL_CASE":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 4,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"SICC_ORGANIZATIONAL_POUCH":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 1,
|
||||
"cellsH": 5,
|
||||
"cellsV": 5
|
||||
},
|
||||
|
||||
"SIMPLE_WALLET":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"THICC_ITEM_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 3,
|
||||
"cellsH": 14,
|
||||
"cellsV": 14
|
||||
},
|
||||
|
||||
"THICC_WEAPON_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 2,
|
||||
"cellsH": 6,
|
||||
"cellsV": 15
|
||||
},
|
||||
|
||||
"WEAPON_CASE":
|
||||
{
|
||||
"width": 5,
|
||||
"height": 2,
|
||||
"cellsH": 5,
|
||||
"cellsV": 10
|
||||
},
|
||||
|
||||
"WZ_WALLET":
|
||||
{
|
||||
"width": 1,
|
||||
"height": 1,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
}
|
||||
},
|
||||
|
||||
"securedContainers":
|
||||
{
|
||||
"enabled": false,
|
||||
"ALPHA":
|
||||
{
|
||||
"width": 2,
|
||||
"height": 2,
|
||||
"cellsH": 2,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"BETA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 2,
|
||||
"cellsH": 3,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"EPSILON":
|
||||
{
|
||||
"width": 4,
|
||||
"height": 2,
|
||||
"cellsH": 4,
|
||||
"cellsV": 2
|
||||
},
|
||||
|
||||
"GAMMA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 3,
|
||||
"cellsV": 3
|
||||
},
|
||||
|
||||
"KAPPA":
|
||||
{
|
||||
"width": 3,
|
||||
"height": 3,
|
||||
"cellsH": 3,
|
||||
"cellsV": 4
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,4 @@
|
||||
export interface ContainersConfig
|
||||
{
|
||||
containers: Containers
|
||||
}
|
||||
|
||||
export interface Containers
|
||||
{
|
||||
commonContainers: CommonContainers
|
||||
securedContainers: SecuredContainers
|
42
config/flea.json
Normal file
42
config/flea.json
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"minUserLevel": 15,
|
||||
|
||||
"blacklist":
|
||||
{
|
||||
"enableBsgList": true,
|
||||
"enableQuestList": true
|
||||
},
|
||||
|
||||
"condition":
|
||||
{
|
||||
"conditionChance": 0.2,
|
||||
"min": 0.6,
|
||||
"max": 1.0
|
||||
},
|
||||
|
||||
"currencies":
|
||||
{
|
||||
"roubles": 78,
|
||||
"dollars": 20,
|
||||
"euros": 2
|
||||
},
|
||||
|
||||
"offerItemCount":
|
||||
{
|
||||
"min": 8,
|
||||
"max": 15
|
||||
},
|
||||
|
||||
"reputation":
|
||||
{
|
||||
"gain": 0.0000002,
|
||||
"loss": 0.0000002
|
||||
},
|
||||
|
||||
"time":
|
||||
{
|
||||
"baseSellTime": 15,
|
||||
"minSellTime": 5,
|
||||
"maxSellTime": 15
|
||||
}
|
||||
}
|
50
config/flea.ts
Normal file
50
config/flea.ts
Normal file
@ -0,0 +1,50 @@
|
||||
export interface FleaConfig
|
||||
{
|
||||
minUserLevel: number
|
||||
blacklist: Blacklist
|
||||
condition: Condition
|
||||
currencies: Currencies
|
||||
offerItemCount: OfferItemCount
|
||||
reputation: Reputation
|
||||
time: Time
|
||||
}
|
||||
|
||||
export interface Blacklist
|
||||
{
|
||||
enableBsgList: boolean
|
||||
enableQuestList: boolean
|
||||
}
|
||||
|
||||
export interface Condition
|
||||
{
|
||||
conditionChance: number
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Currencies
|
||||
{
|
||||
roubles: number
|
||||
dollars: number
|
||||
euros: number
|
||||
}
|
||||
|
||||
export interface OfferItemCount
|
||||
{
|
||||
min: number
|
||||
max: number
|
||||
}
|
||||
|
||||
export interface Reputation
|
||||
{
|
||||
gain: number
|
||||
loss: number
|
||||
}
|
||||
|
||||
export interface Time
|
||||
{
|
||||
baseSellTime: number
|
||||
minSellTime: number
|
||||
maxSellTime: number
|
||||
}
|
||||
|
22
config/globals.json
Normal file
22
config/globals.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"damagePerMeter": 9,
|
||||
"safeHeight": 3,
|
||||
"maxLoyaltyTraders": false,
|
||||
"timeBeforeDeployLocal": 10,
|
||||
|
||||
"matchEnd":
|
||||
{
|
||||
"survivedExpRequirement": 200,
|
||||
"survivedSecondsRequirement": 420,
|
||||
"survivedExpReward": 300,
|
||||
"miaExpReward": 200,
|
||||
"runnerExpReward": 200,
|
||||
"leftMult": 0,
|
||||
"miaMult": 1,
|
||||
"survivedMult": 1.3,
|
||||
"runnerMult": 0.5,
|
||||
"killedMult": 1,
|
||||
"headShotMult": 1.2,
|
||||
"expOnDamageAllHealth": 50
|
||||
}
|
||||
}
|
25
config/globals.ts
Normal file
25
config/globals.ts
Normal file
@ -0,0 +1,25 @@
|
||||
export interface GlobalsConfig
|
||||
{
|
||||
damagePerMeter: number
|
||||
safeHeight: number
|
||||
maxLoyaltyTraders: boolean
|
||||
timeBeforeDeployLocal: number
|
||||
matchEnd: MatchEnd
|
||||
}
|
||||
|
||||
export interface MatchEnd
|
||||
{
|
||||
survivedExpRequirement: number
|
||||
survivedSecondsRequirement: number
|
||||
survivedExpReward: number
|
||||
miaExpReward: number
|
||||
runnerExpReward: number
|
||||
leftMult: number
|
||||
miaMult: number
|
||||
survivedMult: number
|
||||
runnerMult: number
|
||||
killedMult: number
|
||||
headShotMult: number
|
||||
expOnDamageAllHealth: number
|
||||
}
|
||||
|
8
config/hideout.json
Normal file
8
config/hideout.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"airFilterUnitFlowRate": 0.0047222222222222,
|
||||
"constructionTime": 1,
|
||||
"fuelDrainRate": 0.0013194444444444,
|
||||
"gpuBoostRate": 0.015,
|
||||
"productionTime": 1,
|
||||
"scavCaseTime": 1
|
||||
}
|
9
config/hideout.ts
Normal file
9
config/hideout.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export interface HideoutConfig
|
||||
{
|
||||
airFilterUnitFlowRate: number
|
||||
constructionTime: number
|
||||
generatorFuelFlowRate: number
|
||||
gpuBoostRate: number
|
||||
productionTime: number
|
||||
scavCaseTime: number
|
||||
}
|
21
config/insurance.json
Normal file
21
config/insurance.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"blacklistedEquipment": ["Scabbard", "SecuredContainer", "Compass", "ArmBand"],
|
||||
|
||||
"prapor":
|
||||
{
|
||||
"minHr": 24,
|
||||
"maxHr": 36,
|
||||
"storageMaxHr": 96,
|
||||
"priceCoef": 0.16,
|
||||
"returnChance": 80
|
||||
},
|
||||
|
||||
"therapist":
|
||||
{
|
||||
"minHr": 10,
|
||||
"maxHr": 20,
|
||||
"storageMaxHr": 144,
|
||||
"priceCoef": 0.25,
|
||||
"returnChance": 85
|
||||
}
|
||||
}
|
24
config/insurance.ts
Normal file
24
config/insurance.ts
Normal file
@ -0,0 +1,24 @@
|
||||
export interface InsuranceConfig
|
||||
{
|
||||
blacklistedEquipment: string[]
|
||||
prapor: Prapor
|
||||
therapist: Therapist
|
||||
}
|
||||
|
||||
export interface Prapor
|
||||
{
|
||||
minHr: number
|
||||
maxHr: number
|
||||
storageMaxHr: number
|
||||
priceCoef: number
|
||||
returnChance: number
|
||||
}
|
||||
|
||||
export interface Therapist
|
||||
{
|
||||
minHr: number
|
||||
maxHr: number
|
||||
storageMaxHr: number
|
||||
priceCoef: number
|
||||
returnChance: number
|
||||
}
|
33
config/items.json
Normal file
33
config/items.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"standardStash":
|
||||
{
|
||||
"vertical": 28,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"behindStash":
|
||||
{
|
||||
"vertical": 38,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"escapeStash":
|
||||
{
|
||||
"vertical": 48,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"eodStash":
|
||||
{
|
||||
"vertical": 68,
|
||||
"horizontal": 10
|
||||
},
|
||||
|
||||
"examinedByDefault": false,
|
||||
"removeBackpackFilter": true,
|
||||
"removeKeyUsageMax": false,
|
||||
"roublesMaxStack": 500000,
|
||||
"dollarsMaxStack": 50000,
|
||||
"eurosMaxStack": 50000,
|
||||
"weightModifier": 1
|
||||
}
|
20
config/items.ts
Normal file
20
config/items.ts
Normal file
@ -0,0 +1,20 @@
|
||||
export interface ItemsConfig
|
||||
{
|
||||
standardStash: Stash
|
||||
behindStash: Stash
|
||||
escapeStash: Stash
|
||||
eodStash: Stash
|
||||
examinedByDefault: boolean
|
||||
removeBackpackFilter: boolean
|
||||
removeKeyUsageMax: boolean
|
||||
dollarsMaxStack: number
|
||||
eurosMaxStack: number
|
||||
roublesMaxStack: number
|
||||
weightModifier: number
|
||||
}
|
||||
|
||||
export interface Stash
|
||||
{
|
||||
vertical: number
|
||||
horizontal: number
|
||||
}
|
6
config/locations.json
Normal file
6
config/locations.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"allExtractsAvailable": false,
|
||||
"exfilTime": 8,
|
||||
"extractionsExtended": false,
|
||||
"noExtractRestrictions": false
|
||||
}
|
7
config/locations.ts
Normal file
7
config/locations.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export interface LocationsConfig
|
||||
{
|
||||
allExtractsAvailable: boolean
|
||||
exfilTime: number
|
||||
extractionsExtended: boolean
|
||||
noExtractRestrictions: boolean
|
||||
}
|
5
config/loot.json
Normal file
5
config/loot.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"containersInMarkedRoom": true,
|
||||
"looseLootMultiplier": 1,
|
||||
"staticLootMultiplier": 1
|
||||
}
|
6
config/loot.ts
Normal file
6
config/loot.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export interface LootConfig
|
||||
{
|
||||
containersInMarkedRoom: boolean
|
||||
looseLootMultiplier: number
|
||||
staticLootMultiplier: number
|
||||
}
|
7
config/prewipe.json
Normal file
7
config/prewipe.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"allBossesOnReserve": false,
|
||||
"allTradersSellCheapItems": false,
|
||||
"gluharOnLabs": false,
|
||||
"killaOnFactory": false,
|
||||
"makeObdolbosPowerful": false
|
||||
}
|
8
config/prewipe.ts
Normal file
8
config/prewipe.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export interface PrewipeConfig
|
||||
{
|
||||
allBossesOnReserve: boolean
|
||||
allTradersSellCheapItems: boolean
|
||||
gluharOnLabs: boolean
|
||||
killaOnFactory: boolean
|
||||
makeObdolbosPowerful: boolean
|
||||
}
|
3
config/progression.json
Normal file
3
config/progression.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"enabled": true
|
||||
}
|
4
config/progression.ts
Normal file
4
config/progression.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface Progression
|
||||
{
|
||||
enabled: boolean
|
||||
}
|
264
src/ammo.ts
Normal file
264
src/ammo.ts
Normal file
@ -0,0 +1,264 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import { Grenade, Ammo762x51, Ammo762x54, Ammo338Lapua, Ammo46x30, Ammo57x28, Ammo762x25, Ammo9x18, Ammo9x19, Ammo9x21, Ammo357Mag, Ammo45ACP, Ammo545x39, Ammo556x45, Ammo300Blackout, Ammo762x39, Ammo9x39, Ammo366TKM, Ammo127x55, Ammo12Gauge, Ammo20Gauge, Ammo23x75, Ammo30x29, Ammo26x75 } from "@spt-aki/models/enums/AmmoTypes";
|
||||
import { AmmoConfig } from "../config/ammo";
|
||||
|
||||
export class Ammo
|
||||
{
|
||||
private modConfig: AmmoConfig = require("./config/ammo.json")
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer;
|
||||
}
|
||||
|
||||
public updateAmmo(): void
|
||||
{
|
||||
const items = this.tables.getTables().templates.items;
|
||||
const mod = this.modConfig.stacks;
|
||||
|
||||
|
||||
// Sets HE grenades from GLaunchers max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 338 Lapua Magnum max stacks.
|
||||
if (mod.a338Lapua != 30)
|
||||
{
|
||||
for (const value of Object.values(Ammo338Lapua))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.a338Lapua
|
||||
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a338Lapua}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 12.7x55mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 7.62x54mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 7.62x51mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 9x39mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets .366 TKM max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 7.62x39mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 7.62x35mm (.300 Blackout) max stacks.
|
||||
if (mod.a762x35 != 60)
|
||||
{
|
||||
for (const value of Object.values(Ammo300Blackout))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.a762x35
|
||||
this.logger.info(`762x35mm Max Stacks set to ${mod.a762x35}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 5.56x45mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Sets 5.45x39mm max stacks.
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.a357Mag != 30)
|
||||
{
|
||||
for (const value of Object.values(Ammo357Mag))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.a357Mag
|
||||
this.logger.info(`.357 Magnum Max Stacks set to ${mod.a357Mag}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.a1143x23ACP != 50)
|
||||
{
|
||||
for (const value of Object.values(Ammo45ACP))
|
||||
{
|
||||
items[value]._props.StackMaxSize = mod.a1143x23ACP
|
||||
this.logger.info(`.45 ACP Max Stacks set to ${mod.a1143x23ACP}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mod.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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
208
src/bots.ts
Normal file
208
src/bots.ts
Normal file
@ -0,0 +1,208 @@
|
||||
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import { BotsConfig } from "../config/bots";
|
||||
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||
export class Bots
|
||||
{
|
||||
private modConfig: BotsConfig = require("../config/bots.json");
|
||||
private logger: Logger;
|
||||
private botConfig: IBotConfig;
|
||||
private tables: DatabaseServer;
|
||||
private weightedRandomHelper: WeightedRandomHelper;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer, botConfig: IBotConfig, weightedRandomHelper: WeightedRandomHelper)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.botConfig = botConfig;
|
||||
this.tables = databaseServer;
|
||||
this.weightedRandomHelper = weightedRandomHelper;
|
||||
}
|
||||
|
||||
public updateBots(): void
|
||||
{
|
||||
// modConfig variables
|
||||
const mod = this.modConfig;
|
||||
const modPMC = this.modConfig.pmc;
|
||||
const modScav = this.modConfig.scav;
|
||||
|
||||
// Server side variables
|
||||
const pmc = this.botConfig.pmc;
|
||||
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")
|
||||
{
|
||||
// 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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Enables common and secure containers to spawn on PMCs by whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true.
|
||||
if (modPMC.containersOnPMCs)
|
||||
{
|
||||
this.containersOnPMCs();
|
||||
this.logger.info(`Containers On PMCs: ${modPMC.containersOnPMCs}`);
|
||||
}
|
||||
|
||||
|
||||
// Chance that PMC bot will be USEC or BEAR. Default is 50%
|
||||
if (modPMC.isUsec != 50)
|
||||
{
|
||||
pmc.isUsec = modPMC.isUsec;
|
||||
this.logger.info(`PMC isUsec Chance is: ${modPMC.isUsec}`);
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
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}`);
|
||||
}
|
||||
|
||||
|
||||
// Chance that the PMC bot of your faction (BEAR/USEC) will be hostile or not. Default is 50%.
|
||||
if (modPMC.chanceSameSideIsHostile != 50)
|
||||
{
|
||||
pmc.chanceSameSideIsHostilePercent = modPMC.chanceSameSideIsHostile;
|
||||
this.logger.info(`Chance Same Side Is Hostle is ${modPMC.chanceSameSideIsHostile}`);
|
||||
}
|
||||
|
||||
|
||||
// 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}`);
|
||||
}
|
||||
|
||||
|
||||
// Modifies the lootNValue of PMC or Scav if configured outside of the defaults.
|
||||
if (modPMC.lootNValue != 3 || modScav.lootNValue != 4)
|
||||
{
|
||||
lootNValue.scav = modScav.lootNValue;
|
||||
lootNValue.pmc = modPMC.lootNValue;
|
||||
this.logger.info(`lootNValue for bots has been changed! \n Scav lootNValue set to ${modScav.lootNValue} \n PMC lootNValue set to ${modPMC.lootNValue}`);
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
this.adjustPmcChance();
|
||||
this.logger.info("Chance to Convert Bots into PMC Patched");
|
||||
}
|
||||
|
||||
|
||||
// Makes *all* bosses spawn chance configurable.
|
||||
if (mod.bossChance.activated)
|
||||
{
|
||||
this.configureBossChance();
|
||||
this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`)
|
||||
}
|
||||
|
||||
|
||||
if (modPMC.looseWeaponInBackpackChance != 15 || modPMC.looseWeaponInBackpackLoot.max != 1 || modPMC.looseWeaponInBackpackLoot.min != 1)
|
||||
{
|
||||
this.changeLooseWeapon();
|
||||
this.logger.info("Loose Weapon In PMC Backpack Values Patched");
|
||||
}
|
||||
}
|
||||
|
||||
// Functions start here.
|
||||
|
||||
// Function to enable secured and common containers on PMCs.
|
||||
private containersOnPMCs(): void
|
||||
{
|
||||
const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist;
|
||||
|
||||
dynaLoot.push("5448bf274bdc2dfc2f8b456a");
|
||||
dynaLoot.push("5795f317245977243854e041");
|
||||
}
|
||||
|
||||
private chooseRandomWeightedDifficulty(): string
|
||||
{
|
||||
const chosenDifficulty = this.weightedRandomHelper.getWeightedInventoryItem(this.modConfig.pmc.difficultyWeights.weights);
|
||||
this.botConfig.pmc.difficulty = chosenDifficulty;
|
||||
|
||||
return chosenDifficulty;
|
||||
}
|
||||
|
||||
private adjustPmcChance(): void
|
||||
{
|
||||
const pmcConfig = this.botConfig.pmc.convertIntoPmcChance;
|
||||
const modConfig = this.modConfig.pmc.convertIntoPmcChance;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
private changeMaxLootvalue(): void
|
||||
{
|
||||
const lootConfig = this.botConfig.pmc;
|
||||
const modConfig = this.modConfig.pmc;
|
||||
|
||||
lootConfig.maxBackpackLootTotalRub = modConfig.maxBackpackLootTotalRub;
|
||||
lootConfig.maxPocketLootTotalRub = modConfig.maxPocketLootTotalRub;
|
||||
lootConfig.maxVestLootTotalRub = modConfig.maxVestLootTotalRub;
|
||||
}
|
||||
|
||||
|
||||
private configureBossChance(): void
|
||||
{
|
||||
const locations = this.tables.getTables().locations;
|
||||
|
||||
for (const i in locations)
|
||||
{
|
||||
if (i !== "base")
|
||||
{
|
||||
if (locations[i].base.BossLocationSpawn !== [])
|
||||
{
|
||||
for (const x in locations[i].base.BossLocationSpawn)
|
||||
{
|
||||
locations[i].base.BossLocationSpawn[x].BossChance = this.modConfig.bossChance.chance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private changeLooseWeapon():void
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import { ContainersConfig } from "../config/containers";
|
||||
import { CommonContainers, SecuredContainers } from "./containertypes";
|
||||
import { CommonContainers, SecuredContainers } from "@spt-aki/models/enums/ContainerTypes";
|
||||
|
||||
export class Containers
|
||||
{
|
||||
@ -12,12 +12,12 @@ export class Containers
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.tables = databaseServer;
|
||||
}
|
||||
|
||||
public updateContainers(): void
|
||||
{
|
||||
const mod = this.modConfig.containers;
|
||||
const mod = this.modConfig;
|
||||
|
||||
if (mod.commonContainers.enabled)
|
||||
{
|
||||
@ -34,8 +34,8 @@ export class Containers
|
||||
|
||||
private updatingCommonContainers()
|
||||
{
|
||||
const items = this.tables.templates.items;
|
||||
const mod = this.modConfig.containers.commonContainers;
|
||||
const items = this.tables.getTables().templates.items;
|
||||
const mod = this.modConfig.commonContainers;
|
||||
|
||||
for (const [key, value] of Object.entries(CommonContainers))
|
||||
{
|
||||
@ -48,8 +48,8 @@ export class Containers
|
||||
|
||||
private updatingSecuredContainers()
|
||||
{
|
||||
const items = this.tables.templates.items;
|
||||
const mod = this.modConfig.containers.securedContainers;
|
||||
const items = this.tables.getTables().templates.items;
|
||||
const mod = this.modConfig.securedContainers;
|
||||
|
||||
for (const [key, value] of Object.entries(SecuredContainers))
|
||||
{
|
@ -1,29 +1,28 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
|
||||
import { Logger } from "./logger";
|
||||
import { Config } from "../config/config";
|
||||
import { FleaConfig } from "../config/flea";
|
||||
import { IGlobals } from "@spt-aki/models/spt/server/IDatabaseTables/IGlobals";
|
||||
|
||||
export class Flea
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private modConfig: FleaConfig = require("../config/flea.json");
|
||||
private logger: Logger;
|
||||
private ragfairConfig: IRagfairConfig;
|
||||
private tables: DatabaseServer;
|
||||
private globals: IGlobals;
|
||||
|
||||
|
||||
constructor (logger: Logger, ragfairConfig: IRagfairConfig, databaseServer: DatabaseServer)
|
||||
constructor (logger: Logger, ragfairConfig: IRagfairConfig, globals: IGlobals)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.ragfairConfig = ragfairConfig;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.globals = globals;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public updateFlea(): void
|
||||
{
|
||||
const mod = this.modConfig.flea;
|
||||
const global = this.tables.globals.config.RagFair;
|
||||
const mod = this.modConfig;
|
||||
const global = this.globals;
|
||||
const ragfair = this.ragfairConfig.dynamic;
|
||||
|
||||
if (mod.minUserLevel != 15)
|
||||
@ -42,9 +41,9 @@ export class Flea
|
||||
|
||||
if (mod.condition.conditionChance != 0.2 || mod.condition.min != 0.6 || mod.condition.max != 1)
|
||||
{
|
||||
ragfair.condition.conditionChance = mod.conditionChance;
|
||||
ragfair.condition.min = mod.min;
|
||||
ragfair.condition.max = mod.max;
|
||||
ragfair.condition.conditionChance = mod.condition.conditionChance;
|
||||
ragfair.condition.min = mod.condition.min;
|
||||
ragfair.condition.max = mod.condition.max;
|
||||
this.logger.info("Fleamarket Condition patched");
|
||||
}
|
||||
|
@ -1,23 +1,23 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Config } from "../config/config";
|
||||
import { IGlobals } from "@spt-aki/models/spt/server/IDatabaseTables/IGlobals";
|
||||
import { GlobalsConfig } from "../config/globals";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Globals
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private modConfig: GlobalsConfig = require("../config/globals.json");
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
private globals: IGlobals;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
constructor(logger: Logger, globals: IGlobals)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.globals = globals;
|
||||
}
|
||||
|
||||
public updateGlobals(): void
|
||||
{
|
||||
const mod = this.modConfig.globals;
|
||||
const global = this.tables.globals;
|
||||
const mod = this.modConfig;
|
||||
const global = this.globals;
|
||||
|
||||
if (mod.damagePerMeter != 9 || mod.safeHeight != 3)
|
||||
{
|
||||
@ -50,8 +50,8 @@ export class Globals
|
||||
|
||||
private matchEndSettings(): void
|
||||
{
|
||||
const global1 = this.tables.globals.config.exp.match_end;
|
||||
const mod = this.modConfig.globals.matchEnd;
|
||||
const global1 = this.globals.config.exp.match_end;
|
||||
const mod = this.modConfig.matchEnd;
|
||||
|
||||
global1.survived_exp_requirement = mod.survivedExpRequirement;
|
||||
global1.survived_seconds_requirement = mod.survivedSecondsRequirement;
|
||||
@ -63,8 +63,8 @@ export class Globals
|
||||
global1.survivedMult = mod.survivedMult;
|
||||
global1.runnerMult = mod.runnerMult;
|
||||
global1.killedMult = mod.killedMult;
|
||||
this.tables.globals.config.exp.kill.headShotMult = mod.headShotMult;
|
||||
this.tables.globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth;
|
||||
this.globals.config.exp.kill.headShotMult = mod.headShotMult;
|
||||
this.globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth;
|
||||
this.logger.info("Match End Settings Patched");
|
||||
}
|
||||
}
|
@ -1,22 +1,25 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import { Config } from "../config/config";
|
||||
import { HideoutConfig } from "../config/hideout";
|
||||
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
|
||||
|
||||
export class Hideout
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json")
|
||||
private modConfig: HideoutConfig = require("../config/hideout.json")
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
private hideout: IHideoutConfig
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer, hideout: IHideoutConfig)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.tables = databaseServer;
|
||||
this.hideout = hideout;
|
||||
}
|
||||
|
||||
public updateHideout(): void
|
||||
{
|
||||
const mod = this.modConfig.hideout;
|
||||
const mod = this.modConfig;
|
||||
|
||||
if (mod.constructionTime != 1)
|
||||
{
|
||||
@ -33,49 +36,47 @@ export class Hideout
|
||||
if (mod.scavCaseTime != 1)
|
||||
{
|
||||
this.updateScavCase();
|
||||
this.logger.info(`Scav Case TIme Patched to ${mod.scavCaseTime}`);
|
||||
this.logger.info(`Scav Case Time Patched to ${mod.scavCaseTime}`);
|
||||
}
|
||||
|
||||
if (mod.airFilterUnitFlowRate != 0.0047222222222222
|
||||
||mod.generatorFuelFlowRate != 0.0013194444444444
|
||||
||mod.gpuBoostRate != 0.041225)
|
||||
||mod.gpuBoostRate != 0.015)
|
||||
{
|
||||
const settings = this.tables.hideout.settings;
|
||||
settings.airFilterUnitFlowRate = mod.airFilterUnitFlowRate;
|
||||
settings.generatorFuelFlowRate = mod.generatorFuelFlowRate;
|
||||
settings.gpuBoostRate = mod.gpuBoostRate;
|
||||
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()
|
||||
{
|
||||
for (const area of this.tables.hideout.areas)
|
||||
for (const area of this.tables.getTables().hideout.areas)
|
||||
{
|
||||
for (const stage in area.stages)
|
||||
{
|
||||
const stageData = area.stages[stage];
|
||||
stageData.constructionTime *= this.modConfig.hideout.constructionTime;
|
||||
stageData.constructionTime *= this.modConfig.constructionTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private updateProductionTime()
|
||||
{
|
||||
for (const production of this.tables.hideout.production)
|
||||
for (const production of this.tables.getTables().hideout.production)
|
||||
{
|
||||
production.productionTime *= this.modConfig.hideout.productionTime;
|
||||
production.productionTime *= this.modConfig.productionTime;
|
||||
}
|
||||
}
|
||||
|
||||
private updateScavCase()
|
||||
{
|
||||
for (const scavCase of this.tables.hideout.scavcase)
|
||||
for (const scavCase of this.tables.getTables().hideout.scavcase)
|
||||
{
|
||||
scavCase.ProductionTime *= this.modConfig.hideout.scavCaseTime;
|
||||
scavCase.ProductionTime *= this.modConfig.scavCaseTime;
|
||||
}
|
||||
}
|
||||
}
|
124
src/insurance.ts
Normal file
124
src/insurance.ts
Normal file
@ -0,0 +1,124 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ITrader } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
|
||||
import { InsuranceConfig } from "../config/insurance";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Insurance
|
||||
{
|
||||
private modConfig: InsuranceConfig = require("../config/insurance.json");
|
||||
private logger: Logger;
|
||||
private insuranceConfig: IInsuranceConfig;
|
||||
private tables: DatabaseServer;
|
||||
private traders: Record<string, ITrader>;
|
||||
|
||||
|
||||
constructor(logger:Logger, insuranceConfig: IInsuranceConfig, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.insuranceConfig = insuranceConfig;
|
||||
this.tables = databaseServer;
|
||||
this.traders = this.tables.getTables().traders;
|
||||
}
|
||||
|
||||
public updateInsurance(): void
|
||||
{
|
||||
const mod = this.modConfig;
|
||||
|
||||
if (mod.blacklistedEquipment != ["Scabbard", "SecuredContainer", "Compass", "ArmBand"])
|
||||
{
|
||||
this.insuranceConfig.blacklistedEquipment = mod.blacklistedEquipment;
|
||||
this.logger.info("Insurance Blacklitsed Equipment Patched");
|
||||
}
|
||||
|
||||
if (mod.prapor.minHr != 24 || mod.prapor.maxHr != 24)
|
||||
{
|
||||
this.changePraporTimes();
|
||||
this.logger.info(`Prapor Min Hr ${mod.prapor.minHr} and Max Hr ${mod.prapor.maxHr} patched`);
|
||||
}
|
||||
|
||||
if (mod.prapor.storageMaxHr != 96)
|
||||
{
|
||||
this.changePraporStorage();
|
||||
this.logger.info(`Prapor Max Storage set to ${mod.prapor.storageMaxHr} hours`);
|
||||
}
|
||||
|
||||
if (mod.prapor.priceCoef != 0.16)
|
||||
{
|
||||
this.changePraporPriceCoef();
|
||||
this.logger.info(`Prapor Price Coefficient set to ${mod.prapor.priceCoef}`);
|
||||
}
|
||||
|
||||
if (mod.prapor.returnChance != 80)
|
||||
{
|
||||
this.changePraporReturnChance();
|
||||
this.logger.info(`Prapor Return Chance set to ${mod.prapor.returnChance}%`);
|
||||
}
|
||||
|
||||
if (mod.therapist.minHr != 24 || mod.therapist.maxHr != 24)
|
||||
{
|
||||
this.changeTherapistTimes();
|
||||
this.logger.info(`Therapist Min Hr ${mod.therapist.minHr} and Max Hr ${mod.therapist.maxHr} patched`);
|
||||
}
|
||||
|
||||
if (mod.therapist.storageMaxHr != 96)
|
||||
{
|
||||
this.changeTherapistStorage();
|
||||
this.logger.info(`Therapist Max Storage set to ${mod.therapist.storageMaxHr} hours`);
|
||||
}
|
||||
|
||||
if (mod.therapist.priceCoef != 0.16)
|
||||
{
|
||||
this.changeTherapistPriceCoef();
|
||||
this.logger.info(`Therapist Price Coefficient set to ${mod.therapist.priceCoef}`);
|
||||
}
|
||||
|
||||
if (mod.therapist.returnChance != 80)
|
||||
{
|
||||
this.changeTherapistReturnChance();
|
||||
this.logger.info(`Therapist Return Chance set to ${mod.therapist.returnChance}%`);
|
||||
}
|
||||
}
|
||||
|
||||
changePraporTimes(): void
|
||||
{
|
||||
this.traders["54cb50c76803fa8b248b4571"].base.insurance.max_return_hour = this.modConfig.prapor.maxHr;
|
||||
this.traders["54cb50c76803fa8b248b4571"].base.insurance.min_return_hour = this.modConfig.prapor.minHr;
|
||||
}
|
||||
|
||||
changePraporStorage(): void
|
||||
{
|
||||
this.traders["54cb50c76803fa8b248b4571"].base.insurance.max_storage_time = this.modConfig.prapor.storageMaxHr;
|
||||
}
|
||||
|
||||
changePraporPriceCoef(): void
|
||||
{
|
||||
this.insuranceConfig.insuranceMultiplier["54cb50c76803fa8b248b4571"] = this.modConfig.prapor.priceCoef;
|
||||
}
|
||||
|
||||
changePraporReturnChance(): void
|
||||
{
|
||||
this.insuranceConfig.returnChancePercent["54cb50c76803fa8b248b4571"] = this.modConfig.prapor.returnChance;
|
||||
}
|
||||
|
||||
changeTherapistTimes(): void
|
||||
{
|
||||
this.traders["54cb57776803fa99248b456e"].base.insurance.max_return_hour = this.modConfig.prapor.maxHr;
|
||||
this.traders["54cb57776803fa99248b456e"].base.insurance.min_return_hour = this.modConfig.prapor.minHr;
|
||||
}
|
||||
|
||||
changeTherapistStorage(): void
|
||||
{
|
||||
this.traders["54cb57776803fa99248b456e"].base.insurance.max_storage_time = this.modConfig.prapor.storageMaxHr;
|
||||
}
|
||||
|
||||
changeTherapistPriceCoef(): void
|
||||
{
|
||||
this.insuranceConfig.insuranceMultiplier["54cb57776803fa99248b456e"] = this.modConfig.therapist.priceCoef;
|
||||
}
|
||||
|
||||
changeTherapistReturnChance(): void
|
||||
{
|
||||
this.insuranceConfig.returnChancePercent["54cb57776803fa99248b456e"] = this.modConfig.therapist.returnChance;
|
||||
}
|
||||
}
|
@ -1,110 +1,104 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Config } from "../config/config";
|
||||
import { ItemsConfig } from "../config/items";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Items
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json")
|
||||
private modConfig: ItemsConfig = require("../config/items.json")
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
private mod: any;
|
||||
private items: any;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.tables = databaseServer;
|
||||
}
|
||||
|
||||
public updateItems(): void
|
||||
{
|
||||
|
||||
this.items = this.tables.templates.items;
|
||||
this.mod = this.modConfig.items;
|
||||
this.items = this.tables.getTables().templates.items;
|
||||
|
||||
if (this.mod.removeKeyUsageMax)
|
||||
if (this.modConfig.removeKeyUsageMax)
|
||||
{
|
||||
this.removeKeyUsageMax();
|
||||
this.logger.info("Key Usage Limit Removed");
|
||||
}
|
||||
|
||||
// Weight Modifier. Multiplier of Weight *= modConfig.weightModifier
|
||||
if (this.mod.weightModifier != 1)
|
||||
if (this.modConfig.weightModifier != 1)
|
||||
{
|
||||
this.updateWeight();
|
||||
this.logger.info(`Weight Multipler patched to ${this.mod.weightModifier}`);
|
||||
this.logger.info(`Weight Multipler patched to ${this.modConfig.weightModifier}`);
|
||||
}
|
||||
|
||||
// Removes the ExcludedFilter on Backpacks
|
||||
// which in turn enables common containers to spawn in the loot pool of AI.
|
||||
if (this.mod.removeBackpackFilter)
|
||||
if (this.modConfig.removeBackpackFilter)
|
||||
{
|
||||
this.updateBackpacks();
|
||||
this.logger.info(`Backpack Restrictions Removed: ${this.mod.removeBackpackFilter}`)
|
||||
this.logger.info(`Backpack Restrictions Removed: ${this.modConfig.removeBackpackFilter}`)
|
||||
}
|
||||
|
||||
// Standard Stash Size Changes
|
||||
if (this.mod.standardStash.vertical != 28 || this.mod.standardStash.horizontal != 10)
|
||||
if (this.modConfig.standardStash.vertical != 28 || this.modConfig.standardStash.horizontal != 10)
|
||||
{
|
||||
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsV = this.mod.standardStash.vertical;
|
||||
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsH = this.mod.standardStash.horizontal;
|
||||
this.logger.info(`Standard Stash Vertical changed to ${this.mod.standardStash.vertical}`);
|
||||
this.logger.info(`Standard Stash Horizontal changed to ${this.mod.standardStash.horizontal}`);
|
||||
this.updateStandardStash();
|
||||
this.logger.info(`Standard Stash Vertical changed to ${this.modConfig.standardStash.vertical}`);
|
||||
this.logger.info(`Standard Stash Horizontal changed to ${this.modConfig.standardStash.horizontal}`);
|
||||
}
|
||||
|
||||
// Left Behind Stash Size Changes
|
||||
if (this.mod.behindStash.vertical != 38 || this.mod.behindStash.horizontal != 10)
|
||||
if (this.modConfig.behindStash.vertical != 38 || this.modConfig.behindStash.horizontal != 10)
|
||||
{
|
||||
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsV = this.mod.behindStash.vertical;
|
||||
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsH = this.mod.behindStash.horizontal;
|
||||
this.logger.info(`Left Behind Stash Vertical changed to ${this.mod.behindStash.vertical}`);
|
||||
this.logger.info(`Left Behind Stash Horizontal changed to ${this.mod.behindStash.horizontal}`);
|
||||
this.updateLeftBehindStash();
|
||||
this.logger.info(`Left Behind Stash Vertical changed to ${this.modConfig.behindStash.vertical}`);
|
||||
this.logger.info(`Left Behind Stash Horizontal changed to ${this.modConfig.behindStash.horizontal}`);
|
||||
}
|
||||
|
||||
// Prepare for Escape Stash Size Changes
|
||||
if (this.mod.escapeStash.vertical != 48 || this.mod.escapeStash.horizontal != 10)
|
||||
if (this.modConfig.escapeStash.vertical != 48 || this.modConfig.escapeStash.horizontal != 10)
|
||||
{
|
||||
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsV = this.mod.escapeStash.vertical;
|
||||
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsH = this.mod.escapeStash.horizontal;
|
||||
this.logger.info(`Prepare for Escape Stash Vertical changed to ${this.mod.escapeStash.vertical}`);
|
||||
this.logger.info(`Prepare for Escape Stash Horizontal changed to ${this.mod.escapeStash.horizontal}`);
|
||||
this.updateEscapeStash();
|
||||
this.logger.info(`Prepare for Escape Stash Vertical changed to ${this.modConfig.escapeStash.vertical}`);
|
||||
this.logger.info(`Prepare for Escape Stash Horizontal changed to ${this.modConfig.escapeStash.horizontal}`);
|
||||
}
|
||||
|
||||
// Edge of Darkness Stash Size Changes
|
||||
if (this.mod.eodStash.vertical != 68 || this.mod.eodStash.horizontal != 10)
|
||||
if (this.modConfig.eodStash.vertical != 68 || this.modConfig.eodStash.horizontal != 10)
|
||||
{
|
||||
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsV = this.mod.eodStash.vertical;
|
||||
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsH = this.mod.eodStash.horizontal;
|
||||
this.logger.info(`Edge of Darkness Stash Vertical changed to ${this.mod.eodStash.vertical}`);
|
||||
this.logger.info(`Edge of Darkness Stash Horizontal changed to ${this.mod.eodStash.horizontal}`);
|
||||
this.updateEodStash();
|
||||
this.logger.info(`Edge of Darkness Stash Vertical changed to ${this.modConfig.eodStash.vertical}`);
|
||||
this.logger.info(`Edge of Darkness Stash Horizontal changed to ${this.modConfig.eodStash.horizontal}`);
|
||||
}
|
||||
|
||||
// Toggles true/false the Examined By Default config on all items in database/templates/items.json
|
||||
if (this.mod.examinedByDefault)
|
||||
if (this.modConfig.examinedByDefault)
|
||||
{
|
||||
this.examinedByDefault();
|
||||
this.logger.info(`Examined By Default is ${this.mod.examinedByDefault}`);
|
||||
this.logger.info(`Examined By Default is ${this.modConfig.examinedByDefault}`);
|
||||
}
|
||||
|
||||
// Roubles Max Stack
|
||||
if (this.mod.roublesMaxStack != 500000)
|
||||
if (this.modConfig.roublesMaxStack != 500000)
|
||||
{
|
||||
this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.modConfig.items.roublesMaxStack;
|
||||
this.logger.info(`Rouble Max Stack set to ${this.mod.roublesMaxStack}`, true);
|
||||
this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.modConfig.roublesMaxStack;
|
||||
this.logger.info(`Rouble Max Stack set to ${this.modConfig.roublesMaxStack}`, true);
|
||||
}
|
||||
|
||||
// Dollars Max Stack
|
||||
if (this.mod.dollarsMaxStack != 50000)
|
||||
if (this.modConfig.dollarsMaxStack != 50000)
|
||||
{
|
||||
this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.modConfig.items.dollarsMaxStack;
|
||||
this.logger.info(`Dollar Max Stack set to ${this.mod.dollarsMaxStack}`, true);
|
||||
this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.modConfig.dollarsMaxStack;
|
||||
this.logger.info(`Dollar Max Stack set to ${this.modConfig.dollarsMaxStack}`, true);
|
||||
}
|
||||
|
||||
// Euros Max Stack
|
||||
if (this.mod.eurosMaxStack != 50000)
|
||||
if (this.modConfig.eurosMaxStack != 50000)
|
||||
{
|
||||
this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.modConfig.items.eurosMaxStack;
|
||||
this.logger.info(`Euro Max Stack set to ${this.mod.eurosMaxStack}`, true);
|
||||
this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.modConfig.eurosMaxStack;
|
||||
this.logger.info(`Euro Max Stack set to ${this.modConfig.eurosMaxStack}`, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +112,7 @@ export class Items
|
||||
{
|
||||
if (this.items[item]._props?.Weight)
|
||||
{
|
||||
this.items[item]._props.Weight *= this.mod.weightModifier;
|
||||
this.items[item]._props.Weight *= this.modConfig.weightModifier;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -130,17 +124,41 @@ export class Items
|
||||
{
|
||||
if (this.items[item]._parent === "5448e53e4bdc2d60728b4567")
|
||||
{
|
||||
this.items[item]._props.Grids[0]._props.filters[0].ExcludedFilter = [];
|
||||
this.items[item]._props.Grids[4]._props.filters[0].ExcludedFilter = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private updateStandardStash(): void
|
||||
{
|
||||
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsV = this.modConfig.standardStash.vertical;
|
||||
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsH = this.modConfig.standardStash.horizontal;
|
||||
}
|
||||
|
||||
private updateLeftBehindStash(): void
|
||||
{
|
||||
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsV = this.modConfig.behindStash.vertical;
|
||||
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsH = this.modConfig.behindStash.horizontal;
|
||||
}
|
||||
|
||||
private updateEscapeStash(): void
|
||||
{
|
||||
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsV = this.modConfig.escapeStash.vertical;
|
||||
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsH = this.modConfig.escapeStash.horizontal;
|
||||
}
|
||||
|
||||
private updateEodStash(): void
|
||||
{
|
||||
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsV = this.modConfig.eodStash.vertical;
|
||||
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsH = this.modConfig.eodStash.horizontal;
|
||||
}
|
||||
|
||||
// Updates the Examined By Default modifier for all items in database/templates/items.json to either True or False depending on the config value.
|
||||
private examinedByDefault(): void
|
||||
{
|
||||
for (const item in this.items)
|
||||
{
|
||||
this.items[item]._props.ExaminedByDefault = this.mod.examinedByDefault;
|
||||
this.items[item]._props.ExaminedByDefault = this.modConfig.examinedByDefault;
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,22 @@
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Config } from "../config/config";
|
||||
import { LocationsConfig } from "../config/locations";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Locations
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private modConfig: LocationsConfig = require("../config/locations.json");
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
|
||||
constructor (logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.tables = databaseServer;
|
||||
}
|
||||
|
||||
public updateLocations(): void
|
||||
{
|
||||
const mod = this.modConfig.locations;
|
||||
const mod = this.modConfig;
|
||||
|
||||
// Gives all extracts 100% chance to spawn.
|
||||
if (mod.allExtractsAvailable)
|
||||
@ -49,7 +49,7 @@ export class Locations
|
||||
|
||||
private allExtractsAvailable(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
for (const i in locations)
|
||||
{
|
||||
if (i !== "base")
|
||||
@ -70,8 +70,8 @@ export class Locations
|
||||
|
||||
private exfilTime(): void
|
||||
{
|
||||
const maps = this.tables.locations;
|
||||
const mod = this.modConfig.locations;
|
||||
const maps = this.tables.getTables().locations;
|
||||
const mod = this.modConfig;
|
||||
for (const map in maps)
|
||||
{
|
||||
if (map.toLowerCase() === "base")
|
||||
@ -79,7 +79,7 @@ export class Locations
|
||||
continue;
|
||||
}
|
||||
|
||||
const mapBase = this.tables.locations[map].base;
|
||||
const mapBase = this.tables.getTables().locations[map].base;
|
||||
if (mapBase.Locked === true || mapBase?.EnabledCoop === undefined)
|
||||
{
|
||||
continue;
|
||||
@ -94,7 +94,7 @@ export class Locations
|
||||
|
||||
private noExtractRestrictions(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
for (const i in locations)
|
||||
{
|
||||
if (i !== "base")
|
||||
@ -139,7 +139,7 @@ export class Locations
|
||||
private extractionsExtended(): void
|
||||
{
|
||||
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
for (const map in locations)
|
||||
{
|
||||
switch (map)
|
@ -1,11 +1,11 @@
|
||||
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Config } from "../config/config";
|
||||
import { LootConfig } from "../config/loot";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export class Loot
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private modConfig: LootConfig = require("../config/loot.json");
|
||||
private logger: Logger;
|
||||
private tables: DatabaseServer;
|
||||
private locationConfig: ILocationConfig;
|
||||
@ -14,12 +14,12 @@ export class Loot
|
||||
{
|
||||
this.logger = logger;
|
||||
this.locationConfig = locationConfig;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.tables = databaseServer;
|
||||
}
|
||||
|
||||
public updateLoot(): void
|
||||
{
|
||||
const mod = this.modConfig.loot;
|
||||
const mod = this.modConfig;
|
||||
|
||||
if (mod.looseLootMultiplier > 1)
|
||||
{
|
||||
@ -54,7 +54,7 @@ export class Loot
|
||||
private containersInMarkedRoom(): void
|
||||
{
|
||||
// Customs Marked Room Loot.
|
||||
let spawnPoints = this.tables.locations.bigmap.looseLoot.spawnpoints;
|
||||
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");
|
||||
@ -64,7 +64,7 @@ export class Loot
|
||||
cstmsmarked3.itemDistribution.push(...this.containers());
|
||||
|
||||
// Reserve Marked Room Loot.
|
||||
spawnPoints = this.tables.locations.rezervbase.looseLoot.spawnpoints;
|
||||
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");
|
||||
@ -86,11 +86,6 @@ export class Loot
|
||||
rsrvRBVO1.itemDistribution.push(...this.containers());
|
||||
rsrvRBVO2.itemDistribution.push(...this.containers());
|
||||
rsrvRBVO3.itemDistribution.push(...this.containers());
|
||||
|
||||
// Lighthouse Marked Room Loot ... Lighthouse Marked Has No Cases; Only Jewelry/Electronics.
|
||||
/*const lhouseBdrm = spawnPoints.find(x=>x.template.Id==="");
|
||||
|
||||
lhouseBdrm.itemDistribution.push(...this.containers());*/
|
||||
}
|
||||
|
||||
private containers(): any[]
|
@ -27,6 +27,9 @@ import { Containers } from "./containers";
|
||||
import { Locations } from "./locations";
|
||||
import { Quests } from "./quests";
|
||||
import { Progression } from "./progression";
|
||||
import { IGlobals } from "@spt-aki/models/eft/common/IGlobals";
|
||||
import { Prewipe } from "./prewipe";
|
||||
import { IHideoutConfig } from "@spt-aki/models/spt/config/IHideoutConfig";
|
||||
//import { Airdrop } from "./airdrop";
|
||||
|
||||
class ValensAIO implements IPostDBLoadMod
|
||||
@ -42,6 +45,8 @@ class ValensAIO implements IPostDBLoadMod
|
||||
//private airdropConfig: IAirdropConfig;
|
||||
private inRaidConfig: IInRaidConfig;
|
||||
private weightedRandomHelper : WeightedRandomHelper;
|
||||
private globals : IGlobals;
|
||||
private hideout: IHideoutConfig
|
||||
|
||||
public postDBLoad(container: DependencyContainer): void
|
||||
{
|
||||
@ -56,6 +61,7 @@ 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);
|
||||
|
||||
//const airdrop = new Airdrop(this.logger, this.airdropConfig, this.databaseServer)
|
||||
//airdrop.updateAirdrops();
|
||||
@ -69,16 +75,16 @@ class ValensAIO implements IPostDBLoadMod
|
||||
const containers = new Containers(vLogger, this.databaseServer);
|
||||
containers.updateContainers();
|
||||
|
||||
const flea = new Flea(vLogger, this.ragfairConfig, this.databaseServer);
|
||||
const flea = new Flea(vLogger, this.ragfairConfig, this.globals);
|
||||
flea.updateFlea();
|
||||
|
||||
const globals = new Globals(vLogger, this.databaseServer);
|
||||
const globals = new Globals(vLogger, this.globals);
|
||||
globals.updateGlobals();
|
||||
|
||||
const hideout = new Hideout(vLogger, this.databaseServer);
|
||||
const hideout = new Hideout(vLogger, this.databaseServer, this.hideout);
|
||||
hideout.updateHideout();
|
||||
|
||||
const insurance = new Insurance(vLogger, this.insuranceConfig);
|
||||
const insurance = new Insurance(vLogger, this.insuranceConfig, this.databaseServer);
|
||||
insurance.updateInsurance();
|
||||
|
||||
const items = new Items(vLogger, this.databaseServer);
|
||||
@ -90,6 +96,9 @@ class ValensAIO implements IPostDBLoadMod
|
||||
const loot = new Loot(vLogger, this.databaseServer, this.locationConfig);
|
||||
loot.updateLoot();
|
||||
|
||||
const prewipe = new Prewipe(vLogger, this.databaseServer);
|
||||
prewipe.updatePrewipe();
|
||||
|
||||
const progression = new Progression(vLogger, this.databaseServer, this.botConfig);
|
||||
progression.updateProgression();
|
||||
|
@ -1,138 +1,32 @@
|
||||
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { Logger } from "./logger";
|
||||
import type { BossLocationSpawn } from "@spt-aki/models/eft/common/ILocationBase";
|
||||
import { PrewipeConfig } from "../config/prewipe";
|
||||
import { Money } from "@spt-aki/models/enums/Money"
|
||||
import { Config } from "../config/config";
|
||||
import { WeightedRandomHelper } from "@spt-aki/helpers/WeightedRandomHelper";
|
||||
import type { BossLocationSpawn } from "@spt-aki/models/eft/common/ILocationBase";
|
||||
import { Logger } from "./logger";
|
||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||
import { ITrader } from "@spt-aki/models/eft/common/tables/ITrader";
|
||||
|
||||
export class Bots
|
||||
export class Prewipe
|
||||
{
|
||||
private modConfig: Config = require("../config/config.json");
|
||||
private modConfig: PrewipeConfig = require("../config/prewipe.json");
|
||||
private logger: Logger;
|
||||
private botConfig: IBotConfig;
|
||||
private tables: DatabaseServer;
|
||||
private traders: Record<string, ITrader>;
|
||||
private weightedRandomHelper: WeightedRandomHelper;
|
||||
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer, botConfig: IBotConfig, weightedRandomHelper: WeightedRandomHelper)
|
||||
constructor(logger: Logger, databaseServer: DatabaseServer)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.botConfig = botConfig;
|
||||
this.tables = databaseServer.getTables();
|
||||
this.traders = this.tables.traders;
|
||||
this.weightedRandomHelper = weightedRandomHelper;
|
||||
this.tables = databaseServer;
|
||||
this.traders = this.tables.getTables().traders;
|
||||
}
|
||||
|
||||
public updateBots(): void
|
||||
public updatePrewipe(): void
|
||||
{
|
||||
// modConfig variables
|
||||
const mod = this.modConfig.bots;
|
||||
const modPMC = this.modConfig.bots.pmc;
|
||||
const modScav = this.modConfig.bots.scav;
|
||||
const preWipe = this.modConfig.prewipeEvents;
|
||||
|
||||
// Server side variables
|
||||
const pmc = this.botConfig.pmc;
|
||||
const lootNValue = this.botConfig.lootNValue;
|
||||
const preWipe = this.modConfig;
|
||||
|
||||
// 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")
|
||||
{
|
||||
// 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}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Enables common and secure containers to spawn on PMCs by whitelisting the parent IDs. Rarity adjusted via PMC lootNValue. Default true.
|
||||
if (modPMC.containersOnPMCs)
|
||||
{
|
||||
this.containersOnPMCs();
|
||||
this.logger.info(`Containers On PMCs: ${modPMC.containersOnPMCs}`);
|
||||
}
|
||||
|
||||
|
||||
// Chance that PMC bot will be USEC or BEAR. Default is 50%
|
||||
if (modPMC.isUsec != 50)
|
||||
{
|
||||
pmc.isUsec = modPMC.isUsec;
|
||||
this.logger.info(`PMC isUsec Chance is: ${modPMC.isUsec}`);
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
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}`);
|
||||
}
|
||||
|
||||
|
||||
// Chance that the PMC bot of your faction (BEAR/USEC) will be hostile or not. Default is 50%.
|
||||
if (modPMC.chanceSameSideIsHostile != 50)
|
||||
{
|
||||
pmc.chanceSameSideIsHostilePercent = modPMC.chanceSameSideIsHostile;
|
||||
this.logger.info(`Chance Same Side Is Hostle is ${modPMC.chanceSameSideIsHostile}`);
|
||||
}
|
||||
|
||||
|
||||
// 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}`);
|
||||
}
|
||||
|
||||
|
||||
// Modifies the lootNValue of PMC or Scav if configured outside of the defaults.
|
||||
if (modPMC.lootNValue != 3 || modScav.lootNValue != 4)
|
||||
{
|
||||
lootNValue.scav = modScav.lootNValue;
|
||||
lootNValue.pmc = modPMC.lootNValue;
|
||||
this.logger.info(`lootNValue for bots has been changed! \n Scav lootNValue set to ${modScav.lootNValue} \n PMC lootNValue set to ${modPMC.lootNValue}`);
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
this.adjustPmcChance();
|
||||
this.logger.info("Chance to Convert Bots into PMC Patched");
|
||||
}
|
||||
|
||||
|
||||
// Makes *all* bosses spawn chance configurable.
|
||||
if (mod.bossChance.activated)
|
||||
{
|
||||
this.configureBossChance();
|
||||
this.logger.info(`Boss Chance set to ${mod.bossChance.chance}`)
|
||||
}
|
||||
|
||||
|
||||
// Prewipe Events
|
||||
|
||||
|
||||
// Spawn Killa On Factory
|
||||
if (preWipe.killaOnFactory)
|
||||
{
|
||||
@ -170,34 +64,10 @@ export class Bots
|
||||
this.makeObdolbosPowerful();
|
||||
this.logger.info("Make Obdolbos Powerful Prewipe Event Enabled");
|
||||
}
|
||||
|
||||
if (modPMC.looseWeaponInBackpackChance != 15 || modPMC.looseWeaponInBackpackLoot.max != 1 || modPMC.looseWeaponInBackpackLoot.min != 1)
|
||||
{
|
||||
this.changeLooseWeapon();
|
||||
this.logger.info("Loose Weapon In PMC Backpack Values Patched");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Functions start here.
|
||||
|
||||
// Function to enable secured and common containers on PMCs.
|
||||
private containersOnPMCs(): void
|
||||
{
|
||||
const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist;
|
||||
|
||||
dynaLoot.push("5448bf274bdc2dfc2f8b456a");
|
||||
dynaLoot.push("5795f317245977243854e041");
|
||||
}
|
||||
|
||||
private chooseRandomWeightedDifficulty(): string
|
||||
{
|
||||
const chosenDifficulty = this.weightedRandomHelper.getWeightedInventoryItem(this.modConfig.bots.pmc.difficultyWeights.weights);
|
||||
this.botConfig.pmc.difficulty = chosenDifficulty;
|
||||
|
||||
return chosenDifficulty;
|
||||
}
|
||||
|
||||
|
||||
public createBossWave(role: string, chance: number, followers: string, escortAmount: number, zones: string): any
|
||||
{
|
||||
return {
|
||||
@ -213,66 +83,18 @@ export class Bots
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private adjustPmcChance(): void
|
||||
{
|
||||
const pmcConfig = this.botConfig.pmc.convertIntoPmcChance;
|
||||
const modConfig = this.modConfig.bots.pmc.convertIntoPmcChance;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
private changeMaxLootvalue(): void
|
||||
{
|
||||
const lootConfig = this.botConfig.pmc;
|
||||
const modConfig = this.modConfig.bots.pmc;
|
||||
|
||||
lootConfig.maxBackpackLootTotalRub = modConfig.maxBackpackLootTotalRub;
|
||||
lootConfig.maxPocketLootTotalRub = modConfig.maxPocketLootTotalRub;
|
||||
lootConfig.maxVestLootTotalRub = modConfig.maxVestLootTotalRub;
|
||||
}
|
||||
|
||||
|
||||
private configureBossChance(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
|
||||
for (const i in locations)
|
||||
{
|
||||
if (i !== "base")
|
||||
{
|
||||
if (locations[i].base.BossLocationSpawn !== [])
|
||||
{
|
||||
for (const x in locations[i].base.BossLocationSpawn)
|
||||
{
|
||||
locations[i].base.BossLocationSpawn[x].BossChance = this.modConfig.bots.bossChance.chance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private spawnKillaOnFactory(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
const killaWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.factory4_day.base.OpenZones);
|
||||
this.tables.locations.factory4_day.base.BossLocationSpawn.push(killaWave);
|
||||
locations.factory4_day.base.BossLocationSpawn.push(killaWave);
|
||||
locations.factory4_night.base.BossLocationSpawn.push(killaWave);
|
||||
}
|
||||
|
||||
|
||||
private spawnAllBossesOnReserve(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
let bossWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.rezervbase.base.OpenZones);
|
||||
locations.rezervbase.base.BossLocationSpawn.push(bossWave);
|
||||
bossWave = this.createBossWave("bossBully", 100, "followerBully", 4, locations.rezervbase.base.OpenZones);
|
||||
@ -286,7 +108,7 @@ export class Bots
|
||||
|
||||
private spawnGluharOnLabs(): void
|
||||
{
|
||||
const locations = this.tables.locations;
|
||||
const locations = this.tables.getTables().locations;
|
||||
const glugluWave: BossLocationSpawn =
|
||||
{
|
||||
"BossName": "bossGluhar",
|
||||
@ -489,19 +311,6 @@ export class Bots
|
||||
"AbsoluteValue": false,
|
||||
"SkillName": ""
|
||||
}]
|
||||
|
||||
this.tables.globals.config.Health.Effects.Stimulator.Buffs.Buffs_Obdolbos = obdolbosBuff;
|
||||
this.tables.getTables().globals.config.Health.Effects.Stimulator.Buffs.Buffs_Obdolbos = obdolbosBuff;
|
||||
}
|
||||
|
||||
|
||||
private changeLooseWeapon():void
|
||||
{
|
||||
const pmcConfig = this.botConfig.pmc;
|
||||
const modConfig = this.modConfig.bots.pmc;
|
||||
|
||||
pmcConfig.looseWeaponInBackpackChancePercent = modConfig.looseWeaponInBackpackChance;
|
||||
pmcConfig.looseWeaponInBackpackLootMinMax.min = modConfig.looseWeaponInBackpackLoot.min;
|
||||
pmcConfig.looseWeaponInBackpackLootMinMax.max = modConfig.looseWeaponInBackpackLoot.max;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { InsuranceController } from "../controllers/InsuranceController";
|
||||
import { OnLoadOnUpdate } from "../di/OnLoadOnUpdate";
|
||||
import { OnUpdate } from "../di/OnUpdate";
|
||||
import { IPmcData } from "../models/eft/common/IPmcData";
|
||||
import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData";
|
||||
import { IGetInsuranceCostRequestData } from "../models/eft/insurance/IGetInsuranceCostRequestData";
|
||||
@ -10,14 +10,13 @@ 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 OnLoadOnUpdate {
|
||||
export declare class InsuranceCallbacks extends 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);
|
||||
onLoad(): void;
|
||||
getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData>;
|
||||
insure(pmcData: IPmcData, body: IInsureRequestData, sessionID: string): IItemEventRouterResponse;
|
||||
onUpdate(secondsSinceLastRun: number): boolean;
|
@ -9,10 +9,10 @@ export declare class TraderCallbacks extends OnLoadOnUpdate {
|
||||
protected traderController: TraderController;
|
||||
constructor(httpResponse: HttpResponseUtil, traderController: TraderController);
|
||||
onLoad(): void;
|
||||
onUpdate(): boolean;
|
||||
getRoute(): string;
|
||||
getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]>;
|
||||
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>;
|
||||
onUpdate(): boolean;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user