diff --git a/project/src/controllers/PrestigeController.ts b/project/src/controllers/PrestigeController.ts index 9f92bb6c..3d4ba0ed 100644 --- a/project/src/controllers/PrestigeController.ts +++ b/project/src/controllers/PrestigeController.ts @@ -64,6 +64,22 @@ export class PrestigeController { * Handle /client/prestige/obtain */ public async obtainPrestige(sessionId: string, request: IObtainPrestigeRequest[]): Promise { + // Going to prestige 1 + + // transfer + // 5% of skills should be transfered over + // 5% of mastering should be transfered over + // earned achievements should be transfered over + // profile stats should be transfered over + // prestige progress should be transfered over + + // reset + // trader standing + // task progress + // character level + // stash + // hideout progress + const prePrestigeProfileClone = this.cloner.clone(this.profileHelper.getFullProfile(sessionId)); const prePrestigePmc = prePrestigeProfileClone.characters.pmc; const createRequest: IProfileCreateRequestData = { @@ -88,11 +104,10 @@ export class PrestigeController { } // Skill copy - // TODO - Find what skills should be prestiged over const commonSKillsToCopy = prePrestigePmc.Skills.Common; for (const skillToCopy of commonSKillsToCopy) { - // Set progress to max level 20 - skillToCopy.Progress = Math.min(skillToCopy.Progress, 2000); + // Set progress 5% of what it was + skillToCopy.Progress = skillToCopy.Progress * 0.05; const existingSkill = newProfile.characters.pmc.Skills.Common.find((skill) => skill.Id === skillToCopy.Id); if (existingSkill) { existingSkill.Progress = skillToCopy.Progress; @@ -103,8 +118,8 @@ export class PrestigeController { const masteringSkillsToCopy = prePrestigePmc.Skills.Mastering; for (const skillToCopy of masteringSkillsToCopy) { - // Set progress to max level 20 - skillToCopy.Progress = Math.min(skillToCopy.Progress, 2000); + // Set progress 5% of what it was + skillToCopy.Progress = skillToCopy.Progress * 0.05; const existingSkill = newProfile.characters.pmc.Skills.Mastering.find( (skill) => skill.Id === skillToCopy.Id, ); @@ -116,6 +131,15 @@ export class PrestigeController { } const indexOfPrestigeObtained = Math.min(createRequest.sptForcePrestigeLevel - 1, 1); // Index starts at 0 + + // Add existing completed achievements and new one for prestige + newProfile.characters.pmc.Achievements = prePrestigeProfileClone.characters.pmc.Achievements; // this *should* only contain completed ones + + // Add "Prestigious" achievement + if (!newProfile.characters.pmc.Achievements["676091c0f457869a94017a23"]) { + newProfile.characters.pmc.Achievements["676091c0f457869a94017a23"] = this.timeUtil.getTimestamp(); + } + // Assumes Prestige data is in descending order const currentPrestigeData = this.databaseService.getTemplates().prestige.elements[indexOfPrestigeObtained]; const prestigeRewards = this.databaseService @@ -151,11 +175,6 @@ export class PrestigeController { ); } - // Add "Prestigious" achievement - if (!newProfile.achievements["676091c0f457869a94017a23"]) { - newProfile.achievements["676091c0f457869a94017a23"] = this.timeUtil.getTimestamp(); - } - // Force save of above changes to disk await this.saveServer.saveProfile(sessionId); } diff --git a/project/src/models/eft/profile/ISptProfile.ts b/project/src/models/eft/profile/ISptProfile.ts index 6a91b18d..39566e8e 100644 --- a/project/src/models/eft/profile/ISptProfile.ts +++ b/project/src/models/eft/profile/ISptProfile.ts @@ -21,8 +21,6 @@ export interface ISptProfile { insurance: IInsurance[]; /** Assort purchases made by player since last trader refresh */ traderPurchases?: Record>; - /** Achievements earned by player */ - achievements: Record; /** List of friend profile IDs */ friends: string[]; customisationUnlocks: ICustomisationStorage[]; diff --git a/project/src/services/CreateProfileService.ts b/project/src/services/CreateProfileService.ts index f6a350ac..b1237ed9 100644 --- a/project/src/services/CreateProfileService.ts +++ b/project/src/services/CreateProfileService.ts @@ -110,7 +110,6 @@ export class CreateProfileService { inraid: {} as IInraid, insurance: [], traderPurchases: {}, - achievements: {}, friends: [], customisationUnlocks: [], };