diff --git a/project/src/generators/RagfairOfferGenerator.ts b/project/src/generators/RagfairOfferGenerator.ts index 0d470edf..30f2446a 100644 --- a/project/src/generators/RagfairOfferGenerator.ts +++ b/project/src/generators/RagfairOfferGenerator.ts @@ -115,11 +115,23 @@ export class RagfairOfferGenerator { const isTrader = this.ragfairServerHelper.isTrader(userID); - const offerRequirements = barterScheme.map((barter) => ({ - _tpl: barter._tpl, - count: +barter.count.toFixed(2), - onlyFunctional: barter.onlyFunctional ?? false, - } as OfferRequirement)); + const offerRequirements = barterScheme.map((barter) => + { + const offerRequirement: OfferRequirement = { + _tpl: barter._tpl, + count: +barter.count.toFixed(2), + onlyFunctional: barter.onlyFunctional ?? false, + }; + + // Dogtags define level and side + if (barter.level !== undefined) + { + offerRequirement.level = barter.level; + offerRequirement.side = barter.side; + } + + return offerRequirement; + }); // Clone to avoid modifying original array const itemsClone = this.cloner.clone(items); diff --git a/project/src/models/eft/common/tables/ITrader.ts b/project/src/models/eft/common/tables/ITrader.ts index 53e449e2..6d874ead 100644 --- a/project/src/models/eft/common/tables/ITrader.ts +++ b/project/src/models/eft/common/tables/ITrader.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { Item } from "@spt/models/eft/common/tables/IItem"; +import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { ITraderServiceModel } from "@spt/models/spt/services/ITraderServiceModel"; export interface ITrader @@ -95,6 +96,8 @@ export interface IBarterScheme _tpl: string onlyFunctional?: boolean sptQuestLocked?: boolean + level?: number + side?: DogtagExchangeSide } export interface ISuit diff --git a/project/src/models/eft/ragfair/IRagfairOffer.ts b/project/src/models/eft/ragfair/IRagfairOffer.ts index e2937694..6c6cc7a2 100644 --- a/project/src/models/eft/ragfair/IRagfairOffer.ts +++ b/project/src/models/eft/ragfair/IRagfairOffer.ts @@ -1,4 +1,5 @@ import { Item } from "@spt/models/eft/common/tables/IItem"; +import { DogtagExchangeSide } from "@spt/models/enums/DogtagExchangeSide"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; export interface IRagfairOffer @@ -33,6 +34,8 @@ export interface OfferRequirement _tpl: string count: number onlyFunctional: boolean + level?: number + side?: DogtagExchangeSide } export interface IRagfairOfferUser diff --git a/project/src/models/enums/DogtagExchangeSide.ts b/project/src/models/enums/DogtagExchangeSide.ts new file mode 100644 index 00000000..425827a5 --- /dev/null +++ b/project/src/models/enums/DogtagExchangeSide.ts @@ -0,0 +1,6 @@ +export enum DogtagExchangeSide +{ + USEC = "Usec", + BEAR = "Bear", + ANY = "Any", +}