Archived
399 lines
12 KiB
TypeScript
399 lines
12 KiB
TypeScript
/* eslint-disable no-mixed-spaces-and-tabs */
|
|||
|
|
/* eslint-disable @typescript-eslint/indent */
|
||
|
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||
|
|
import { DependencyContainer } from "tsyringe";
|
||
|
|
import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
|
||
|
|
import { CustomItemService } from "@spt/services/mod/CustomItemService";
|
||
|
|
import { NewItemFromCloneDetails } from "@spt/models/spt/mod/NewItemDetails";
|
||
|
|
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||
|
|
import { ILocation } from "@spt/models/eft/common/ILocation";
|
||
|
|
|
||
|
|
import preset_file from "../src/Item_Preset.json";
|
||
|
|
import global_preset_file from "../src/global_item_preset.json";
|
||
|
|
//import spawnPoints from "../src/loot/Spawns.json";
|
||
|
|
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||
|
|
import { Traders } from "@spt/models/enums/Traders";
|
||
|
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||
|
|
import { IHideoutConfig, ICultistCircleSettings, IDirectRewardSettings } from "@spt/models/spt/config/IHideoutConfig"
|
||
|
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||
|
|
|
||
|
|
export enum WeaponIds
|
||
|
|
{
|
||
|
|
CHLK = "6745d112eb0900ac53e5f356",
|
||
|
|
CHLK_MAG = "6745d11b2fe0e0c66e2ac8e9",
|
||
|
|
CHLK_SIGHT = "6745f1c80545a067a6838681"
|
||
|
|
}
|
||
|
|
|
||
|
|
export enum HandbookTPL
|
||
|
|
{
|
||
|
|
SHOTGUN = "5b5f794b86f77409407a7f92",
|
||
|
|
ASSAULT_RIFLE = "5b5f78fc86f77409407a7f90",
|
||
|
|
PISTOL= "5b5f792486f77447ed5636b3",
|
||
|
|
CARBINE= "5b5f78e986f77447ed5636b1",
|
||
|
|
MARKSMAN= "5b5f791486f774093f2ed3be",
|
||
|
|
SMG= "5b5f796a86f774093f2ed3c0"
|
||
|
|
}
|
||
|
|
|
||
|
|
class Mod implements IPostDBLoadMod
|
||
|
|
{
|
||
|
|
public postDBLoad(container: DependencyContainer): void {
|
||
|
|
const customitem = container.resolve<CustomItemService>("CustomItemService");
|
||
|
|
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");
|
||
|
|
const db = databaseServer.getTables();
|
||
|
|
const globals = db.globals;
|
||
|
|
const configServer = container.resolve<ConfigServer>("ConfigServer");
|
||
|
|
const productionConfig: IHideoutConfig = configServer.getConfig<IHideoutConfig>(ConfigTypes.HIDEOUT);
|
||
|
|
|
||
|
|
const PK = db.traders[Traders.PEACEKEEPER].assort;
|
||
|
|
const SKR = db.traders[Traders.SKIER].assort;
|
||
|
|
// WEAPON LISTING AND ATTACHMENT
|
||
|
|
|
||
|
|
const china_Lake: NewItemFromCloneDetails = {
|
||
|
|
itemTplToClone: ItemTpl.SHOTGUN_REMINGTON_MODEL_870_12GA_PUMPACTION,
|
||
|
|
overrideProperties: {
|
||
|
|
Prefab: {
|
||
|
|
path: "china lake/weapon_china_lake_container.bundle",
|
||
|
|
rcid: ""
|
||
|
|
},
|
||
|
|
AimPlane: 0.24,
|
||
|
|
Name: "weapon_china_lake_gl",
|
||
|
|
ShortName: "weapon_china_lake_gl",
|
||
|
|
Description: "weapon_china_lake_gl",
|
||
|
|
CenterOfImpact: 0.15,
|
||
|
|
ReloadMode: "InternalMagazine",
|
||
|
|
Width: 6,
|
||
|
|
Height: 2,
|
||
|
|
Ergonomics: 64,
|
||
|
|
CanSellOnRagfair: false,
|
||
|
|
CanRequireOnRagfair: true,
|
||
|
|
ExaminedByDefault: false,
|
||
|
|
ExamineExperience: 20,
|
||
|
|
SightingRange: 100,
|
||
|
|
IronSightRange: 50,
|
||
|
|
LootExperience: 15,
|
||
|
|
RecoilAngle: 94,
|
||
|
|
RecoilCenter:
|
||
|
|
{
|
||
|
|
x: 0,
|
||
|
|
y: -0.274,
|
||
|
|
z: 0
|
||
|
|
},
|
||
|
|
RecoilForceUp: 563,
|
||
|
|
RecoilForceBack: 311,
|
||
|
|
RecoilPosZMult: 0.7,
|
||
|
|
RecoilCamera: 0.04,
|
||
|
|
RecoilReturnPathDampingHandRotation: 0.62,
|
||
|
|
RecoilReturnSpeedHandRotation: 3.75,
|
||
|
|
RecoilDampingHandRotation: 0.76,
|
||
|
|
CameraToWeaponAngleStep: 0.2,
|
||
|
|
CameraSnap: 3.2,
|
||
|
|
CompactHandling: false,
|
||
|
|
RotationCenter:
|
||
|
|
{
|
||
|
|
x: 0,
|
||
|
|
y: 0.153,
|
||
|
|
z: -0.075
|
||
|
|
},
|
||
|
|
RotationCenterNoStock:
|
||
|
|
{
|
||
|
|
x: 0,
|
||
|
|
y: -0.188,
|
||
|
|
z: -0.018
|
||
|
|
},
|
||
|
|
Chambers: [
|
||
|
|
{
|
||
|
|
"_name": "patron_in_weapon",
|
||
|
|
"_id": "6745e12fa75bd8d525b95d43",
|
||
|
|
"_parent": WeaponIds.CHLK,
|
||
|
|
"_props": {
|
||
|
|
"filters": [
|
||
|
|
{
|
||
|
|
"Filter": [
|
||
|
|
"5ede474b0c226a66f5402622",
|
||
|
|
"5ede475b549eed7c6d5c18fb",
|
||
|
|
"5ede4739e0350d05467f73e8",
|
||
|
|
"5f0c892565703e5c461894e9",
|
||
|
|
"5ede47405b097655935d7d16",
|
||
|
|
"5ede475339ee016e8c534742",
|
||
|
|
"5ede47641cf3836a88318df1"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"_required": false,
|
||
|
|
"_mergeSlotWithChildren": false,
|
||
|
|
"_proto": "55d4af244bdc2d962f8b4571"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
Slots: [
|
||
|
|
{
|
||
|
|
_id: "6745d38f0ea1dc7da36a9c6d",
|
||
|
|
"_mergeSlotWithChildren": false,
|
||
|
|
"_name": "mod_magazine",
|
||
|
|
"_parent": WeaponIds.CHLK,
|
||
|
|
"_props": {
|
||
|
|
"filters": [
|
||
|
|
{
|
||
|
|
"AnimationIndex": 0,
|
||
|
|
"Filter": [
|
||
|
|
WeaponIds.CHLK_MAG
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"_proto": "55d30c394bdc2dae468b4577",
|
||
|
|
"_required": true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"_name": "mod_scope",
|
||
|
|
"_id": "6284bf82efa4bf770d31ea5f",
|
||
|
|
"_parent": WeaponIds.CHLK,
|
||
|
|
"_props": {
|
||
|
|
"filters": [
|
||
|
|
{
|
||
|
|
"Shift": 0,
|
||
|
|
"Filter": [
|
||
|
|
WeaponIds.CHLK_SIGHT
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"_required": false,
|
||
|
|
"_mergeSlotWithChildren": false,
|
||
|
|
"_proto": "55d30c4c4bdc2db4468b457e"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
Weight: 3.72,
|
||
|
|
ammoCaliber: "Caliber40x46",
|
||
|
|
defAmmo: "5ede474b0c226a66f5402622",
|
||
|
|
defMagType: WeaponIds.CHLK_MAG,
|
||
|
|
durabSpawnMax: 100,
|
||
|
|
durabSpawnMin: 35,
|
||
|
|
AllowFeed: false,
|
||
|
|
AllowJam: false,
|
||
|
|
AllowMisfire: false,
|
||
|
|
AllowSlide: false,
|
||
|
|
AllowOverheat: false
|
||
|
|
},
|
||
|
|
parentId: "5447b6094bdc2dc3278b4567",
|
||
|
|
newId: WeaponIds.CHLK,
|
||
|
|
handbookParentId: "5b5f79eb86f77447ed5636b7",
|
||
|
|
handbookPriceRoubles: 268334,
|
||
|
|
fleaPriceRoubles: 388421,
|
||
|
|
locales: {
|
||
|
|
"en": {
|
||
|
|
name: "China Lake \"NATIC\" Pump-action 40mm Grenade Launcher",
|
||
|
|
shortName: "China Lake",
|
||
|
|
description: "A pump-action grenade launcher designed in the 1967. A rare prized commodity that only few existed, can be loaded up to 3 rounds (4 including in the chamber). The China Lake NATIC designation is also erroneous as the weapon was never known by that designation. Since it was made on an ad hoc basis for special operations forces, it was not formally adopted and has no official military designation. Thus the SEALs referred to the experimental weapon as the \"China Lake grenade launcher\" in reference to the facility which produced it."
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
customitem.createItemFromClone(china_Lake);
|
||
|
|
|
||
|
|
const china_Lake_tube: NewItemFromCloneDetails = {
|
||
|
|
itemTplToClone: ItemTpl.MAGAZINE_12G_M870X10_10RND,
|
||
|
|
overrideProperties: {
|
||
|
|
Cartridges: [
|
||
|
|
{
|
||
|
|
"_id": "6745d900550a2919fa49a951",
|
||
|
|
"_max_count": 3,
|
||
|
|
"_name": "cartridges",
|
||
|
|
"_parent": WeaponIds.CHLK_MAG,
|
||
|
|
"_props": {
|
||
|
|
"filters": [
|
||
|
|
{
|
||
|
|
"Filter": [
|
||
|
|
"5ede474b0c226a66f5402622",
|
||
|
|
"5ede475b549eed7c6d5c18fb",
|
||
|
|
"5ede4739e0350d05467f73e8",
|
||
|
|
"5f0c892565703e5c461894e9",
|
||
|
|
"5ede47405b097655935d7d16",
|
||
|
|
"5ede475339ee016e8c534742",
|
||
|
|
"5ede47641cf3836a88318df1"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"_proto": "5748538b2459770af276a261"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
Ergonomics: -24,
|
||
|
|
Weight: 0.24,
|
||
|
|
ExamineExperience: 7,
|
||
|
|
ExaminedByDefault: false,
|
||
|
|
Name: "mod_magazine_china_lake_tube",
|
||
|
|
ShortName: "mod_magazine_china_lake_tube",
|
||
|
|
Description: "mod_magazine_china_lake_tube",
|
||
|
|
Width: 3,
|
||
|
|
Height: 1,
|
||
|
|
ExtraSizeLeft: 0,
|
||
|
|
Prefab:
|
||
|
|
{
|
||
|
|
path: "china lake/mod_magazine_china_lake_3_rnd_tube.bundle",
|
||
|
|
rcid: ""
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
parentId: "5448bc234bdc2d3c308b4569",
|
||
|
|
newId: WeaponIds.CHLK_MAG,
|
||
|
|
handbookParentId: "5b5f754a86f774094242f19b",
|
||
|
|
handbookPriceRoubles: 5361,
|
||
|
|
fleaPriceRoubles: 7433,
|
||
|
|
locales: {
|
||
|
|
"en": {
|
||
|
|
name: "China Lake 3-round magazine tube",
|
||
|
|
shortName: "China Lake",
|
||
|
|
description: "3-Round standard magazine tube for the China Lake pump-action grenade launcher."
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
customitem.createItemFromClone(china_Lake_tube);
|
||
|
|
|
||
|
|
const china_Lake_sight: NewItemFromCloneDetails = {
|
||
|
|
itemTplToClone: ItemTpl.COLLIMATOR_MILKOR_M2A1_GRENADE_LAUNCHER_REFLEX_SIGHT,
|
||
|
|
overrideProperties: {
|
||
|
|
SightingRange: 100,
|
||
|
|
CalibrationDistances: [
|
||
|
|
[
|
||
|
|
50
|
||
|
|
]
|
||
|
|
],
|
||
|
|
Ergonomics: -10,
|
||
|
|
Slots: [],
|
||
|
|
Weight: 0.08,
|
||
|
|
sightModType: "ironsight",
|
||
|
|
ExamineExperience: 7,
|
||
|
|
ExaminedByDefault: false,
|
||
|
|
Name: "mod_scope_china_lake",
|
||
|
|
ShortName: "mod_scope_china_lake",
|
||
|
|
Description: "mod_scope_china_lake",
|
||
|
|
Width: 1,
|
||
|
|
Height: 1,
|
||
|
|
ExtraSizeLeft: 0,
|
||
|
|
IsAnimated: true,
|
||
|
|
Prefab:
|
||
|
|
{
|
||
|
|
path: "china lake/mod_scope_leaf_sight.bundle",
|
||
|
|
rcid: ""
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
parentId: "55818ad54bdc2ddc698b4569",
|
||
|
|
newId: WeaponIds.CHLK_SIGHT,
|
||
|
|
handbookParentId: "5b5f73ec86f774093e6cb4fd",
|
||
|
|
handbookPriceRoubles: 876,
|
||
|
|
fleaPriceRoubles: 932,
|
||
|
|
locales: {
|
||
|
|
"en": {
|
||
|
|
name: "China Lake leaf iron sight",
|
||
|
|
shortName: "China Lake",
|
||
|
|
description: "Standard issue adjustable iron sight for the China Lake."
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
customitem.createItemFromClone(china_Lake_sight);
|
||
|
|
|
||
|
|
/* ["6275303a9f372d6ea97f9ec7"] = {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5};
|
||
|
|
["6357c98711fb55120211f7e1"] = {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5};
|
||
|
|
["62e7e7bbe6da9612f743f1e0"] = {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5};
|
||
|
|
["5e81ebcd8e146c7080625e15"] = {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5}; */
|
||
|
|
|
||
|
|
/* const cultist_Recipe: Record<string, IDirectRewardSettings> = {
|
||
|
|
"6275303a9f372d6ea97f9ec7": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5},
|
||
|
|
"6357c98711fb55120211f7e1": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5},
|
||
|
|
"62e7e7bbe6da9612f743f1e0": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5},
|
||
|
|
"5e81ebcd8e146c7080625e15": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 5}
|
||
|
|
}
|
||
|
|
|
||
|
|
hideout.cultistCircle.directRewards.push(cultist_Recipe) */
|
||
|
|
|
||
|
|
const cultist_Recipes: Record<string, IDirectRewardSettings> = {
|
||
|
|
"6275303a9f372d6ea97f9ec7": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 39960},
|
||
|
|
"6357c98711fb55120211f7e1": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 39960},
|
||
|
|
"62e7e7bbe6da9612f743f1e0": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 39960},
|
||
|
|
"5e81ebcd8e146c7080625e15": {rewardTpls: [WeaponIds.CHLK], craftTimeSeconds: 39960}
|
||
|
|
}
|
||
|
|
|
||
|
|
for (const recipeToAddKey in cultist_Recipes)
|
||
|
|
{
|
||
|
|
productionConfig.cultistCircle.directRewards[recipeToAddKey] = cultist_Recipes[recipeToAddKey];
|
||
|
|
}
|
||
|
|
|
||
|
|
// MASTERY AND TRADER
|
||
|
|
const Chlk_mastery = {
|
||
|
|
"Name": "China Lake",
|
||
|
|
"Templates": [
|
||
|
|
WeaponIds.CHLK
|
||
|
|
],
|
||
|
|
"Level2": 350,
|
||
|
|
"Level3": 700
|
||
|
|
}
|
||
|
|
globals.config.Mastering.push(Chlk_mastery)
|
||
|
|
|
||
|
|
for (const itemPreset in global_preset_file.ItemPresets)
|
||
|
|
{
|
||
|
|
globals.ItemPresets[itemPreset] = global_preset_file.ItemPresets[itemPreset];
|
||
|
|
}
|
||
|
|
|
||
|
|
//trader push
|
||
|
|
/* PK.items.push(...preset_file.items);
|
||
|
|
|
||
|
|
for (const bsc in preset_file.barter_scheme)
|
||
|
|
{
|
||
|
|
PK.barter_scheme[bsc] = preset_file.barter_scheme[bsc];
|
||
|
|
}
|
||
|
|
|
||
|
|
for (const llv in preset_file.loyal_level_items)
|
||
|
|
{
|
||
|
|
PK.loyal_level_items[llv] = preset_file.loyal_level_items[llv];
|
||
|
|
} */
|
||
|
|
|
||
|
|
//push loot
|
||
|
|
/* const weaponcrateloot =
|
||
|
|
{
|
||
|
|
"tpl": WeaponIds.KSG12,
|
||
|
|
"relativeProbability": 17
|
||
|
|
} */
|
||
|
|
|
||
|
|
const locations = db.locations;
|
||
|
|
/* locations.rezervbase.looseLoot.spawnpoints.push(...spawnPoints.spawnsRezerv);
|
||
|
|
locations.woods.looseLoot.spawnpoints.push(...spawnPoints.spawnsWoods);
|
||
|
|
locations.factory4_day.looseLoot.spawnpoints.push(...spawnPoints.spawnsFactory);
|
||
|
|
locations.factory4_night.looseLoot.spawnpoints.push(...spawnPoints.spawnsFactory); */
|
||
|
|
|
||
|
|
/* for (const locationKey in locations)
|
||
|
|
{
|
||
|
|
const location: ILocation = locations[locationKey];
|
||
|
|
if (!location || !location.staticLoot)
|
||
|
|
{
|
||
|
|
continue
|
||
|
|
}
|
||
|
|
|
||
|
|
location.staticLoot[ItemTpl.LOOTCONTAINER_WEAPON_BOX_5X5]?.itemDistribution.push(weaponcrateloot);
|
||
|
|
location.staticLoot[ItemTpl.LOOTCONTAINER_WEAPON_BOX_6X3]?.itemDistribution.push(weaponcrateloot);
|
||
|
|
location.staticLoot[ItemTpl.LOOTCONTAINER_WEAPON_BOX_5X2]?.itemDistribution.push(weaponcrateloot);
|
||
|
|
} */
|
||
|
|
|
||
|
|
const scav = db.bots.types["assault"];
|
||
|
|
|
||
|
|
scav.inventory.equipment.FirstPrimaryWeapon[WeaponIds.CHLK] = 83;
|
||
|
|
scav.inventory.mods[WeaponIds.CHLK] =
|
||
|
|
{
|
||
|
|
mod_magazine: [
|
||
|
|
WeaponIds.CHLK_SIGHT
|
||
|
|
],
|
||
|
|
mod_scope: [
|
||
|
|
WeaponIds.CHLK_SIGHT
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
customitem.addCustomWeaponToPMCs(WeaponIds.CHLK, 3, "SecondPrimaryWeapon")
|
||
|
|
|
||
|
|
//ON GOD WACKY AHH ID INVENTORY THING
|
||
|
|
db.templates.items["55d7217a4bdc2d86028b456d"]._props.Slots[0]._props.filters[0].Filter.push(WeaponIds.CHLK);
|
||
|
|
db.templates.items["55d7217a4bdc2d86028b456d"]._props.Slots[1]._props.filters[0].Filter.push(WeaponIds.CHLK);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export const mod = new Mod();
|