New features for v1.2.0

Several bugfixes including a fix for containers on PMC bots.
This commit is contained in:
VforValens 2022-08-05 18:02:00 -04:00
parent 7a7b375df4
commit 2256ace719
21 changed files with 578 additions and 283 deletions

4
.gitignore vendored
View File

@ -28,4 +28,6 @@ dist
config.json.bk config.json.bk
desktop.ini desktop.ini
*.zip *.zip
*.js *.js
/Valens-AIO/Valens-AIO_*/**/*.*
/Valens-AIO/Valens-AIO_*/*.*

View File

@ -1,155 +0,0 @@
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
c. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
d. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
e. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
f. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
g. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
h. NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
B. produce and reproduce, but not Share, Adapted Material for NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material, You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
For the avoidance of doubt, You do not have permission under this Public License to Share Adapted Material.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only and provided You do not Share Adapted Material;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@ -1,3 +0,0 @@
# Valens-AIO
Valens All In One

View File

@ -39,10 +39,10 @@
"useWeights": false, "useWeights": false,
"weights": "weights":
{ {
"easy": 3, "easy": 20,
"normal": 5, "normal": 58,
"hard": 2, "hard": 15,
"impossible": 1 "impossible": 7
} }
}, },
@ -82,6 +82,217 @@
} }
}, },
"containers":
{
"commonContainers":
{
"enabled": false,
"AMMO_CASE":
{
"width": 2,
"height": 2,
"cellsH": 7,
"cellsV": 7
},
"DOCUMENTS_CASE":
{
"width": 1,
"height": 2,
"cellsH": 4,
"cellsV": 4
},
"DOGTAG_CASE":
{
"width": 1,
"height": 1,
"cellsH": 10,
"cellsV": 10
},
"GRENADE_CASE":
{
"width": 3,
"height": 3,
"cellsH": 8,
"cellsV": 8
},
"INJECTOR_CASE":
{
"width": 1,
"height": 1,
"cellsH": 3,
"cellsV": 3
},
"ITEM_CASE":
{
"width": 4,
"height": 4,
"cellsH": 8,
"cellsV": 8
},
"KEY_TOOL":
{
"width": 1,
"height": 1,
"cellsH": 4,
"cellsV": 4
},
"KEYCARD_HOLDER":
{
"width": 1,
"height": 1,
"cellsH": 3,
"cellsV": 3
},
"SCAV_JUNKBOX":
{
"width": 4,
"height": 4,
"cellsH": 14,
"cellsV": 14
},
"MAGAZINE_CASE":
{
"width": 3,
"height": 2,
"cellsH": 7,
"cellsV": 7
},
"MEDICINE_CASE":
{
"width": 3,
"height": 3,
"cellsH": 7,
"cellsV": 7
},
"MONEY_CASE":
{
"width": 3,
"height": 2,
"cellsH": 7,
"cellsV": 7
},
"HOLODILNICK_THERMAL_BAG":
{
"width": 3,
"height": 3,
"cellsH": 8,
"cellsV": 8
},
"PISTOL_CASE":
{
"width": 2,
"height": 2,
"cellsH": 3,
"cellsV": 4
},
"SICC_ORGANIZATIONAL_POUCH":
{
"width": 2,
"height": 1,
"cellsH": 5,
"cellsV": 5
},
"SIMPLE_WALLET":
{
"width": 1,
"height": 1,
"cellsH": 2,
"cellsV": 2
},
"THICC_ITEM_CASE":
{
"width": 3,
"height": 5,
"cellsH": 14,
"cellsV": 14
},
"THICC_WEAPON_CASE":
{
"width": 5,
"height": 2,
"cellsH": 6,
"cellsV": 15
},
"WEAPON_CASE":
{
"width": 5,
"height": 2,
"cellsH": 5,
"cellsV": 10
},
"WZ_WALLET":
{
"width": 1,
"height": 1,
"cellsH": 2,
"cellsV": 2
}
},
"securedContainers":
{
"enabled": false,
"ALPHA":
{
"width": 2,
"height": 2,
"cellsH": 2,
"cellsV": 2
},
"BETA":
{
"width": 3,
"height": 2,
"cellsH": 3,
"cellsV": 2
},
"EPSILON":
{
"width": 4,
"height": 2,
"cellsH": 4,
"cellsV": 2
},
"GAMMA":
{
"width": 3,
"height": 3,
"cellsH": 3,
"cellsV": 3
},
"KAPPA":
{
"width": 3,
"height": 4,
"cellsH": 3,
"cellsV": 4
}
}
},
"flea": "flea":
{ {
"minUserLevel": 15, "minUserLevel": 15,
@ -134,13 +345,13 @@
"maxLoyaltyTraders": false, "maxLoyaltyTraders": false,
"timeBeforeDeployLocal": 10, "timeBeforeDeployLocal": 10,
"match_end": "matchEnd":
{ {
"survived_exp_requirement": 200, "survivedExpRequirement": 200,
"survived_seconds_requirement": 420, "survivedSecondsRequirement": 420,
"survived_exp_reward": 300, "survivedExpReward": 300,
"mia_exp_reward": 200, "miaExpReward": 200,
"runner_exp_reward": 200, "runnerExpReward": 200,
"leftMult": 0, "leftMult": 0,
"miaMult": 1, "miaMult": 1,
"survivedMult": 1.3, "survivedMult": 1.3,
@ -205,10 +416,10 @@
"examinedByDefault": false, "examinedByDefault": false,
"removeBackpackFilter": true, "removeBackpackFilter": true,
"removeKeyUsageMax": false, "removeKeyUsageMax": false,
"weightModifier": 1,
"roublesMaxStack": 500000,
"dollarsMaxStack": 50000, "dollarsMaxStack": 50000,
"eurosMaxStack": 50000 "eurosMaxStack": 50000,
"roublesMaxStack": 500000,
"weightModifier": 1
}, },
"locations": "locations":
@ -248,5 +459,14 @@
"glukharOnLabs": false, "glukharOnLabs": false,
"killaOnFactory": false, "killaOnFactory": false,
"makeObdolbosPowerful": false "makeObdolbosPowerful": false
},
"weapons":
{
"jam": false,
"misfeed": false,
"misfire": false,
"overheat": false,
"slide": false
} }
} }

View File

@ -3,6 +3,7 @@ export interface Config
DebugMode: boolean DebugMode: boolean
ammo: Ammo ammo: Ammo
bots: Bots bots: Bots
containers: Containers
flea: Flea flea: Flea
globals: Globals globals: Globals
hideout: Hideout hideout: Hideout
@ -12,6 +13,7 @@ export interface Config
loot: Loot loot: Loot
raid: Raid raid: Raid
prewipeEvents: PrewipeEvents prewipeEvents: PrewipeEvents
weapons: Weapons
} }
export interface Ammo export interface Ammo
@ -111,6 +113,55 @@ export interface Scav
lootNValue: number lootNValue: number
} }
export interface Containers
{
commonContainers: CommonContainers
securedContainers: SecuredContainers
}
export interface CommonContainers
{
enabled: boolean
AMMO_CASE: Case
DOCUMENTS_CASE: Case
DOGTAG_CASE: Case
GRENADE_CASE: Case
INJECTOR_CASE: Case
ITEM_CASE: Case
KEY_TOOL: Case
KEYCARD_HOLDER: Case
SCAV_JUNKBOX: Case
MAGAZINE_CASE: Case
MEDICINE_CASE: Case
MONEY_CASE: Case
HOLODILNICK_THERMAL_BAG: Case
PISTOL_CASE: Case
SICC_ORGANIZATIONAL_POUCH: Case
SIMPLE_WALLET: Case
THICC_ITEM_CASE: Case
THICC_WEAPON_CASE: Case
WEAPON_CASE: Case
WZ_WALLET: Case
}
export interface SecuredContainers
{
enabled: boolean
ALPHA: Case
BETA: Case
EPSILON: Case
GAMMA: Case
KAPPA: Case
}
export interface Case
{
width: number
height: number
cellsH: number
cellsV: number
}
export interface Flea export interface Flea
{ {
minUserLevel: number minUserLevel: number
@ -167,16 +218,16 @@ export interface Globals
safeHeight: number safeHeight: number
maxLoyaltyTraders: boolean maxLoyaltyTraders: boolean
timeBeforeDeployLocal: number timeBeforeDeployLocal: number
match_end: MatchEnd matchEnd: MatchEnd
} }
export interface MatchEnd export interface MatchEnd
{ {
survived_exp_requirement: number survivedExpRequirement: number
survived_seconds_requirement: number survivedSecondsRequirement: number
survived_exp_reward: number survivedExpReward: number
mia_exp_reward: number miaExpReward: number
runner_exp_reward: number runnerExpReward: number
leftMult: number leftMult: number
miaMult: number miaMult: number
survivedMult: number survivedMult: number
@ -223,10 +274,10 @@ export interface Items
examinedByDefault: boolean examinedByDefault: boolean
removeBackpackFilter: boolean removeBackpackFilter: boolean
removeKeyUsageMax: boolean removeKeyUsageMax: boolean
weightModifier: number
roublesMaxStack: number
dollarsMaxStack: number dollarsMaxStack: number
eurosMaxStack: number eurosMaxStack: number
roublesMaxStack: number
weightModifier: number
} }
export interface Stash export interface Stash
@ -273,4 +324,13 @@ export interface PrewipeEvents
killaOnFactory: boolean killaOnFactory: boolean
makeObdolbosPowerful: boolean makeObdolbosPowerful: boolean
} }
export interface Weapons
{
jam: boolean
misfeed: boolean
misfire: boolean
overheat: boolean
slide: boolean
}

View File

@ -1,6 +1,6 @@
{ {
"name": "Valens-AIO", "name": "Valens-AIO",
"version": "1.1.2", "version": "1.2.0",
"main": "src/mod.js", "main": "src/mod.js",
"license": "CC BY-NC-ND 4.0", "license": "CC BY-NC-ND 4.0",
"author": "Valens", "author": "Valens",

View File

@ -1,7 +1,7 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger"; import { Logger } from "./logger";
import { Grenade, MarksmanCaliber, PistolCaliber, RifleCaliber, Shotguns } from "./ammotypes"; import { Grenade, MarksmanCaliber, PistolCaliber, RifleCaliber, Shotguns } from "./ammotypes";
import { Config } from "config/config"; import { Config } from "../config/config";
export class Ammo export class Ammo
{ {

View File

@ -108,19 +108,19 @@ export class Bots
this.botConfig.pmc.types.exUsec = mod.pmc.convertIntoPmcChance.exUsec; this.botConfig.pmc.types.exUsec = mod.pmc.convertIntoPmcChance.exUsec;
} }
/*if (mod.pmc.convertIntoPmcChance.assault.min != 15 || mod.pmc.convertIntoPmcChance.assault.max != 40 /*if (mod.pmc.convertIntoPmcChance["assault for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["assault for 3.2.0"].max != 40
|| mod.pmc.convertIntoPmcChance.cursedassault.min != 15 || mod.pmc.convertIntoPmcChance.cursedassault.max != 40 || mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].max != 40
|| mod.pmc.convertIntoPmcChance.pmcbot.min != 15 || mod.pmc.convertIntoPmcChance.pmcbot.max != 30 || mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].max != 30
|| mod.pmc.convertIntoPmcChance.exusec.min != 15 || mod.pmc.convertIntoPmcChance.exusec.max != 20) || mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].min != 15 || mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].max != 20)
{ {
this.botConfig.pmc.convertIntoPmcChance.assault.min = mod.pmc.convertIntoPmcChance.assault.min; this.botConfig.pmc.convertIntoPmcChance.assault.min = mod.pmc.convertIntoPmcChance["assault for 3.2.0"].min;
this.botConfig.pmc.convertIntoPmcChance.assault.max = mod.pmc.convertIntoPmcChance.assault.max; this.botConfig.pmc.convertIntoPmcChance.assault.max = mod.pmc.convertIntoPmcChance["assault for 3.2.0"].max;
this.botConfig.pmc.convertIntoPmcChance.cursedassault.min = mod.pmc.convertIntoPmcChance.cursedassault.min; this.botConfig.pmc.convertIntoPmcChance.cursedassault.min = mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].min;
this.botConfig.pmc.convertIntoPmcChance.cursedassault.max = mod.pmc.convertIntoPmcChance.cursedassault.max; this.botConfig.pmc.convertIntoPmcChance.cursedassault.max = mod.pmc.convertIntoPmcChance["cursedassault for 3.2.0"].max;
this.botConfig.pmc.convertIntoPmcChance.pmcbot.min = mod.pmc.convertIntoPmcChance.pmcbot.min; this.botConfig.pmc.convertIntoPmcChance.pmcbot.min = mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].min;
this.botConfig.pmc.convertIntoPmcChance.pmcbot.max = mod.pmc.convertIntoPmcChance.pmcbot.max; this.botConfig.pmc.convertIntoPmcChance.pmcbot.max = mod.pmc.convertIntoPmcChance["pmcbot for 3.2.0"].max;
this.botConfig.pmc.convertIntoPmcChance.exusec.min = mod.pmc.convertIntoPmcChance.exusec.min; this.botConfig.pmc.convertIntoPmcChance.exusec.min = mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].min;
this.botConfig.pmc.convertIntoPmcChance.exusec.max = mod.pmc.convertIntoPmcChance.exusec.max; this.botConfig.pmc.convertIntoPmcChance.exusec.max = mod.pmc.convertIntoPmcChance["exusec for 3.2.0"].max;
this.logger.info("Chance to Convert Bots into PMC Patched"); this.logger.info("Chance to Convert Bots into PMC Patched");
}*/ }*/
@ -376,15 +376,9 @@ export class Bots
this.logger.info("Make Obdolbos Powerful Prewipe Event Enabled"); this.logger.info("Make Obdolbos Powerful Prewipe Event Enabled");
} }
} }
// 5c0a840b86f7742ffa4f2482 thicc items case
private containersOnPMCs(): void private containersOnPMCs(): void
{ {
const usec = this.tables.bots.types.usec.inventory.items.Backpack;
const bear = this.tables.bots.types.bear.inventory.items.Backpack;
usec.push(...this.containers());
bear.push(...this.containers());
const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist; const dynaLoot = this.botConfig.pmc.dynamicLoot.whitelist;
dynaLoot.push("5448bf274bdc2dfc2f8b456a"); dynaLoot.push("5448bf274bdc2dfc2f8b456a");
@ -424,7 +418,7 @@ export class Bots
* Pistol case: 567143bf4bdc2d1a0f8b4567 * Pistol case: 567143bf4bdc2d1a0f8b4567
* Secure container: 5448bf274bdc2dfc2f8b456a * Secure container: 5448bf274bdc2dfc2f8b456a
* Kappa container: 5c093ca986f7740a1867ab12 * Kappa container: 5c093ca986f7740a1867ab12
* Gamme container: 60b0f6c058e0b0481a09ad11 * Gamma container: 60b0f6c058e0b0481a09ad11
*/ */
const lootItems = ["5d235bb686f77443f4331278","5c127c4486f7745625356c13","59fb023c86f7746d0d4b423c","5b6d9ce188a4501afc1b2b25","59fb042886f7746c5005a7b2","5c0a840b86f7742ffa4f2482", const lootItems = ["5d235bb686f77443f4331278","5c127c4486f7745625356c13","59fb023c86f7746d0d4b423c","5b6d9ce188a4501afc1b2b25","59fb042886f7746c5005a7b2","5c0a840b86f7742ffa4f2482",

View File

@ -0,0 +1,64 @@
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { Config } from "../config/config";
import { CommonContainers, SecuredContainers } from "./containertypes";
export class Containers
{
private modConfig: Config = require("../config/config.json");
private logger: Logger;
private tables: IDatabaseTables;
constructor(logger: Logger, databaseServer: DatabaseServer)
{
this.logger = logger;
this.tables = databaseServer.getTables();
}
public updateContainers(): void
{
const mod = this.modConfig.containers;
if (mod.commonContainers.enabled)
{
this.updatingCommonContainers();
this.logger.info("Common Containers Patched");
}
if (mod.securedContainers.enabled)
{
this.updatingSecuredContainers();
this.logger.info("Secured Containers Patched");
}
}
private updatingCommonContainers()
{
const items = this.tables.templates.items;
const mod = this.modConfig.containers.commonContainers;
for (const [key, value] of Object.entries(CommonContainers))
{
items[value]._props.Grids[0]._props.cellsH = mod[key].cellsH;
items[value]._props.Grids[0]._props.cellsV = mod[key].cellsV;
items[value]._props.Width = mod[key].width;
items[value]._props.Height = mod[key].height;
}
}
private updatingSecuredContainers()
{
const items = this.tables.templates.items;
const mod = this.modConfig.containers.securedContainers;
for (const [key, value] of Object.entries(SecuredContainers))
{
items[value]._props.Grids[0]._props.cellsH = mod[key].cellsH;
items[value]._props.Grids[0]._props.cellsV = mod[key].cellsV;
items[value]._props.Width = mod[key].width;
items[value]._props.Height = mod[key].height;
}
}
}

View File

@ -0,0 +1,32 @@
export enum CommonContainers
{
AMMO_CASE = "5aafbde786f774389d0cbc0f",
DOCUMENTS_CASE = "590c60fc86f77412b13fddcf",
DOGTAG_CASE = "5c093e3486f77430cb02e593",
GRENADE_CASE = "5e2af55f86f7746d4159f07c",
INJECTOR_CASE = "619cbf7d23893217ec30b689",
ITEM_CASE = "59fb042886f7746c5005a7b2",
KEY_TOOL = "59fafd4b86f7745ca07e1232",
KEYCARD_HOLDER = "619cbf9e0a7c3a1a2731940a",
SCAV_JUNKBOX = "5b7c710788a4506dec015957",
MAGAZINE_CASE = "5c127c4486f7745625356c13",
MEDICINE_CASE = "5aafbcd986f7745e590fff23",
MONEY_CASE = "59fb016586f7746d0d4b423a",
HOLODILNICK_THERMAL_BAG = "5c093db286f7740a1b2617e3",
PISTOL_CASE = "567143bf4bdc2d1a0f8b4567",
SICC_ORGANIZATIONAL_POUCH = "5d235bb686f77443f4331278",
SIMPLE_WALLET = "5783c43d2459774bbe137486",
THICC_ITEM_CASE = "5c0a840b86f7742ffa4f2482",
THICC_WEAPON_CASE = "5b6d9ce188a4501afc1b2b25",
WEAPON_CASE = "59fb023c86f7746d0d4b423c",
WZ_WALLET = "60b0f6c058e0b0481a09ad11"
}
export enum SecuredContainers
{
ALPHA = "544a11ac4bdc2d470e8b456a",
BETA = "5857a8b324597729ab0a0e7d",
EPSILON = "59db794186f77448bc595262",
GAMMA = "5857a8bc2459772bad15db29",
KAPPA = "5c093ca986f7740a1867ab12"
}

View File

@ -1,7 +1,7 @@
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig"; import { IRagfairConfig } from "@spt-aki/models/spt/config/IRagfairConfig";
import { Logger } from "./logger"; import { Logger } from "./logger";
import { Config } from "config/config"; import { Config } from "../config/config";
export class Flea export class Flea
{ {

View File

@ -1,5 +1,5 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Logger } from "./logger"; import { Logger } from "./logger";
export class Globals export class Globals
@ -39,27 +39,32 @@ export class Globals
this.logger.info(`Time Before Deploy set to: ${mod.timeBeforeDeployLocal}`); this.logger.info(`Time Before Deploy set to: ${mod.timeBeforeDeployLocal}`);
} }
if (mod.match_end.survived_exp_requirement != 200 || mod.match_end.survived_seconds_requirement != 420 || mod.match_end.survived_exp_reward != 300 if (mod.matchEnd.survivedExpRequirement != 200 || mod.matchEnd.survivedSecondsRequirement != 420 || mod.matchEnd.survivedExpReward != 300
|| mod.match_end.mia_exp_reward != 200 || mod.match_end.runner_exp_reward != 200 || mod.match_end.leftMult != 0 || mod.matchEnd.miaExpReward != 200 || mod.matchEnd.runnerExpReward != 200 || mod.matchEnd.leftMult != 0
|| mod.match_end.miaMult != 1 || mod.match_end.survivedMult != 1.3 || mod.match_end.runnerMult != 0.5 || mod.matchEnd.miaMult != 1 || mod.matchEnd.survivedMult != 1.3 || mod.matchEnd.runnerMult != 0.5
|| mod.match_end.killedMult != 1 || mod.match_end.headShotMult != 1.2 || mod.match_end.expOnDamageAllHealth != 50) || mod.matchEnd.killedMult != 1 || mod.matchEnd.headShotMult != 1.2 || mod.matchEnd.expOnDamageAllHealth != 50)
{ {
const global1 = this.databaseServer.getTables().globals.config.exp.match_end; this.matchEndSettings();
const mod = this.modConfig.globals.match_end;
global1.survived_exp_requirement = mod.survived_exp_requirement;
global1.survived_seconds_requirement = mod.survived_seconds_requirement;
global1.survived_exp_reward = mod.survived_exp_reward;
global1.mia_exp_reward = mod.mia_exp_reward;
global1.runner_exp_reward = mod.runner_exp_reward;
global1.leftMult = mod.leftMult;
global1.miaMult = mod.miaMult;
global1.survivedMult = mod.survivedMult;
global1.runnerMult = mod.runnerMult;
global1.killedMult = mod.killedMult;
this.databaseServer.getTables().globals.config.exp.kill.headShotMult = mod.headShotMult;
this.databaseServer.getTables().globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth;
this.logger.info("Match End Globals Patched");
} }
} }
private matchEndSettings(): void
{
const global1 = this.databaseServer.getTables().globals.config.exp.match_end;
const mod = this.modConfig.globals.matchEnd;
global1.survived_exp_requirement = mod.survivedExpRequirement;
global1.survived_seconds_requirement = mod.survivedSecondsRequirement;
global1.survived_exp_reward = mod.survivedExpReward;
global1.mia_exp_reward = mod.miaExpReward;
global1.runner_exp_reward = mod.runnerExpReward;
global1.leftMult = mod.leftMult;
global1.miaMult = mod.miaMult;
global1.survivedMult = mod.survivedMult;
global1.runnerMult = mod.runnerMult;
global1.killedMult = mod.killedMult;
this.databaseServer.getTables().globals.config.exp.kill.headShotMult = mod.headShotMult;
this.databaseServer.getTables().globals.config.exp.kill.expOnDamageAllHealth = mod.expOnDamageAllHealth;
this.logger.info("Match End Settings Patched");
}
} }

View File

@ -1,6 +1,6 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger"; import { Logger } from "./logger";
import { Config } from "./config/config"; import { Config } from "../config/config";
export class Hideout export class Hideout
{ {

View File

@ -1,5 +1,5 @@
import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig"; import { IInsuranceConfig } from "@spt-aki/models/spt/config/IInsuranceConfig";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Logger } from "./logger"; import { Logger } from "./logger";
export class Insurance export class Insurance

View File

@ -1,5 +1,5 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Logger } from "./logger"; import { Logger } from "./logger";
export class Items export class Items
@ -7,8 +7,8 @@ export class Items
private modConfig: Config = require("../config/config.json") private modConfig: Config = require("../config/config.json")
private logger: Logger; private logger: Logger;
private tables: DatabaseServer; private tables: DatabaseServer;
private wtf; private mod: any;
private items; private items: any;
constructor(logger: Logger, databaseServer: DatabaseServer) constructor(logger: Logger, databaseServer: DatabaseServer)
{ {
@ -20,91 +20,91 @@ export class Items
{ {
this.items = this.tables.getTables().templates.items; this.items = this.tables.getTables().templates.items;
this.wtf = this.modConfig.items; this.mod = this.modConfig.items;
if (this.wtf.removeKeyUsageMax) if (this.mod.removeKeyUsageMax)
{ {
this.removeKeyUsageMax(); this.removeKeyUsageMax();
this.logger.info("Key Usage Limit Removed"); this.logger.info("Key Usage Limit Removed");
} }
// Weight Modifier. Multiplier of Weight *= modConfig.weightModifier // Weight Modifier. Multiplier of Weight *= modConfig.weightModifier
if (this.wtf.weightModifier != 1) if (this.mod.weightModifier != 1)
{ {
this.updateWeight(); this.updateWeight();
this.logger.info(`Weight Multipler patched to ${this.wtf.weightModifier}`); this.logger.info(`Weight Multipler patched to ${this.mod.weightModifier}`);
} }
// Removes the ExcludedFilter on Backpacks // Removes the ExcludedFilter on Backpacks
// which in turn enables common containers to spawn in the loot pool of AI. // which in turn enables common containers to spawn in the loot pool of AI.
if (this.wtf.removeBackpackFilter) if (this.mod.removeBackpackFilter)
{ {
this.updateBackpacks(); this.updateBackpacks();
this.logger.info(`Backpack Restrictions Removed: ${this.wtf.removeBackpackFilter}`) this.logger.info(`Backpack Restrictions Removed: ${this.mod.removeBackpackFilter}`)
} }
// Standard Stash Size Changes // Standard Stash Size Changes
if (this.wtf.standardStash.vertical != 28 || this.wtf.standardStash.horizontal != 10) if (this.mod.standardStash.vertical != 28 || this.mod.standardStash.horizontal != 10)
{ {
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsV = this.wtf.standardStash.vertical; this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsV = this.mod.standardStash.vertical;
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsH = this.wtf.standardStash.horizontal; this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsH = this.mod.standardStash.horizontal;
this.logger.info(`Standard Stash Vertical changed to ${this.wtf.standardStash.vertical}`); this.logger.info(`Standard Stash Vertical changed to ${this.mod.standardStash.vertical}`);
this.logger.info(`Standard Stash Horizontal changed to ${this.wtf.standardStash.horizontal}`); this.logger.info(`Standard Stash Horizontal changed to ${this.mod.standardStash.horizontal}`);
} }
// Left Behind Stash Size Changes // Left Behind Stash Size Changes
if (this.wtf.behindStash.vertical != 38 || this.wtf.behindStash.horizontal != 10) if (this.mod.behindStash.vertical != 38 || this.mod.behindStash.horizontal != 10)
{ {
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsV = this.wtf.behindStash.vertical; this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsV = this.mod.behindStash.vertical;
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsH = this.wtf.behindStash.horizontal; this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsH = this.mod.behindStash.horizontal;
this.logger.info(`Left Behind Stash Vertical changed to ${this.wtf.behindStash.vertical}`); this.logger.info(`Left Behind Stash Vertical changed to ${this.mod.behindStash.vertical}`);
this.logger.info(`Left Behind Stash Horizontal changed to ${this.wtf.behindStash.horizontal}`); this.logger.info(`Left Behind Stash Horizontal changed to ${this.mod.behindStash.horizontal}`);
} }
// Prepare for Escape Stash Size Changes // Prepare for Escape Stash Size Changes
if (this.wtf.escapeStash.vertical != 48 || this.wtf.escapeStash.horizontal != 10) if (this.mod.escapeStash.vertical != 48 || this.mod.escapeStash.horizontal != 10)
{ {
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsV = this.wtf.escapeStash.vertical; this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsV = this.mod.escapeStash.vertical;
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsH = this.wtf.escapeStash.horizontal; this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsH = this.mod.escapeStash.horizontal;
this.logger.info(`Prepare for Escape Stash Vertical changed to ${this.wtf.escapeStash.vertical}`); this.logger.info(`Prepare for Escape Stash Vertical changed to ${this.mod.escapeStash.vertical}`);
this.logger.info(`Prepare for Escape Stash Horizontal changed to ${this.wtf.escapeStash.horizontal}`); this.logger.info(`Prepare for Escape Stash Horizontal changed to ${this.mod.escapeStash.horizontal}`);
} }
// Edge of Darkness Stash Size Changes // Edge of Darkness Stash Size Changes
if (this.wtf.eodStash.vertical != 68 || this.wtf.eodStash.horizontal != 10) if (this.mod.eodStash.vertical != 68 || this.mod.eodStash.horizontal != 10)
{ {
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsV = this.wtf.eodStash.vertical; this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsV = this.mod.eodStash.vertical;
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsH = this.wtf.eodStash.horizontal; this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsH = this.mod.eodStash.horizontal;
this.logger.info(`Edge of Darkness Stash Vertical changed to ${this.wtf.eodStash.vertical}`); this.logger.info(`Edge of Darkness Stash Vertical changed to ${this.mod.eodStash.vertical}`);
this.logger.info(`Edge of Darkness Stash Horizontal changed to ${this.wtf.eodStash.horizontal}`); this.logger.info(`Edge of Darkness Stash Horizontal changed to ${this.mod.eodStash.horizontal}`);
} }
// Toggles true/false the Examined By Default config on all items in database/templates/items.json // Toggles true/false the Examined By Default config on all items in database/templates/items.json
if (this.wtf.examinedByDefault) if (this.mod.examinedByDefault)
{ {
this.examinedByDefault(); this.examinedByDefault();
this.logger.info(`Examined By Default is ${this.wtf.examinedByDefault}`); this.logger.info(`Examined By Default is ${this.mod.examinedByDefault}`);
} }
// Roubles Max Stack // Roubles Max Stack
if (this.wtf.roublesMaxStack != 500000) if (this.mod.roublesMaxStack != 500000)
{ {
this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.wtf.roublesMaxStack; this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.mod.roublesMaxStack;
this.logger.info(`Rouble Max Stack set to ${this.wtf.roublesMaxStack}`); this.logger.info(`Rouble Max Stack set to ${this.mod.roublesMaxStack}`);
} }
// Dollars Max Stack // Dollars Max Stack
if (this.wtf.dollarsMaxStack != 50000) if (this.mod.dollarsMaxStack != 50000)
{ {
this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.wtf.dollarsMaxStack; this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.mod.dollarsMaxStack;
this.logger.info(`Dollar Max Stack set to ${this.wtf.dollarsMaxStack}`); this.logger.info(`Dollar Max Stack set to ${this.mod.dollarsMaxStack}`);
} }
// Euros Max Stack // Euros Max Stack
if (this.wtf.eurosMaxStack != 50000) if (this.mod.eurosMaxStack != 50000)
{ {
this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.wtf.eurosMaxStack; this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.mod.eurosMaxStack;
this.logger.info(`Euro Max Stack set to ${this.wtf.eurosMaxStack}`); this.logger.info(`Euro Max Stack set to ${this.mod.eurosMaxStack}`);
} }
} }
@ -118,7 +118,7 @@ export class Items
{ {
if (this.items[item]._props?.Weight) if (this.items[item]._props?.Weight)
{ {
this.items[item]._props.Weight *= this.wtf.weightModifier; this.items[item]._props.Weight *= this.mod.weightModifier;
} }
} }
} }
@ -126,30 +126,30 @@ export class Items
// Updates backpacks and removes any values in the ExcludedFilter under props > Grids > props > filters > ExcludedFilter in database/templates/items.json // Updates backpacks and removes any values in the ExcludedFilter under props > Grids > props > filters > ExcludedFilter in database/templates/items.json
private updateBackpacks(): void private updateBackpacks(): void
{ {
const items = Object.values(this.tables.getTables().templates.items).filter(x=>x._parent === "5448e53e4bdc2d60728b4567"); for (const item in this.items)
for (const item of items)
{ {
for (const grid of item._props.Grids) if (this.items[item]._parent === "5448e53e4bdc2d60728b4567")
grid._props.filters[0].ExcludedFilter = []; {
this.items[item]._props.Grids[0]._props.filters[0].ExcludedFilter = [];
}
} }
} }
// Updates the Examined By Default modifier for all items in database/templates/items.json to either True or False depending on the config value. // Updates the Examined By Default modifier for all items in database/templates/items.json to either True or False depending on the config value.
private examinedByDefault(): void private examinedByDefault(): void
{ {
const items = Object.values(this.tables.getTables().templates.items); for (const item in this.items)
for (const item of items)
{ {
item._props.ExaminedByDefault = this.wtf.examinedByDefault; this.items[item]._props.ExaminedByDefault = this.mod.examinedByDefault;
} }
} }
private removeKeyUsageMax(): void private removeKeyUsageMax(): void
{ {
const keys = Object.values(this.tables.getTables().templates.items).filter(x=>x._parent === "543be5e94bdc2df1348b4568"); const keys = this.items.filter(x=>x._parent === "543be5e94bdc2df1348b4568");
for (const key of keys) for (const key in keys)
{ {
key._props.MaximumNumberOfUsage = 0; keys[key]._props.MaximumNumberOfUsage = 0;
} }
} }
} }

View File

@ -1,6 +1,6 @@
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Logger } from "./logger"; import { Logger } from "./logger";
export class Locations export class Locations

View File

@ -1,5 +1,5 @@
import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { Config } from "config/config"; import { Config } from "../config/config";
export class Logger export class Logger
{ {

View File

@ -1,7 +1,7 @@
import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig";
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Logger } from "./logger"; import { Logger } from "./logger";
export class Loot export class Loot

View File

@ -22,7 +22,9 @@ import { Raid } from "./raid";
import { Globals } from "./globals"; import { Globals } from "./globals";
import { Insurance } from "./insurance"; import { Insurance } from "./insurance";
import { Logger } from "./logger"; import { Logger } from "./logger";
import { Config } from "config/config"; import { Config } from "../config/config";
import { Weapons } from "./weapons";
import { Containers } from "./containers";
//import { Airdrop } from "./airdrop"; //import { Airdrop } from "./airdrop";
class ValensAIO implements IPostDBLoadMod class ValensAIO implements IPostDBLoadMod
@ -64,6 +66,9 @@ class ValensAIO implements IPostDBLoadMod
const bots = new Bots(vLogger, this.databaseServer, this.botConfig, this.weightedRandomHelper); const bots = new Bots(vLogger, this.databaseServer, this.botConfig, this.weightedRandomHelper);
bots.updateBots(); bots.updateBots();
const containers = new Containers(vLogger, this.databaseServer);
containers.updateContainers();
const flea = new Flea(vLogger, this.ragfairConfig, this.tables); const flea = new Flea(vLogger, this.ragfairConfig, this.tables);
flea.updateFlea(); flea.updateFlea();
@ -85,6 +90,9 @@ class ValensAIO implements IPostDBLoadMod
const raid = new Raid(vLogger, this.databaseServer, this.inRaidConfig); const raid = new Raid(vLogger, this.databaseServer, this.inRaidConfig);
raid.updateRaid(); raid.updateRaid();
const weapons = new Weapons(vLogger, this.databaseServer);
weapons.updateWeapons();
} }
} }

View File

@ -2,7 +2,7 @@ import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig"; import { IInRaidConfig } from "@spt-aki/models/spt/config/IInRaidConfig";
import { Logger } from "./logger"; import { Logger } from "./logger";
import { Config } from "config/config"; import { Config } from "../config/config";
export class Raid export class Raid
{ {
@ -18,7 +18,7 @@ export class Raid
this.inRaidConfig = inRaidConfig; this.inRaidConfig = inRaidConfig;
} }
updateRaid(): void public updateRaid(): void
{ {
const mod = this.modConfig.raid; const mod = this.modConfig.raid;

68
Valens-AIO/src/weapons.ts Normal file
View File

@ -0,0 +1,68 @@
import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Config } from "../config/config";
import { Logger } from "./logger";
export class Weapons
{
private modConfig: Config = require("../config/config.json")
private logger: Logger;
private tables: IDatabaseTables;
private mod: any;
private weapons: any;
constructor(logger:Logger, databaseServer: DatabaseServer)
{
this.logger = logger;
this.tables = databaseServer.getTables();
}
public updateWeapons(): void
{
this.mod = this.modConfig.weapons;
if (this.mod.overheat || this.mod.jam || this.mod.slide || this.mod.misfeed || this.mod.misfire)
{
this.weaponMalfunctions();
this.logger.info("Weapon Malfunctions Patched", true);
}
}
private weaponMalfunctions(): void
{
const items = this.tables.templates.items;
for (const id in items)
{
const base = items[id];
//Weapons malfunctions
if (this.mod.jam && base._props.AllowJam)
{
base._props.AllowJam = false;
}
if (this.mod.misfire && base._props.AllowMisfire)
{
base._props.AllowMisfire = false;
}
if (this.mod.feed && base._props.AllowFeed)
{
base._props.AllowFeed = false;
}
if (this.mod.overheat && base._props.AllowOverheat)
{
base._props.AllowOverheat = false;
}
if (this.mod.slide && base._props.AllowSlide)
{
base._props.AllowSlide = false;
}
}
}
}