RC1 of 3.5.0 compatibility?

This commit is contained in:
Valens 2023-01-08 01:54:44 -05:00
parent 61cc3c144a
commit 2dcdc3d1b9
3 changed files with 23 additions and 133 deletions

View File

@ -4,14 +4,12 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { Scavs } from "./scavs"; import { Scavs } from "./scavs";
import { PMCs } from "./pmc"; import { PMCs } from "./pmc";
class ValensProgression implements IPostDBLoadMod class ValensProgression implements IPostDBLoadMod
{ {
private logger: ILogger;
private configServer: ConfigServer; private configServer: ConfigServer;
private botConfig: IBotConfig; private botConfig: IBotConfig;
private databaseServer: DatabaseServer; private databaseServer: DatabaseServer;
@ -32,121 +30,6 @@ class ValensProgression implements IPostDBLoadMod
this.pmcs = new PMCs(this.botConfig, this.databaseServer); this.pmcs = new PMCs(this.botConfig, this.databaseServer);
this.pmcs.updatePmcs(); this.pmcs.updatePmcs();
} }
/*public preAkiLoad(container: DependencyContainer): void
{
// We will save a reference to the dependency container to resolve dependencies
// that we may need down the line
ValensProgression.container = container;
// Wait until WatermarkLocale gets resolved by the server and run code afterwards to replace
// the getDescription() function with the one below called 'replacementFunction()
container.afterResolution("BotGenerator", (_t, result: BotGenerator) =>
{
// We want to replace the original method logic with something different
result.generateDogtag = (bot: IBotBase) =>
{
// We are calling a replacement function, technically you could also do:
// result.login = this.replacementFunction;
return this.generateDogtags(bot);
}
// The modifier Always makes sure this replacement method is ALWAYS replaced
}, {frequency: "Always"});
}
public generateDogtags(bot: IBotBase)
{
const profile = this.profileController.getCompleteProfile(sessionId);
const playerLevel = this.playerService.calculateLevel(profile[0]); // find(x=>x._id === sessionId)
const usecLvl = this.databaseServer.getTables().bots["usec"].experience.level;
const bearLvl = this.databaseServer.getTables().bots["bear"].experience.level;
if (playerLevel >= 1 && playerLevel <= 15)
{
this.generateDogtagLL1(usecLvl, bearLvl);
}
if (playerLevel >= 16 && playerLevel <= 25)
{
this.generateDogtagLL2(usecLvl, bearLvl);
}
if (playerLevel >= 26 && playerLevel <= 36)
{
this.generateDogtagLL3(usecLvl, bearLvl);
}
if (playerLevel >= 37)
{
this.generateDogtagLL4(usecLvl, bearLvl);
}
const upd: Upd = {
SpawnedInSession: true,
Dogtag: {
AccountId: bot.aid,
ProfileId: bot._id,
Nickname: bot.Info.Nickname,
Side: bot.Info.Side,
Level: bot.Info.Level,
Time: (new Date().toISOString()),
Status: "Killed by ",
KillerAccountId: "Unknown",
KillerProfileId: "Unknown",
KillerName: "Unknown",
WeaponName: "Unknown"
}
}
const inventoryItem: Item = {
_id: this.hashUtil.generate(),
_tpl: ((bot.Info.Side === "Usec") ? BaseClasses.DOG_TAG_USEC : BaseClasses.DOG_TAG_BEAR),
parentId: bot.Inventory.equipment,
slotId: "Dogtag",
location: undefined,
upd: upd
}
bot.Inventory.items.push(inventoryItem);
return bot;
}
private generateDogtagLL1(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 15;
usecLvl.min = 1;
bearLvl.max = 15;
bearLvl.min = 1;
}
private generateDogtagLL2(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 25;
usecLvl.min = 16;
bearLvl.max = 25;
bearLvl.min = 16;
}
private generateDogtagLL3(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 36;
usecLvl.min = 26;
bearLvl.max = 36;
bearLvl.min = 26;
}
private generateDogtagLL4(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void
{
usecLvl.max = 70;
usecLvl.min = 37;
bearLvl.max = 70;
bearLvl.min = 37;
}*/
} }
module.exports = { mod: new ValensProgression() } module.exports = { mod: new ValensProgression() }

View File

@ -1,6 +1,6 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { EquipmentFilterDetails, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig";
export class PMCs export class PMCs
{ {
@ -195,14 +195,23 @@ export class PMCs
const ammo23x75ArrayLL3 = ["5e85a9a6eacf8c039e4e2ac1", "5f647f31b6238e5dd066e196"]; const ammo23x75ArrayLL3 = ["5e85a9a6eacf8c039e4e2ac1", "5f647f31b6238e5dd066e196"];
const progressionWhitelistLL1PMC: EquipmentFilterDetails = const progressionWhitelistLL1PMC: EquipmentFilters =
{ {
"levelRange": "weaponModLimits": {},
"weaponSightWhitelist": {},
"nvgIsActiveChancePercent": 5,
"faceShieldIsActiveChancePercent": 85,
"lightLaserIsActiveChancePercent": 75,
"randomisation": [],
"blacklist": [],
"weightingAdjustments": [],
"whitelist": [{
"levelRange":
{ {
"min": 1, "min": 1,
"max": 15 "max": 15
}, },
"equipment": "equipment":
{ {
"FirstPrimaryWeapon": [...primaryWeaponArrayLL1], "FirstPrimaryWeapon": [...primaryWeaponArrayLL1],
"Holster": [...holsterArrayLL1], "Holster": [...holsterArrayLL1],
@ -215,7 +224,7 @@ export class PMCs
"ArmBand": [...armBandArrayLL1], "ArmBand": [...armBandArrayLL1],
"FaceCover": [...faceCoverArrayLL1] "FaceCover": [...faceCoverArrayLL1]
}, },
"cartridge": "cartridge":
{ {
"Caliber762x54R": [...ammo762x54ArrayLL1], "Caliber762x54R": [...ammo762x54ArrayLL1],
"Caliber762x51": [...ammo762x51ArrayLL1], "Caliber762x51": [...ammo762x51ArrayLL1],
@ -230,7 +239,8 @@ export class PMCs
"Caliber9x18PM": [...ammo9x18ArrayLL1], "Caliber9x18PM": [...ammo9x18ArrayLL1],
"Caliber12g": [...ammo12x70ArrayLL1], "Caliber12g": [...ammo12x70ArrayLL1],
"Caliber20g": [...ammo20x70ArrayLL1] "Caliber20g": [...ammo20x70ArrayLL1]
} }}],
"clothing": []
} }
const progressionWhitelistLL2PMC: EquipmentFilterDetails = const progressionWhitelistLL2PMC: EquipmentFilterDetails =
@ -323,7 +333,7 @@ export class PMCs
} }
const pmc = this.botConfig.equipment.pmc.whitelist; const pmc = this.botConfig.equipment.pmc.whitelist;
pmc.push(progressionWhitelistLL1PMC); this.botConfig.equipment.pmc = progressionWhitelistLL1PMC;
pmc.push(progressionWhitelistLL2PMC); pmc.push(progressionWhitelistLL2PMC);
pmc.push(progressionWhitelistLL3PMC); pmc.push(progressionWhitelistLL3PMC);
} }

View File

@ -90,18 +90,14 @@ export class Scavs
// Scav Whitelist // Scav Whitelist
const progressionWhitelistScav1: EquipmentFilters = const progressionWhitelistScav1: EquipmentFilters =
{ {
"weaponModLimits": {},
"weaponSightWhitelist": {},
"nvgIsActiveChancePercent": 5,
"faceShieldIsActiveChancePercent": 85, "faceShieldIsActiveChancePercent": 85,
"lightLaserIsActiveChancePercent": 75, "lightLaserIsActiveChancePercent": 75,
"weightingAdjustments": [],
"weaponModLimits": {
"scopeLimit": 1,
"lightLaserLimit": 1
},
"weaponSightWhitelist": {},
"nvgIsActiveChancePercent": 50,
"clothing": [],
"randomisation": [], "randomisation": [],
"blacklist": [], "blacklist": [],
"weightingAdjustments": [],
"whitelist": [{ "whitelist": [{
"levelRange": "levelRange":
{ {
@ -136,7 +132,8 @@ export class Scavs
"Caliber12g": [...ammo12x70ArrayScav], "Caliber12g": [...ammo12x70ArrayScav],
"Caliber20g": [...ammo20x70ArrayScav] "Caliber20g": [...ammo20x70ArrayScav]
} }
}] }],
"clothing": []
} }
const progressionWhitelistScav2: EquipmentFilterDetails = const progressionWhitelistScav2: EquipmentFilterDetails =