Allow modifcaiton of the container airdrop will use (capacity etc)
This commit is contained in:
parent
ad6b94d8a9
commit
dba6b5f629
@ -21,6 +21,12 @@
|
|||||||
"planeVolume": 0.5,
|
"planeVolume": 0.5,
|
||||||
"planeSpeed": 65,
|
"planeSpeed": 65,
|
||||||
"crateFallSpeed": 3,
|
"crateFallSpeed": 3,
|
||||||
|
"containerIds": {
|
||||||
|
"mixed": "6223349b3136504a544d1608",
|
||||||
|
"weaponArmor": "6223349b3136504a544d1608",
|
||||||
|
"foodMedical": "6223349b3136504a544d1608",
|
||||||
|
"barter": "6223349b3136504a544d1608"
|
||||||
|
},
|
||||||
"loot": {
|
"loot": {
|
||||||
"mixed": {
|
"mixed": {
|
||||||
"presetCount": {
|
"presetCount": {
|
||||||
|
@ -9,11 +9,11 @@ import {
|
|||||||
ILocationsGenerateAllResponse
|
ILocationsGenerateAllResponse
|
||||||
} from "../models/eft/common/ILocationsSourceDestinationBase";
|
} from "../models/eft/common/ILocationsSourceDestinationBase";
|
||||||
import { ILooseLoot, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
import { ILooseLoot, SpawnpointTemplate } from "../models/eft/common/ILooseLoot";
|
||||||
|
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
|
||||||
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
||||||
import { ConfigTypes } from "../models/enums/ConfigTypes";
|
import { ConfigTypes } from "../models/enums/ConfigTypes";
|
||||||
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
||||||
import { ILocations } from "../models/spt/server/ILocations";
|
import { ILocations } from "../models/spt/server/ILocations";
|
||||||
import { LootItem } from "../models/spt/services/LootItem";
|
|
||||||
import { LootRequest } from "../models/spt/services/LootRequest";
|
import { LootRequest } from "../models/spt/services/LootRequest";
|
||||||
import { ILogger } from "../models/spt/utils/ILogger";
|
import { ILogger } from "../models/spt/utils/ILogger";
|
||||||
import { ConfigServer } from "../servers/ConfigServer";
|
import { ConfigServer } from "../servers/ConfigServer";
|
||||||
@ -55,7 +55,7 @@ export class LocationController
|
|||||||
public generate(name: string): ILocationBase
|
public generate(name: string): ILocationBase
|
||||||
{
|
{
|
||||||
const location: ILocation = this.databaseServer.getTables().locations[name];
|
const location: ILocation = this.databaseServer.getTables().locations[name];
|
||||||
const output: ILocationBase = location.base;
|
const output: ILocationBase = this.jsonUtil.clone(location.base);
|
||||||
// const ids = {};
|
// const ids = {};
|
||||||
|
|
||||||
output.UnixDateTime = this.timeUtil.getTimestamp();
|
output.UnixDateTime = this.timeUtil.getTimestamp();
|
||||||
@ -68,7 +68,7 @@ export class LocationController
|
|||||||
|
|
||||||
const locationName = location.base.Name;
|
const locationName = location.base.Name;
|
||||||
|
|
||||||
// generate loot
|
// Copy loot data
|
||||||
const staticWeapons = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticWeapons);
|
const staticWeapons = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticWeapons);
|
||||||
const staticContainers = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticContainers);
|
const staticContainers = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticContainers);
|
||||||
const staticForced = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticForced);
|
const staticForced = this.jsonUtil.clone(this.databaseServer.getTables().loot.staticContainers[locationName].staticForced);
|
||||||
@ -146,7 +146,7 @@ export class LocationController
|
|||||||
* Generates it randomly based on config/airdrop.json values
|
* Generates it randomly based on config/airdrop.json values
|
||||||
* @returns Array of LootItem objects
|
* @returns Array of LootItem objects
|
||||||
*/
|
*/
|
||||||
public getAirdropLoot(): LootItem[]
|
public getAirdropLoot(): IAirdropLootResult
|
||||||
{
|
{
|
||||||
const airdropType = this.chooseAirdropType();
|
const airdropType = this.chooseAirdropType();
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ export class LocationController
|
|||||||
|
|
||||||
const airdropConfig = this.getAirdropLootConfigByType(airdropType);
|
const airdropConfig = this.getAirdropLootConfigByType(airdropType);
|
||||||
|
|
||||||
return this.lootGenerator.createRandomLoot(airdropConfig);
|
return {dropType: airdropType, loot: this.lootGenerator.createRandomLoot(airdropConfig)};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
7
project/src/models/eft/location/IAirdropLootResult.ts
Normal file
7
project/src/models/eft/location/IAirdropLootResult.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { LootItem } from "../../../models/spt/services/LootItem";
|
||||||
|
|
||||||
|
export interface IAirdropLootResult
|
||||||
|
{
|
||||||
|
dropType: string
|
||||||
|
loot: LootItem[]
|
||||||
|
}
|
@ -12,6 +12,7 @@ export interface IAirdropConfig extends IBaseConfig
|
|||||||
planeVolume: number
|
planeVolume: number
|
||||||
planeSpeed: number
|
planeSpeed: number
|
||||||
crateFallSpeed: number
|
crateFallSpeed: number
|
||||||
|
containerIds: Record<string, string>
|
||||||
airdropMinStartTimeSeconds: number
|
airdropMinStartTimeSeconds: number
|
||||||
airdropMaxStartTimeSeconds: number
|
airdropMaxStartTimeSeconds: number
|
||||||
loot: Record<string, AirdropLoot>
|
loot: Record<string, AirdropLoot>
|
||||||
|
Loading…
Reference in New Issue
Block a user