diff --git a/project/src/helpers/ProfileHelper.ts b/project/src/helpers/ProfileHelper.ts index 40bf63b7..8b799884 100644 --- a/project/src/helpers/ProfileHelper.ts +++ b/project/src/helpers/ProfileHelper.ts @@ -518,4 +518,22 @@ export class ProfileHelper { public hasAccessToRepeatableFreeRefreshSystem(pmcProfile: IPmcData): boolean { return [GameEditions.EDGE_OF_DARKNESS, GameEditions.UNHEARD].includes(pmcProfile.Info?.GameVersion); } + + /** + * Find a profiles "Pockets" item and replace its tpl with passed in value + * @param pmcProfile Player profile + * @param newPocketTpl New tpl to set profiles Pockets to + */ + public replaceProfilePocketTpl(pmcProfile: IPmcData, newPocketTpl: string): void { + const pockets = pmcProfile.Inventory.items.find((item) => item.slotId === "Pockets"); + if (!pockets) { + this.logger.error( + `unable to replace profile: ${pmcProfile._id} pocket tpl with: ${newPocketTpl} as Pocket item could not be found.`, + ); + + return; + } + + pockets._tpl = newPocketTpl; + } } diff --git a/project/src/helpers/QuestHelper.ts b/project/src/helpers/QuestHelper.ts index 086fbcd6..04f9f3f6 100644 --- a/project/src/helpers/QuestHelper.ts +++ b/project/src/helpers/QuestHelper.ts @@ -919,7 +919,7 @@ export class QuestHelper { this.profileHelper.addAchievementToProfile(pmcProfile, reward.target); break; case QuestRewardType.STASH_ROWS: - this.profileHelper.addStashRowsBonusToProfile(sessionId, Number.parseInt(reward.value)); // add specified stash rows from quest reward - requires client restart + this.profileHelper.addStashRowsBonusToProfile(sessionId, Number.parseInt(reward.value)); // Add specified stash rows from quest reward - requires client restart break; case QuestRewardType.PRODUCTIONS_SCHEME: this.findAndAddHideoutProductionIdToProfile( @@ -930,6 +930,9 @@ export class QuestHelper { questResponse, ); break; + case QuestRewardType.POCKETS: + this.profileHelper.replaceProfilePocketTpl(pmcProfile, reward.target); + break; default: this.logger.error( this.localisationService.getText("quest-reward_type_not_handled", { diff --git a/project/src/models/enums/QuestRewardType.ts b/project/src/models/enums/QuestRewardType.ts index 4d9c46ca..33a08ba7 100644 --- a/project/src/models/enums/QuestRewardType.ts +++ b/project/src/models/enums/QuestRewardType.ts @@ -10,4 +10,5 @@ export enum QuestRewardType { TRADER_STANDING_RESTORE = "TraderStandingRestore", STASH_ROWS = "StashRows", ACHIEVEMENT = "Achievement", + POCKETS = "Pockets", }