Updated for v1.0.2
This commit is contained in:
parent
68a1335da8
commit
f922d7a51f
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "ScavXpCounts",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"author": "gasmo",
|
||||
"akiVersion": "~3.6",
|
||||
"akiVersion": "3.7.1",
|
||||
"scripts": {
|
||||
"setup": "npm i",
|
||||
"build": "node ./packageBuild.ts"
|
||||
|
@ -4,6 +4,7 @@ import { InRaidHelper } from "@spt-aki/helpers/InRaidHelper";
|
||||
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
||||
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { ProfileHelper } from "@spt-aki/helpers/ProfileHelper";
|
||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||
|
||||
class Mod implements IPreAkiLoadMod
|
||||
{
|
||||
@ -14,6 +15,7 @@ class Mod implements IPreAkiLoadMod
|
||||
{
|
||||
Mod.container = container;
|
||||
const oldClass = Mod.container.resolve<InRaidHelper>("InRaidHelper");
|
||||
const logger = Mod.container.resolve<ILogger>("WinstonLogger");
|
||||
|
||||
container.afterResolution("InRaidHelper", (_t, result: InRaidHelper) =>
|
||||
{
|
||||
@ -23,9 +25,11 @@ class Mod implements IPreAkiLoadMod
|
||||
{
|
||||
const profileHelper = Mod.container.resolve<ProfileHelper>("ProfileHelper");
|
||||
const pmcData = profileHelper.getPmcProfile(sessionID);
|
||||
pmcData.Info.Experience += saveProgressRequest.profile.Stats.TotalSessionExperience;
|
||||
logger.info(`[SPT-AKI] Updating profile base stats for ${pmcData.Info.Nickname}, adding ${saveProgressRequest.profile.Stats.Eft.TotalSessionExperience} experience.`);
|
||||
pmcData.Info.Experience += saveProgressRequest.profile.Stats.Eft.TotalSessionExperience;
|
||||
saveProgressRequest.profile.Skills.Common.forEach((skill) =>
|
||||
{
|
||||
if (skill.PointsEarnedDuringSession > 0) logger.info(`[SPT-AKI] Adding ${skill.PointsEarnedDuringSession} experience to ${skill.Id}`);
|
||||
pmcData.Skills.Common.find(p => p.Id === skill.Id).Progress += skill.PointsEarnedDuringSession;
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user