Replaced various magic strings with enum values
Added `itemHelper.getItemFromPool()`
This commit is contained in:
parent
836910c1d5
commit
8c05345b85
@ -23,6 +23,7 @@ import { BonusType } from "@spt/models/enums/BonusType";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { SkillTypes } from "@spt/models/enums/SkillTypes";
|
||||
import { Traders } from "@spt/models/enums/Traders";
|
||||
import { Weapons12Gauge, Weapons20Gauge } from "@spt/models/enums/WeaponTypes";
|
||||
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||
import { ICoreConfig } from "@spt/models/spt/config/ICoreConfig";
|
||||
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
||||
@ -551,10 +552,7 @@ export class GameController
|
||||
{
|
||||
const itemDb = this.databaseService.getItems();
|
||||
|
||||
// Saiga 12ga
|
||||
// Toz 106
|
||||
// Remington 870
|
||||
const shotguns = ["576165642459773c7a400233", "5a38e6bac4a2826c6e06d79b", "5a7828548dc32e5a9c28b516"];
|
||||
const shotguns = [Weapons12Gauge.SAIGA_12GA, Weapons20Gauge.TOZ_106, Weapons12Gauge.M870];
|
||||
for (const shotgunId of shotguns)
|
||||
{
|
||||
if (itemDb[shotgunId]._props.ShotgunDispersion)
|
||||
|
@ -15,6 +15,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { IRegisterPlayerRequestData } from "@spt/models/eft/inRaid/IRegisterPlayerRequestData";
|
||||
import { ISaveProgressRequestData } from "@spt/models/eft/inRaid/ISaveProgressRequestData";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { MessageType } from "@spt/models/enums/MessageType";
|
||||
import { PlayerRaidEndState } from "@spt/models/enums/PlayerRaidEndState";
|
||||
import { QuestStatus } from "@spt/models/enums/QuestStatus";
|
||||
@ -227,23 +228,24 @@ export class InraidController
|
||||
// Not dead
|
||||
|
||||
// Check for cultist amulets in special slot (only slot it can fit)
|
||||
const amuletOnPlayer = serverPmcProfile.Inventory.items
|
||||
.filter((item) => item.slotId?.startsWith("SpecialSlot"))
|
||||
.find((item) => item._tpl === "64d0b40fbe2eed70e254e2d4");
|
||||
if (amuletOnPlayer)
|
||||
const sacredAmulet = this.itemHelper.getItemFromPool(
|
||||
serverPmcProfile.Inventory.items,
|
||||
ItemTpl.SACRED_AMULET,
|
||||
"SpecialSlot");
|
||||
if (sacredAmulet)
|
||||
{
|
||||
// No charges left, delete it
|
||||
if (amuletOnPlayer.upd.CultistAmulet.NumberOfUsages <= 0)
|
||||
if (sacredAmulet.upd.CultistAmulet.NumberOfUsages <= 0)
|
||||
{
|
||||
serverPmcProfile.Inventory.items.splice(
|
||||
serverPmcProfile.Inventory.items.indexOf(amuletOnPlayer),
|
||||
serverPmcProfile.Inventory.items.indexOf(sacredAmulet),
|
||||
1,
|
||||
);
|
||||
}
|
||||
else if (amuletOnPlayer.upd.CultistAmulet.NumberOfUsages > 0)
|
||||
else if (sacredAmulet.upd.CultistAmulet.NumberOfUsages > 0)
|
||||
{
|
||||
// Charges left, reduce by 1
|
||||
amuletOnPlayer.upd.CultistAmulet.NumberOfUsages--;
|
||||
sacredAmulet.upd.CultistAmulet.NumberOfUsages--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo
|
||||
import { Insurance } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { SkillTypes } from "@spt/models/enums/SkillTypes";
|
||||
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
@ -35,7 +36,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
export class InsuranceController
|
||||
{
|
||||
protected insuranceConfig: IInsuranceConfig;
|
||||
protected roubleTpl = "5449016a4bdc2d6f028b456f";
|
||||
|
||||
constructor(
|
||||
@inject("PrimaryLogger") protected logger: ILogger,
|
||||
@ -518,7 +518,7 @@ export class InsuranceController
|
||||
// Get a dictionary of item tpls + their rouble price
|
||||
for (const attachment of attachments)
|
||||
{
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(attachment._tpl, this.roubleTpl);
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(attachment._tpl, Money.ROUBLES);
|
||||
if (price)
|
||||
{
|
||||
result[attachment._id] = Math.round(price);
|
||||
@ -680,7 +680,7 @@ export class InsuranceController
|
||||
for (const key of body.items)
|
||||
{
|
||||
itemsToPay.push({
|
||||
id: this.roubleTpl, // TODO: update to handle different currencies
|
||||
id: Money.ROUBLES, // TODO: update to handle different currencies
|
||||
count: this.insuranceService.getRoublePriceToInsureItemWithTrader(
|
||||
pmcData, inventoryItemsHash[key],
|
||||
body.tid),
|
||||
|
@ -20,6 +20,7 @@ import { ISearchFriendRequestData } from "@spt/models/eft/profile/ISearchFriendR
|
||||
import { ISearchFriendResponse } from "@spt/models/eft/profile/ISearchFriendResponse";
|
||||
import { ISptProfile, Inraid, Vitality } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { IValidateNicknameRequestData } from "@spt/models/eft/profile/IValidateNicknameRequestData";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { MessageType } from "@spt/models/enums/MessageType";
|
||||
import { QuestStatus } from "@spt/models/enums/QuestStatus";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
@ -37,8 +38,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
@injectable()
|
||||
export class ProfileController
|
||||
{
|
||||
protected defaultInventoryTpl = "55d7217a4bdc2d86028b456d";
|
||||
|
||||
constructor(
|
||||
@inject("PrimaryLogger") protected logger: ILogger,
|
||||
@inject("HashUtil") protected hashUtil: HashUtil,
|
||||
@ -462,7 +461,7 @@ export class ProfileController
|
||||
skills: playerPmc.Skills,
|
||||
equipment: {
|
||||
// Default inventory tpl
|
||||
Id: playerPmc.Inventory.items.find((item) => item._tpl === this.defaultInventoryTpl)._id,
|
||||
Id: playerPmc.Inventory.items.find((item) => item._tpl === ItemTpl.DEFAULT_INVENTORY)._id,
|
||||
Items: playerPmc.Inventory.items,
|
||||
},
|
||||
achievements: playerPmc.Achievements,
|
||||
|
@ -20,6 +20,7 @@ import { BackendErrorCodes } from "@spt/models/enums/BackendErrorCodes";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { MemberCategory } from "@spt/models/enums/MemberCategory";
|
||||
import { MessageType } from "@spt/models/enums/MessageType";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { Traders } from "@spt/models/enums/Traders";
|
||||
import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig";
|
||||
import { ITraderConfig } from "@spt/models/spt/config/ITraderConfig";
|
||||
@ -39,8 +40,6 @@ import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||
@injectable()
|
||||
export class TradeController
|
||||
{
|
||||
protected roubleTpl = "5449016a4bdc2d6f028b456f";
|
||||
|
||||
protected ragfairConfig: IRagfairConfig;
|
||||
protected traderConfig: ITraderConfig;
|
||||
|
||||
@ -276,7 +275,7 @@ export class TradeController
|
||||
// Create single currency item with all currency on it
|
||||
const rootCurrencyReward = {
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: this.roubleTpl,
|
||||
_tpl: Money.ROUBLES,
|
||||
upd: { StackObjectsCount: roublesToSend },
|
||||
};
|
||||
|
||||
|
@ -19,6 +19,7 @@ import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/
|
||||
import { Item, Upd } from "@spt/models/eft/common/tables/IItem";
|
||||
import { BaseClasses } from "@spt/models/enums/BaseClasses";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { MemberCategory } from "@spt/models/enums/MemberCategory";
|
||||
import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails";
|
||||
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||
@ -530,13 +531,12 @@ export class BotGenerator
|
||||
*/
|
||||
protected generateInventoryId(profile: IBotBase): void
|
||||
{
|
||||
const rootInventoryItemTpl = "55d7217a4bdc2d86028b456d";
|
||||
const newInventoryItemId = this.hashUtil.generate();
|
||||
|
||||
for (const item of profile.Inventory.items)
|
||||
{
|
||||
// Root item found, update its _id value to newly generated id
|
||||
if (item._tpl === rootInventoryItemTpl)
|
||||
if (item._tpl === ItemTpl.DEFAULT_INVENTORY)
|
||||
{
|
||||
item._id = newInventoryItemId;
|
||||
|
||||
|
@ -11,6 +11,7 @@ import { Chances, Generation, IBotType, Inventory, Mods } from "@spt/models/eft/
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { EquipmentSlots } from "@spt/models/enums/EquipmentSlots";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import {
|
||||
EquipmentFilterDetails,
|
||||
EquipmentFilters,
|
||||
@ -101,27 +102,18 @@ export class BotInventoryGenerator
|
||||
protected generateInventoryBase(): PmcInventory
|
||||
{
|
||||
const equipmentId = this.hashUtil.generate();
|
||||
const equipmentTpl = "55d7217a4bdc2d86028b456d";
|
||||
|
||||
const stashId = this.hashUtil.generate();
|
||||
const stashTpl = "566abbc34bdc2d92178b4576";
|
||||
|
||||
const questRaidItemsId = this.hashUtil.generate();
|
||||
const questRaidItemsTpl = "5963866286f7747bf429b572";
|
||||
|
||||
const questStashItemsId = this.hashUtil.generate();
|
||||
const questStashItemsTpl = "5963866b86f7747bfa1c4462";
|
||||
|
||||
const sortingTableId = this.hashUtil.generate();
|
||||
const sortingTableTpl = "602543c13fee350cd564d032";
|
||||
|
||||
return {
|
||||
items: [
|
||||
{ _id: equipmentId, _tpl: equipmentTpl },
|
||||
{ _id: stashId, _tpl: stashTpl },
|
||||
{ _id: questRaidItemsId, _tpl: questRaidItemsTpl },
|
||||
{ _id: questStashItemsId, _tpl: questStashItemsTpl },
|
||||
{ _id: sortingTableId, _tpl: sortingTableTpl },
|
||||
{ _id: equipmentId, _tpl: ItemTpl.DEFAULT_INVENTORY },
|
||||
{ _id: stashId, _tpl: ItemTpl.STASH },
|
||||
{ _id: questRaidItemsId, _tpl: ItemTpl.STASH_QUEST_RAID_ITEMS },
|
||||
{ _id: questStashItemsId, _tpl: ItemTpl.STASH_QUEST_ITEMS },
|
||||
{ _id: sortingTableId, _tpl: ItemTpl.SORTING_TABLE },
|
||||
],
|
||||
equipment: equipmentId,
|
||||
stash: stashId,
|
||||
|
@ -3,6 +3,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||
@ -22,8 +23,6 @@ export class PMCLootGenerator
|
||||
protected backpackLootPool: Record<string, number> = {};
|
||||
protected pmcConfig: IPmcConfig;
|
||||
|
||||
protected roubleTpl = "5449016a4bdc2d6f028b456f";
|
||||
|
||||
constructor(
|
||||
@inject("ItemHelper") protected itemHelper: ItemHelper,
|
||||
@inject("DatabaseService") protected databaseService: DatabaseService,
|
||||
@ -78,7 +77,7 @@ export class PMCLootGenerator
|
||||
else
|
||||
{
|
||||
// Set price of item as its weight
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, this.roubleTpl);
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, Money.ROUBLES);
|
||||
this.pocketLootPool[itemToAdd._id] = price;
|
||||
}
|
||||
}
|
||||
@ -137,7 +136,7 @@ export class PMCLootGenerator
|
||||
else
|
||||
{
|
||||
// Set price of item as its weight
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, this.roubleTpl);
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, Money.ROUBLES);
|
||||
this.vestLootPool[itemToAdd._id] = price;
|
||||
}
|
||||
}
|
||||
@ -206,7 +205,7 @@ export class PMCLootGenerator
|
||||
else
|
||||
{
|
||||
// Set price of item as its weight
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, this.roubleTpl);
|
||||
const price = this.ragfairPriceService.getDynamicItemPrice(itemToAdd._id, Money.ROUBLES);
|
||||
this.backpackLootPool[itemToAdd._id] = price;
|
||||
}
|
||||
}
|
||||
|
@ -281,10 +281,10 @@ export class ScavCaseRewardGenerator
|
||||
{
|
||||
const money: ITemplateItem[] = [];
|
||||
const items = this.databaseService.getItems();
|
||||
money.push(items["5449016a4bdc2d6f028b456f"]); // rub
|
||||
money.push(items["569668774bdc2da2298b4568"]); // euro
|
||||
money.push(items["5696686a4bdc2da3298b456a"]); // dollar
|
||||
money.push(items["5d235b4d86f7742e017bc88a"]); // GP
|
||||
money.push(items[Money.ROUBLES]);
|
||||
money.push(items[Money.EUROS]);
|
||||
money.push(items[Money.DOLLARS]);
|
||||
money.push(items[Money.GP]);
|
||||
|
||||
return this.randomUtil.getArrayValue(money);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { BaseClasses } from "@spt/models/enums/BaseClasses";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||
import { ItemFilterService } from "@spt/services/ItemFilterService";
|
||||
@ -32,9 +33,9 @@ export class GiveSptCommand implements ISptCommand
|
||||
private static acceptableConfidence = 0.9;
|
||||
// exception for flares
|
||||
private static excludedPresetItems = new Set<string>([
|
||||
"62178c4d4ecf221597654e3d",
|
||||
"6217726288ed9f0845317459",
|
||||
"624c0b3340357b5f566e8766",
|
||||
ItemTpl.RSP30_SIGNAL_CARTRIDGE_RED,
|
||||
ItemTpl.RSP30_SIGNAL_CARTRIDGE_GREEN,
|
||||
ItemTpl.RSP30_SIGNAL_CARTRIDGE_YELLOW,
|
||||
]);
|
||||
|
||||
protected savedCommand: Map<string, SavedCommand> = new Map<string, SavedCommand>();
|
||||
|
@ -6,6 +6,7 @@ import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ProfileHelper } from "@spt/helpers/ProfileHelper";
|
||||
import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { SkillTypes } from "@spt/models/enums/SkillTypes";
|
||||
import { IProfileChangeEvent, ProfileChangeEventType } from "@spt/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
@ -125,7 +126,7 @@ export class ProfileSptCommand implements ISptCommand
|
||||
[
|
||||
{
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: "5449016a4bdc2d6f028b456f",
|
||||
_tpl: Money.ROUBLES,
|
||||
upd: { StackObjectsCount: 1 },
|
||||
parentId: this.hashUtil.generate(),
|
||||
slotId: "main",
|
||||
|
@ -5,6 +5,7 @@ import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { PresetHelper } from "@spt/helpers/PresetHelper";
|
||||
import { ISendMessageRequest } from "@spt/models/eft/dialog/ISendMessageRequest";
|
||||
import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { IProfileChangeEvent, ProfileChangeEventType } from "@spt/models/spt/dialog/ISendMessageDetails";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||
@ -99,7 +100,7 @@ export class TraderSptCommand implements ISptCommand
|
||||
[
|
||||
{
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: "5449016a4bdc2d6f028b456f",
|
||||
_tpl: Money.ROUBLES,
|
||||
upd: { StackObjectsCount: 1 },
|
||||
parentId: this.hashUtil.generate(),
|
||||
slotId: "main",
|
||||
|
@ -15,6 +15,7 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo
|
||||
import { BonusType } from "@spt/models/enums/BonusType";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { HideoutAreas } from "@spt/models/enums/HideoutAreas";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { SkillTypes } from "@spt/models/enums/SkillTypes";
|
||||
import { IHideoutConfig } from "@spt/models/spt/config/IHideoutConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
@ -34,8 +35,6 @@ export class HideoutHelper
|
||||
public static bitcoinFarm = "5d5c205bd582a50d042a3c0e";
|
||||
public static bitcoinProductionId = "5d5c205bd582a50d042a3c0e";
|
||||
public static waterCollector = "5d5589c1f934db045e6c5492";
|
||||
public static bitcoinTpl = "59faff1d86f7746c51718c9c";
|
||||
public static expeditionaryFuelTank = "5d1b371186f774253763a656";
|
||||
public static maxSkillPoint = 5000;
|
||||
|
||||
protected hideoutConfig: IHideoutConfig;
|
||||
@ -982,7 +981,7 @@ export class HideoutHelper
|
||||
{
|
||||
btcProd.Products.push({
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: HideoutHelper.bitcoinTpl,
|
||||
_tpl: ItemTpl.BITCOIN,
|
||||
upd: { StackObjectsCount: 1 },
|
||||
});
|
||||
|
||||
@ -1154,7 +1153,7 @@ export class HideoutHelper
|
||||
itemsToAdd.push([
|
||||
{
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: HideoutHelper.bitcoinTpl,
|
||||
_tpl: ItemTpl.BITCOIN,
|
||||
upd: { StackObjectsCount: 1 },
|
||||
},
|
||||
]);
|
||||
|
@ -71,6 +71,24 @@ export class ItemHelper
|
||||
return filteredPool.some((poolItem) => poolItem._tpl === item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the desired item from provided pool
|
||||
* @param itemPool Item collection to search
|
||||
* @param item Item to look for
|
||||
* @param slotId OPTIONAL - slotid of desired item
|
||||
* @returns Item or undefined
|
||||
*/
|
||||
public getItemFromPool(itemPool: Item[], item: ItemTpl, slotId?: string): Item | undefined
|
||||
{
|
||||
// Filter the pool by slotId if provided
|
||||
const filteredPool = (slotId)
|
||||
? itemPool.filter((item) => item.slotId?.startsWith(slotId))
|
||||
: itemPool;
|
||||
|
||||
// Check if any item in the filtered pool matches the provided item
|
||||
return filteredPool.find((poolItem) => poolItem._tpl === item);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will compare two items (with all its children) and see if the are equivalent.
|
||||
* This method will NOT compare IDs on the items
|
||||
|
@ -44,14 +44,16 @@ export class RagfairHelper
|
||||
{
|
||||
switch (currency)
|
||||
{
|
||||
case "569668774bdc2da2298b4568":
|
||||
case Money.EUROS:
|
||||
return "EUR";
|
||||
|
||||
case "5696686a4bdc2da3298b456a":
|
||||
case Money.DOLLARS:
|
||||
return "USD";
|
||||
|
||||
case "5449016a4bdc2d6f028b456f":
|
||||
case Money.ROUBLES:
|
||||
return "RUB";
|
||||
case Money.GP:
|
||||
return "GP";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
@ -2,4 +2,37 @@ export enum ItemTpl
|
||||
{
|
||||
MARK_OF_UNHEARD = "65ddcc9cfa85b9f17d0dfb07",
|
||||
SACRED_AMULET = "64d0b40fbe2eed70e254e2d4",
|
||||
DEFAULT_INVENTORY = "55d7217a4bdc2d86028b456d",
|
||||
SURV12_KIT = "5d02797c86f774203f38e30a",
|
||||
RSP30_SIGNAL_CARTRIDGE_RED = "62178c4d4ecf221597654e3d",
|
||||
RSP30_SIGNAL_CARTRIDGE_GREEN = "6217726288ed9f0845317459",
|
||||
RSP30_SIGNAL_CARTRIDGE_YELLOW = "624c0b3340357b5f566e8766",
|
||||
BITCOIN = "59faff1d86f7746c51718c9c",
|
||||
EXPEDITIONARY_FUEL_TANK = "5d1b371186f774253763a656",
|
||||
FAKE_WHITE_BEARD = "5c1a1e3f2e221602b66cc4c2",
|
||||
PUMPKIN_WITH_SWEETS = "634959225289190e5e773b3b",
|
||||
CHRISTMAS_TREE_ORNAMENT_RED = "5df8a6a186f77412640e2e80",
|
||||
CHRISTMAS_TREE_ORNAMENT_VIOLET = "5df8a77486f77412672a1e3f",
|
||||
CHRISTMAS_TREE_ORNAMENT_SILVER = "5df8a72c86f77412640e2e83",
|
||||
DED_MOROZ_HAT = "5a43943586f77416ad2f06e2",
|
||||
SANTA_HAT = "5a43957686f7742a2c2f11b0",
|
||||
SANTAS_BAG = "61b9e1aaef9a1b5d6a79899a",
|
||||
STASH = "566abbc34bdc2d92178b4576",
|
||||
STASH_QUEST_RAID_ITEMS = "5963866286f7747bf429b572",
|
||||
STASH_QUEST_ITEMS = "5963866b86f7747bfa1c4462",
|
||||
SORTING_TABLE = "602543c13fee350cd564d032",
|
||||
SPOOKY_SKULL_MASK = "635267ab3c89e2112001f826",
|
||||
FACELESS_MASK = "6176a48d732a664031271438",
|
||||
JASON_MASK = "5bd071d786f7747e707b93a3",
|
||||
MISHA_MAYOROV_MASK = "5bd0716d86f774171822ef4b",
|
||||
SLENDER_MASK = "5bd06f5d86f77427101ad47c",
|
||||
GHOUL_MASK = "6176a40f0b8c0312ac75a3d3",
|
||||
HOCKEY_CAPTAIN_MASK = "62a5c2c98ec41a51b34739c0",
|
||||
HOCKEY_BRAWLER_MASK = "62a5c333ec21e50cad3b5dc6",
|
||||
HOCKEY_QUIET_MASK = "62a5c41e8ec41a51b34739c3",
|
||||
JACK_LANTERN_PUMPKIN_HELMET = "59ef13ca86f77445fd0e2483",
|
||||
WEAPON_STAND_STASH_1 = "6401c7b213d9b818bf0e7dd7",
|
||||
WEAPON_STAND_STASH_2 = "64381b582bb1c5dedd0fc925",
|
||||
WEAPON_STAND_STASH_3 = "64381b6e44b37a080d0245b9",
|
||||
NCSTAR_MPR45_BACKUP_MOUNT = "5649a2464bdc2d91118b45a8",
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import { Item } from "@spt/models/eft/common/tables/IItem";
|
||||
import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { BaseClasses } from "@spt/models/enums/BaseClasses";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||
@ -85,13 +86,13 @@ export class BotWeaponModLimitService
|
||||
): boolean
|
||||
{
|
||||
// If mod or mods parent is the NcSTAR MPR45 Backup mount, allow it as it looks cool
|
||||
const ncSTARTpl = "5649a2464bdc2d91118b45a8";
|
||||
if (modsParent._id === ncSTARTpl || modTemplate._id === ncSTARTpl)
|
||||
if (modsParent._id === ItemTpl.NCSTAR_MPR45_BACKUP_MOUNT
|
||||
|| modTemplate._id === ItemTpl.NCSTAR_MPR45_BACKUP_MOUNT)
|
||||
{
|
||||
// If weapon already has a longer ranged scope on it, allow ncstar to be spawned
|
||||
if (
|
||||
weapon.some((x) =>
|
||||
this.itemHelper.isOfBaseclasses(x._tpl, [
|
||||
weapon.some((item) =>
|
||||
this.itemHelper.isOfBaseclasses(item._tpl, [
|
||||
BaseClasses.ASSAULT_SCOPE,
|
||||
BaseClasses.OPTIC_SCOPE,
|
||||
BaseClasses.SPECIAL_SCOPE,
|
||||
|
@ -1059,7 +1059,7 @@ export class FenceService
|
||||
assorts.barter_scheme[presetWithChildrenClone[0]._id] = [
|
||||
[
|
||||
{
|
||||
_tpl: "5449016a4bdc2d6f028b456f",
|
||||
_tpl: Money.ROUBLES,
|
||||
count: Math.round(itemPrice),
|
||||
},
|
||||
],
|
||||
@ -1124,7 +1124,7 @@ export class FenceService
|
||||
assorts.barter_scheme[presetWithChildrenClone[0]._id] = [
|
||||
[
|
||||
{
|
||||
_tpl: "5449016a4bdc2d6f028b456f",
|
||||
_tpl: Money.ROUBLES,
|
||||
count: Math.round(itemPrice),
|
||||
},
|
||||
],
|
||||
|
@ -15,6 +15,7 @@ import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTr
|
||||
import { BaseClasses } from "@spt/models/enums/BaseClasses";
|
||||
import { BonusType } from "@spt/models/enums/BonusType";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { Money } from "@spt/models/enums/Money";
|
||||
import { SkillTypes } from "@spt/models/enums/SkillTypes";
|
||||
import { BonusSettings, IRepairConfig } from "@spt/models/spt/config/IRepairConfig";
|
||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||
@ -132,7 +133,7 @@ export class RepairService
|
||||
const options: IProcessBuyTradeRequestData = {
|
||||
scheme_items: [
|
||||
{
|
||||
id: "5449016a4bdc2d6f028b456f", // Rouble tpl
|
||||
id: Money.ROUBLES,
|
||||
count: Math.round(repairCost),
|
||||
},
|
||||
],
|
||||
|
@ -6,6 +6,7 @@ import { ILocation } from "@spt/models/eft/common/ILocation";
|
||||
import { BossLocationSpawn } from "@spt/models/eft/common/ILocationBase";
|
||||
import { Inventory } from "@spt/models/eft/common/tables/IBotType";
|
||||
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import { Season } from "@spt/models/enums/Season";
|
||||
import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType";
|
||||
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
|
||||
@ -55,30 +56,30 @@ export class SeasonalEventService
|
||||
protected get christmasEventItems(): string[]
|
||||
{
|
||||
return [
|
||||
"5c1a1e3f2e221602b66cc4c2", // White beard
|
||||
"5df8a6a186f77412640e2e80", // Red bauble
|
||||
"5df8a77486f77412672a1e3f", // Violet bauble
|
||||
"5df8a72c86f77412640e2e83", // Silver bauble
|
||||
"5a43943586f77416ad2f06e2", // Ded moroz hat
|
||||
"5a43957686f7742a2c2f11b0", // Santa hat
|
||||
"61b9e1aaef9a1b5d6a79899a", // Santas's bag
|
||||
ItemTpl.FAKE_WHITE_BEARD,
|
||||
ItemTpl.CHRISTMAS_TREE_ORNAMENT_RED,
|
||||
ItemTpl.CHRISTMAS_TREE_ORNAMENT_VIOLET,
|
||||
ItemTpl.CHRISTMAS_TREE_ORNAMENT_SILVER,
|
||||
ItemTpl.DED_MOROZ_HAT,
|
||||
ItemTpl.SANTA_HAT,
|
||||
ItemTpl.SANTAS_BAG,
|
||||
];
|
||||
}
|
||||
|
||||
protected get halloweenEventItems(): string[]
|
||||
{
|
||||
return [
|
||||
"635267ab3c89e2112001f826", // Halloween skull mask
|
||||
"634959225289190e5e773b3b", // Pumpkin loot box
|
||||
"59ef13ca86f77445fd0e2483", // Jack'o'lantern helmet
|
||||
"6176a48d732a664031271438", // Faceless mask
|
||||
"5bd071d786f7747e707b93a3", // Jason mask
|
||||
"5bd0716d86f774171822ef4b", // Misha Mayorov mask
|
||||
"5bd06f5d86f77427101ad47c", // Slender mask
|
||||
"6176a40f0b8c0312ac75a3d3", // Ghoul mask
|
||||
"62a5c2c98ec41a51b34739c0", // Hockey player mask "Captain"
|
||||
"62a5c333ec21e50cad3b5dc6", // Hockey player mask "Brawler"
|
||||
"62a5c41e8ec41a51b34739c3", // Hockey player mask "Quiet"
|
||||
ItemTpl.SPOOKY_SKULL_MASK,
|
||||
ItemTpl.PUMPKIN_WITH_SWEETS,
|
||||
ItemTpl.JACK_LANTERN_PUMPKIN_HELMET,
|
||||
ItemTpl.FACELESS_MASK,
|
||||
ItemTpl.JASON_MASK,
|
||||
ItemTpl.MISHA_MAYOROV_MASK,
|
||||
ItemTpl.SLENDER_MASK,
|
||||
ItemTpl.GHOUL_MASK,
|
||||
ItemTpl.HOCKEY_CAPTAIN_MASK,
|
||||
ItemTpl.HOCKEY_BRAWLER_MASK,
|
||||
ItemTpl.HOCKEY_QUIET_MASK,
|
||||
];
|
||||
}
|
||||
|
||||
@ -546,7 +547,7 @@ export class SeasonalEventService
|
||||
|
||||
protected addPumpkinsToScavBackpacks(): void
|
||||
{
|
||||
this.databaseService.getBots().types.assault.inventory.items.Backpack["634959225289190e5e773b3b"] = 400;
|
||||
this.databaseService.getBots().types.assault.inventory.items.Backpack[ItemTpl.PUMPKIN_WITH_SWEETS] = 400;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2,6 +2,7 @@ import { inject, injectable } from "tsyringe";
|
||||
import { ItemHelper } from "@spt/helpers/ItemHelper";
|
||||
import { ITemplateItem, Props } from "@spt/models/eft/common/tables/ITemplateItem";
|
||||
import { BaseClasses } from "@spt/models/enums/BaseClasses";
|
||||
import { ItemTpl } from "@spt/models/enums/ItemTpl";
|
||||
import {
|
||||
CreateItemResult,
|
||||
LocaleDetails,
|
||||
@ -223,7 +224,7 @@ export class CustomItemService
|
||||
protected addToWeaponShelf(newItemId: string): void
|
||||
{
|
||||
// Ids for wall stashes in db
|
||||
const wallStashIds = ["6401c7b213d9b818bf0e7dd7", "64381b582bb1c5dedd0fc925", "64381b6e44b37a080d0245b9"];
|
||||
const wallStashIds = [ItemTpl.WEAPON_STAND_STASH_1, ItemTpl.WEAPON_STAND_STASH_2, ItemTpl.WEAPON_STAND_STASH_3];
|
||||
for (const wallId of wallStashIds)
|
||||
{
|
||||
const wall = this.itemHelper.getItem(wallId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user