RemoveScavKarma option rework
This commit is contained in:
parent
16d648b6d3
commit
dcaf58b17f
@ -97,7 +97,16 @@ class PlayerModifications {
|
||||
|
||||
//PreventScavKarma
|
||||
if (config.player.RemoveScavKarma == true) {
|
||||
ProfileController.generateScav = this.generateScav
|
||||
const database = DatabaseServer.tables;
|
||||
const types = database.bots.types
|
||||
for(const bots in types){
|
||||
if(types[bot].experience.standingForKill < 0 && types[bot].experience.standingForKill > 0){
|
||||
types[bot].experience.standingForKill = 0
|
||||
}
|
||||
if(types[bot].experience.aggressorBonus < 0 && types[bot].experience.aggressorBonus > 0){
|
||||
types[bot].experience.aggressorBonus = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function maxSkills(url, info, sessionID) {
|
||||
@ -109,7 +118,7 @@ class PlayerModifications {
|
||||
}
|
||||
|
||||
if (pmcData !== null) {
|
||||
if (pmcData.Skills.Common.length > 0 && pmcData.Skills.Common !== undefined) {
|
||||
if ( pmcData.Skills.Common !== undefined > 0 && pmcData.Skills.Common.length) {
|
||||
for (let skills in pmcData.Skills.Common) {
|
||||
let skill = pmcData.Skills.Common[skills]
|
||||
switch (skill.Id) {
|
||||
@ -140,37 +149,6 @@ class PlayerModifications {
|
||||
HttpRouter.onStaticRoute["/client/game/version/validate"]["aioMod"] = maxSkills.bind(this)
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
Loading…
x
Reference in New Issue
Block a user