Fixed LvlUp trader for 12.11
This commit is contained in:
parent
6525502547
commit
8f18662fd1
@ -83,13 +83,13 @@ class TradersModifications {
|
|||||||
if(config.other["Pre-Wipe events"]["All traders sells cheap items"] === true){
|
if(config.other["Pre-Wipe events"]["All traders sells cheap items"] === true){
|
||||||
for(const trader in traders){
|
for(const trader in traders){
|
||||||
for(const assort in traders[trader].assort.barter_scheme){
|
for(const assort in traders[trader].assort.barter_scheme){
|
||||||
let itemScheme = traders[trader].assort.barter_scheme[assort]
|
let itemScheme = traders[trader].assort.barter_scheme[assort];
|
||||||
if(itemScheme[0][0]._tpl === "5449016a4bdc2d6f028b456f"){ //Roubles
|
if(itemScheme[0][0]._tpl === "5449016a4bdc2d6f028b456f"){ //Roubles
|
||||||
itemScheme[0][0].count = itemScheme[0][0].count * 0.01
|
itemScheme[0][0].count = itemScheme[0][0].count * 0.01;
|
||||||
}else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //Dollars
|
}else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //Dollars
|
||||||
itemScheme[0][0].count = itemScheme[0][0].count * 0.1
|
itemScheme[0][0].count = itemScheme[0][0].count * 0.1;
|
||||||
}else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //euros
|
}else if(itemScheme[0][0]._tpl === "5696686a4bdc2da3298b456a"){ //euros
|
||||||
itemScheme[0][0].count = itemScheme[0][0].count * 0.05
|
itemScheme[0][0].count = itemScheme[0][0].count * 0.05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,49 +102,50 @@ class TradersModifications {
|
|||||||
|
|
||||||
if (config.traders.InsuranceTime.Prapor.activated === true) {
|
if (config.traders.InsuranceTime.Prapor.activated === true) {
|
||||||
Logger.info("AllinOne Mod: Prapor insurance changed");
|
Logger.info("AllinOne Mod: Prapor insurance changed");
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.min_return_hour = config.traders.InsuranceTime.Prapor.min
|
traders["54cb50c76803fa8b248b4571"].base.insurance.min_return_hour = config.traders.InsuranceTime.Prapor.min;
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.max_return_hour = config.traders.InsuranceTime.Prapor.max
|
traders["54cb50c76803fa8b248b4571"].base.insurance.max_return_hour = config.traders.InsuranceTime.Prapor.max;
|
||||||
}
|
}
|
||||||
if (config.traders.InsuranceTime.Therapist.activated === true) {
|
if (config.traders.InsuranceTime.Therapist.activated === true) {
|
||||||
Logger.info("AllinOne Mod: Therapist insurance changed");
|
Logger.info("AllinOne Mod: Therapist insurance changed");
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.min_return_hour = config.traders.InsuranceTime.Therapist.min
|
traders["54cb57776803fa99248b456e"].base.insurance.min_return_hour = config.traders.InsuranceTime.Therapist.min;
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.max_return_hour = config.traders.InsuranceTime.Therapist.max
|
traders["54cb57776803fa99248b456e"].base.insurance.max_return_hour = config.traders.InsuranceTime.Therapist.max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Change the maximum time for insurance to be in mails
|
//Change the maximum time for insurance to be in mails
|
||||||
if (config.traders.MaxInsuranceStorageTime !== false) {
|
if (config.traders.MaxInsuranceStorageTime !== false) {
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.max_storage_time = config.traders.MaxInsuranceStorageTime
|
traders["54cb50c76803fa8b248b4571"].base.insurance.max_storage_time = config.traders.MaxInsuranceStorageTime;
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.max_storage_time = config.traders.MaxInsuranceStorageTime
|
traders["54cb57776803fa99248b456e"].base.insurance.max_storage_time = config.traders.MaxInsuranceStorageTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lvlUp(traderID, sessionID) {
|
function lvlUp(traderID, sessionID) {
|
||||||
if (config.traders.PreventFenceMastering === true) {
|
if (config.traders.PreventFenceMastering === true) {
|
||||||
Logger.error("AIOMod : PreventFenceMastering isn't available yet, it's for 12.11 so disable it :)")
|
|
||||||
/*
|
|
||||||
if (traderID === "579dc571d53a0658a154fbec") {}
|
if (traderID === "579dc571d53a0658a154fbec") {}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
let pmcData = ProfileController.getPmcProfile(sessionID);
|
let pmcData = ProfileController.getPmcProfile(sessionID);
|
||||||
let loyaltyLevels = DatabaseServer.tables.traders[traderID].base.loyalty.loyaltyLevels;
|
|
||||||
|
|
||||||
// level up player
|
// level up player
|
||||||
pmcData.Info.Level = PlayerController.calculateLevel(pmcData);
|
pmcData.Info.Level = PlayerController.calculateLevel(pmcData);
|
||||||
|
|
||||||
|
pmcData.TradersInfo[traderID].loyaltyLevel = 4;
|
||||||
|
pmcData.TradersInfo[traderID].unlocked = true;
|
||||||
|
|
||||||
for (let level in loyaltyLevels) {
|
|
||||||
loyaltyLevels[level].minLevel = 1
|
|
||||||
loyaltyLevels[level].minSalesSum = 0
|
|
||||||
loyaltyLevels[level].minStanding = 0
|
|
||||||
pmcData.TraderStandings[traderID].currentLevel = 4;
|
|
||||||
DatabaseServer.tables.traders[traderID].base.loyalty.currentLevel = 4;
|
|
||||||
pmcData.TraderStandings[traderID].display = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Enable all traders 4 stars
|
//Enable all traders 4 stars
|
||||||
if (config.traders.AllTraders4Stars === true) {
|
if (config.traders.AllTraders4Stars === true) {
|
||||||
TraderController.lvlUp = lvlUp
|
TraderController.lvlUp = lvlUp;
|
||||||
|
for (const traderID in DatabaseServer.tables.traders) {
|
||||||
|
if (config.traders.PreventFenceMastering === true) {
|
||||||
|
if (traderID === "579dc571d53a0658a154fbec") {continue;};
|
||||||
|
}
|
||||||
|
const loyaltyLevels = DatabaseServer.tables.traders[traderID].base.loyaltyLevels[0];
|
||||||
|
|
||||||
|
for (const LL in loyaltyLevels) {
|
||||||
|
loyaltyLevels.minLevel = 0;
|
||||||
|
loyaltyLevels.minSalesSum = 0;
|
||||||
|
loyaltyLevels.minStanding = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user