From 277925732fbfe188efa4bb80023bb734354fcbb9 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 14 Jun 2024 15:40:27 +0100 Subject: [PATCH] Added system to allow per-trader starting standing values --- .../assets/database/templates/profiles.json | 74 ++++++++++++++----- project/src/helpers/TraderHelper.ts | 6 +- .../eft/common/tables/IProfileTemplate.ts | 2 +- 3 files changed, 61 insertions(+), 21 deletions(-) diff --git a/project/assets/database/templates/profiles.json b/project/assets/database/templates/profiles.json index 1638f172..925eb030 100644 --- a/project/assets/database/templates/profiles.json +++ b/project/assets/database/templates/profiles.json @@ -2630,8 +2630,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -5461,8 +5463,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -8661,8 +8665,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -11960,8 +11966,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -15618,8 +15626,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -19473,8 +19483,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -23171,8 +23183,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -27026,8 +27040,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -31366,8 +31382,11 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2, + "579dc571d53a0658a154fbec": 0.5 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -35922,8 +35941,11 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2, + "579dc571d53a0658a154fbec": 0.5 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -36874,8 +36896,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "fleaBlockedDays": 365, "purchaseAllClothingByDefaultForTrader":[ @@ -37822,8 +37846,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0.2 + }, "initialSalesSum": 0, - "initialStanding": 0.2, "jaegerUnlocked": false, "fleaBlockedDays": 365, "purchaseAllClothingByDefaultForTrader":[ @@ -40875,8 +40901,10 @@ "5c0647fdd443bc2504c2d371": 4, "638f541a29ffd1183d187f57": 4 }, + "initialStanding": { + "default": 6 + }, "initialSalesSum": 2600000, - "initialStanding": 6, "jaegerUnlocked": true, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -43893,8 +43921,10 @@ "5c0647fdd443bc2504c2d371": 4, "638f541a29ffd1183d187f57": 4 }, + "initialStanding": { + "default": 6 + }, "initialSalesSum": 2600000, - "initialStanding": 6, "jaegerUnlocked": true, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -47256,8 +47286,10 @@ "5c0647fdd443bc2504c2d371": 2, "638f541a29ffd1183d187f57": 2 }, + "initialStanding": { + "default": 1 + }, "initialSalesSum": 2600000, - "initialStanding": 1, "jaegerUnlocked": true, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -50616,8 +50648,10 @@ "5c0647fdd443bc2504c2d371": 2, "638f541a29ffd1183d187f57": 2 }, + "initialStanding": { + "default": 1 + }, "initialSalesSum": 2600000, - "initialStanding": 1, "jaegerUnlocked": true, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -51539,8 +51573,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" @@ -52469,8 +52505,10 @@ "5c0647fdd443bc2504c2d371": 1, "638f541a29ffd1183d187f57": 1 }, + "initialStanding": { + "default": 0 + }, "initialSalesSum": 0, - "initialStanding": 0, "jaegerUnlocked": false, "lockedByDefaultOverride": [ "579dc571d53a0658a154fbec" diff --git a/project/src/helpers/TraderHelper.ts b/project/src/helpers/TraderHelper.ts index 5fdd8a1d..858dc74b 100644 --- a/project/src/helpers/TraderHelper.ts +++ b/project/src/helpers/TraderHelper.ts @@ -198,13 +198,15 @@ export class TraderHelper */ protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number { + const initialStanding = rawProfileTemplate.initialStanding[traderId] + ?? rawProfileTemplate.initialStanding.default; // Edge case for Lightkeeper, 0 standing means seeing `Make Amends - Buyout` quest - if (traderId === Traders.LIGHTHOUSEKEEPER && rawProfileTemplate.initialStanding === 0) + if (traderId === Traders.LIGHTHOUSEKEEPER && initialStanding === 0) { return 0.01; } - return rawProfileTemplate.initialStanding; + return initialStanding; } /** diff --git a/project/src/models/eft/common/tables/IProfileTemplate.ts b/project/src/models/eft/common/tables/IProfileTemplate.ts index 6cf07cbc..eda315ff 100644 --- a/project/src/models/eft/common/tables/IProfileTemplate.ts +++ b/project/src/models/eft/common/tables/IProfileTemplate.ts @@ -35,9 +35,9 @@ export interface ITemplateSide export interface ProfileTraderTemplate { initialLoyaltyLevel: Record + initialStanding: Record setQuestsAvailableForStart?: boolean setQuestsAvailableForFinish?: boolean - initialStanding: number initialSalesSum: number jaegerUnlocked: boolean /** How many days is usage of the flea blocked for upon profile creation */