Hotfix for 86x70 AmmoType.

This commit is contained in:
VforValens 2022-08-28 23:48:57 -04:00
parent 2488092fc9
commit 053294c48a
10 changed files with 47 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Valens-AIO", "name": "Valens-AIO",
"version": "1.4.5", "version": "1.4.6",
"main": "src/mod.js", "main": "src/mod.js",
"license": "CC BY-NC-ND 4.0", "license": "CC BY-NC-ND 4.0",
"author": "Valens", "author": "Valens",

View File

@ -1,6 +1,6 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger"; 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 { Grenade, Ammo762x51, Ammo762x54, Ammo86x70, 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/ts/ammo"; import { AmmoConfig } from "../config/ts/ammo";
export class Ammo export class Ammo
@ -34,7 +34,7 @@ export class Ammo
// Sets .338 Lapua Magnum max stacks. // Sets .338 Lapua Magnum max stacks.
if (mod.a86x70 != 30) if (mod.a86x70 != 30)
{ {
for (const value of Object.values(Ammo338Lapua)) for (const value of Object.values(Ammo86x70))
{ {
items[value]._props.StackMaxSize = mod.a86x70; items[value]._props.StackMaxSize = mod.a86x70;
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a86x70}`); this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a86x70}`);

View File

@ -49,6 +49,15 @@ export declare class HideoutHelper {
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void; protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean; protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea; protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea;
/**
*
* Filters are deleted when reaching 0 resourceValue
* @param waterFilterArea
* @param pwProd
* @param isGeneratorOn
* @param pmcData
* @returns
*/
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea; protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd; protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea; protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea;

View File

@ -24,6 +24,19 @@ export declare class ProfileHelper {
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService); constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
resetProfileQuestCondition(sessionID: string, conditionId: string): void; resetProfileQuestCondition(sessionID: string, conditionId: string): void;
getCompleteProfile(sessionID: string): IPmcData[]; getCompleteProfile(sessionID: string): IPmcData[];
/**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
* Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using
* the now updated profile values as a base, meaning it shows x2 xp gained
* Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return
* Delete snapshot of pre-raid profile prior to returning profile data
* @param sessionId Session id
* @param output pmc and scav profiles array
* @param pmcProfile post-raid pmc profile
* @param scavProfile post-raid scav profile
* @returns updated profile array
*/
postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
/** /**
* Add experience to a PMC inside the players profile * Add experience to a PMC inside the players profile

View File

@ -46,7 +46,7 @@ export declare class RagfairOfferHelper {
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[]; getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
processOffers(sessionID: string): boolean; processOffersOnProfile(sessionID: string): boolean;
protected getProfileOffers(sessionID: string): IRagfairOffer[]; protected getProfileOffers(sessionID: string): IRagfairOffer[];
protected deleteOfferByOfferId(sessionID: string, offerId: string): void; protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse; protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;

View File

@ -11,6 +11,12 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer; protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig; protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer); constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number; calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
rollForSale(sellChance: number, count: number): SellResult[]; /**
* Determine if the offer being listed will be sold
* @param sellChancePercent chance item will sell
* @param itemSellCount count of items to sell
* @returns Array of purchases of item(s) lsited
*/
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
} }

View File

@ -23,7 +23,7 @@ export declare enum Ammo762x54 {
BT_GZH = "5e023d34e8a400319a28ed44", BT_GZH = "5e023d34e8a400319a28ed44",
BS_GZH = "5e023d48186a883be655e551" BS_GZH = "5e023d48186a883be655e551"
} }
export declare enum Ammo338Lapua { export declare enum Ammo86x70 {
TAC_X = "5fc382b6d6fa9c00c571bbc3", TAC_X = "5fc382b6d6fa9c00c571bbc3",
UCW = "5fc382c1016cce60e8341b20", UCW = "5fc382c1016cce60e8341b20",
AP = "5fc382a9d724d907e2077dab", AP = "5fc382a9d724d907e2077dab",

View File

@ -12,6 +12,7 @@ export interface Sell {
chance: Chance; chance: Chance;
time: Time; time: Time;
reputation: Reputation; reputation: Reputation;
simulatedSellHours: number;
} }
export interface Chance { export interface Chance {
base: number; base: number;

View File

@ -45,6 +45,11 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to find and remove slots from * @param pmcProfile Profile to find and remove slots from
*/ */
protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void; protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void;
/**
* Hideout slots need to be in a specific order, locationIndex in ascending order
* @param pmcProfile profile to edit
*/
protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void;
/** /**
* add in objects equal to the number of slots * add in objects equal to the number of slots
* @param areaType area to check * @param areaType area to check

View File

@ -19,4 +19,10 @@ export declare class TimeUtil {
* @returns current date in format: 00.00.0000 (dd.mm.yyyy) * @returns current date in format: 00.00.0000 (dd.mm.yyyy)
*/ */
getDateMailFormat(): string; getDateMailFormat(): string;
/**
* Convert hours into seconds
* @param hours hours to convert to seconds
* @returns number
*/
getHoursAsSeconds(hours: number): number;
} }