Added implementation for Achievement quest rewards

This commit is contained in:
Dev 2024-06-04 15:36:01 +01:00
parent aebe1ab606
commit e5398f5e4d
2 changed files with 11 additions and 2 deletions

View File

@ -557,4 +557,14 @@ export class ProfileHelper
return pmcProfile.Info.Bans
.some((ban) => ban.banType === BanType.RAGFAIR && currentTimestamp < ban.dateTime);
}
/**
* Add an achievement to player profile
* @param pmcProfile Profile to add achievement to
* @param achievementId Id of achievement to add
*/
public addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void
{
pmcProfile.Achievements[achievementId] = this.timeUtil.getTimestamp();
}
}

View File

@ -956,8 +956,7 @@ export class QuestHelper
// Handled elsewhere, TODO: find and say here
break;
case QuestRewardType.ACHIEVEMENT:
this.logger.warning(`TODO - achievement: ${reward.target} reward for quest completion not implemented yet`);
// TODO - Implement (rewards for completion of Gunsmith P25)
this.profileHelper.addAchievementToProfile(pmcProfile, reward.target);
break;
case QuestRewardType.STASH_ROWS:
this.profileHelper.addStashRowsBonusToProfile(sessionId, Number.parseInt(<string>reward.value)); // add specified stash rows from quest reward - requires client restart