diff --git a/ZEreshkigal-AllinOneMod/src/player.js b/ZEreshkigal-AllinOneMod/src/player.js index 218727b..5ccac44 100644 --- a/ZEreshkigal-AllinOneMod/src/player.js +++ b/ZEreshkigal-AllinOneMod/src/player.js @@ -37,19 +37,17 @@ class PlayerModifications { } //Remove fall damages - if(config.player.DisableFallDamage === true){ + if (config.player.DisableFallDamage === true) { globals.Health.Falling.SafeHeight = 200 globals.Health.Falling.DamagePerMeter = 0 } - //PreventScavKarma - //Change staminas (unlimited or no) if (typeof config.player.ChangeMaxStamina == "number" && config.player.UnlimitedStamina === false) { globals.Stamina.Capacity = config.player.ChangeMaxStamina } else if (config.player.ChangeMaxStamina === false && config.player.UnlimitedStamina === true) { globals.Stamina.Capacity = 500, - globals.Stamina.BaseRestorationRate = 500; + globals.Stamina.BaseRestorationRate = 500; globals.Stamina.StaminaExhaustionCausesJiggle = false; globals.Stamina.StaminaExhaustionStartsBreathSound = false; globals.Stamina.StaminaExhaustionRocksCamera = false; @@ -77,14 +75,20 @@ class PlayerModifications { } + + //PreventScavKarma + if (config.player.RemoveScavKarma == true) { + ProfileController.generateScav = this.generateScav + } + function maxSkills(url, info, sessionID) { const config = require("../config/config.json") let pmcData = null - + if (sessionID) { pmcData = ProfileController.getPmcProfile(sessionID); } - + if (pmcData !== null) { if (pmcData.Skills.Common.length > 0 && pmcData.Skills.Common !== undefined) { for (let skills in pmcData.Skills.Common) { @@ -118,7 +122,36 @@ class PlayerModifications { } } - + static generateScav(sessionID) { + const pmcData = ProfileController.getPmcProfile(sessionID); + let scavData = BotController.generate({ + "conditions": [{ + "Role": "playerScav", + "Limit": 1, + "Difficulty": "normal" + }] + })[0]; + + // add proper metadata + scavData._id = pmcData.savage; + scavData.aid = sessionID; + scavData.Info.Settings = { + "StandingForKill": 0, + "AggressorBonus": 0 + }; + + // remove secure container + scavData = InventoryHelper.removeSecureContainer(scavData); + + // set cooldown timer + scavData = ProfileController.setScavCooldownTimer(scavData, pmcData); + + // add scav to the profile + ProfileController.setScavProfile(sessionID, scavData); + return scavData; + } + + } module.exports = PlayerModifications; \ No newline at end of file