From c25be01a15cd617f7e624f84d29a64484934c5be Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 13 Mar 2024 10:18:35 +0000 Subject: [PATCH] Only apply bonuses to items repaired with kit when players `weapon maintenance` skill is at or above level 10 --- project/src/controllers/RepairController.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/project/src/controllers/RepairController.ts b/project/src/controllers/RepairController.ts index 0c5607f0..13b6ddaf 100644 --- a/project/src/controllers/RepairController.ts +++ b/project/src/controllers/RepairController.ts @@ -1,5 +1,6 @@ import { inject, injectable } from "tsyringe"; +import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper"; import { QuestHelper } from "@spt-aki/helpers/QuestHelper"; import { RepairHelper } from "@spt-aki/helpers/RepairHelper"; import { TraderHelper } from "@spt-aki/helpers/TraderHelper"; @@ -7,6 +8,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest"; import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest"; +import { SkillTypes } from "@spt-aki/models/enums/SkillTypes"; import { IRepairConfig } from "@spt-aki/models/spt/config/IRepairConfig"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { EventOutputHolder } from "@spt-aki/routers/EventOutputHolder"; @@ -28,6 +30,7 @@ export class RepairController @inject("PaymentService") protected paymentService: PaymentService, @inject("RepairHelper") protected repairHelper: RepairHelper, @inject("RepairService") protected repairService: RepairService, + @inject("ProfileHelper") protected profileHelper: ProfileHelper, ) {} @@ -97,7 +100,11 @@ export class RepairController output, ); - this.repairService.addBuffToItem(repairDetails, pmcData); + // Bonuses only get applied when players weapon maintenance skill is over level 10 + if (this.profileHelper.getSkillFromProfile(pmcData, SkillTypes.WEAPON_TREATMENT)?.Progress >= 1000) + { + this.repairService.addBuffToItem(repairDetails, pmcData); + } // add repaired item to send to client output.profileChanges[sessionID].items.change.push(repairDetails.repairedItem);