From 8251c88f2294552461b14ff517b2bed1f9733455 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 12 Jun 2024 12:23:11 +0100 Subject: [PATCH] Updated types --- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../13AddTrader/types/helpers/BotHelper.d.ts | 4 +- .../13AddTrader/types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../13AddTrader/types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../13AddTrader/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../16ImporterUtil/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../1LogToConsole/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../20CustomChatBot/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../2EditDatabase/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../5ReplaceMethod/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../7OnLoadHook/types/helpers/BotHelper.d.ts | 4 +- .../7OnLoadHook/types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../7OnLoadHook/types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../7OnLoadHook/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../8OnUpdateHook/types/utils/JsonUtil.d.ts | 3 +- .../types/callbacks/BotCallbacks.d.ts | 2 +- .../types/callbacks/DataCallbacks.d.ts | 6 ++- .../types/controllers/BotController.d.ts | 5 +- .../types/controllers/LauncherController.d.ts | 2 +- .../types/controllers/ProfileController.d.ts | 11 +++- .../types/controllers/QuestController.d.ts | 1 + .../RepeatableQuestController.d.ts | 34 ++++++++++-- .../types/generators/BotGenerator.d.ts | 36 ++++++++++--- .../types/generators/BotLootGenerator.d.ts | 2 +- .../types/generators/LocationGenerator.d.ts | 6 ++- .../RepeatableQuestRewardGenerator.d.ts | 54 ++++++++++++++++--- .../types/helpers/BotDifficultyHelper.d.ts | 4 +- .../9RouterHooks/types/helpers/BotHelper.d.ts | 4 +- .../types/helpers/ItemHelper.d.ts | 2 +- .../types/helpers/ProfileHelper.d.ts | 34 +++++++----- .../types/helpers/RagfairOfferHelper.d.ts | 2 +- .../types/helpers/TradeHelper.d.ts | 3 +- .../types/helpers/TraderHelper.d.ts | 9 +++- .../types/models/eft/common/IGlobals.d.ts | 25 ++++++++- .../models/eft/common/tables/IBotBase.d.ts | 11 ++++ .../eft/common/tables/ITemplateItem.d.ts | 1 + .../profile/IGetProfileSettingsRequest.d.ts | 2 + .../types/models/eft/profile/ISptProfile.d.ts | 5 +- .../types/models/enums/Money.d.ts | 3 +- .../types/models/enums/Traders.d.ts | 3 +- .../types/models/spt/config/IBotConfig.d.ts | 6 +-- .../types/models/spt/config/ICoreConfig.d.ts | 1 + .../types/models/spt/config/IGiftsConfig.d.ts | 1 + .../types/models/spt/config/IItemConfig.d.ts | 2 + .../types/models/spt/config/IQuestConfig.d.ts | 1 + .../models/spt/config/IScavCaseConfig.d.ts | 1 + .../spt/repeatable/IQuestRewardValues.d.ts | 9 ++++ .../types/routers/EventOutputHolder.d.ts | 13 +++-- .../types/services/GiftService.d.ts | 11 ++++ .../types/services/ItemFilterService.d.ts | 19 ++++++- .../services/PmcChatResponseService.d.ts | 6 ++- .../types/services/SeasonalEventService.d.ts | 4 +- .../9RouterHooks/types/utils/JsonUtil.d.ts | 3 +- 912 files changed, 6600 insertions(+), 1656 deletions(-) create mode 100644 TypeScript/10ScopesAndTypes/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/13AddTrader/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/15HttpListenerExample/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/16ImporterUtil/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency1/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/17AsyncImporterWithDependency2/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/18CustomItemService/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/19UseExternalLibraries/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/20CustomChatBot/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/21CustomCommandoCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/22CustomAkiCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/spt/repeatable/IQuestRewardValues.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/spt/repeatable/IQuestRewardValues.d.ts diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/Money.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/Money.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/10ScopesAndTypes/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts b/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts b/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts b/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts +++ b/TypeScript/10ScopesAndTypes/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/Money.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/Money.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/Traders.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/11BundleLoadingSample/types/models/enums/Traders.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IItemConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/11BundleLoadingSample/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts b/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts b/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts b/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts b/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts +++ b/TypeScript/11BundleLoadingSample/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/Money.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/Money.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/Traders.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/enums/Traders.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IItemConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/13AddTrader/types/controllers/BotController.d.ts b/TypeScript/13AddTrader/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/13AddTrader/types/controllers/BotController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/13AddTrader/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/13AddTrader/types/models/enums/Money.d.ts b/TypeScript/13AddTrader/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/13AddTrader/types/models/enums/Money.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/13AddTrader/types/models/enums/Traders.d.ts b/TypeScript/13AddTrader/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/13AddTrader/types/models/enums/Traders.d.ts +++ b/TypeScript/13AddTrader/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/13AddTrader/types/models/spt/config/IItemConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/13AddTrader/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/13AddTrader/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/13AddTrader/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/13AddTrader/types/services/GiftService.d.ts b/TypeScript/13AddTrader/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/13AddTrader/types/services/GiftService.d.ts +++ b/TypeScript/13AddTrader/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts b/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts +++ b/TypeScript/13AddTrader/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/13AddTrader/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts b/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts +++ b/TypeScript/13AddTrader/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts +++ b/TypeScript/13AddTrader/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/Money.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/Money.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/Traders.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/enums/Traders.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IItemConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/15HttpListenerExample/types/models/enums/Money.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/Money.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/15HttpListenerExample/types/models/enums/Traders.d.ts b/TypeScript/15HttpListenerExample/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/15HttpListenerExample/types/models/enums/Traders.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IItemConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/15HttpListenerExample/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/15HttpListenerExample/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts b/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts b/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts b/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts b/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts +++ b/TypeScript/15HttpListenerExample/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts +++ b/TypeScript/15HttpListenerExample/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/16ImporterUtil/types/models/enums/Money.d.ts b/TypeScript/16ImporterUtil/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/Money.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/16ImporterUtil/types/models/enums/Traders.d.ts b/TypeScript/16ImporterUtil/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/16ImporterUtil/types/models/enums/Traders.d.ts +++ b/TypeScript/16ImporterUtil/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IItemConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/16ImporterUtil/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/16ImporterUtil/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/16ImporterUtil/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/16ImporterUtil/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/16ImporterUtil/types/services/GiftService.d.ts b/TypeScript/16ImporterUtil/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/16ImporterUtil/types/services/GiftService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/16ImporterUtil/types/services/ItemFilterService.d.ts b/TypeScript/16ImporterUtil/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/16ImporterUtil/types/services/ItemFilterService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts b/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts b/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts +++ b/TypeScript/16ImporterUtil/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Money.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Money.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Traders.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Traders.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IItemConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/ItemFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Money.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Money.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Traders.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Traders.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IItemConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemFilterService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/ItemFilterService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts b/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/18CustomItemService/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/18CustomItemService/types/controllers/BotController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/18CustomItemService/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/18CustomItemService/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts +++ b/TypeScript/18CustomItemService/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/18CustomItemService/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/18CustomItemService/types/models/enums/Money.d.ts b/TypeScript/18CustomItemService/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/18CustomItemService/types/models/enums/Money.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/18CustomItemService/types/models/enums/Traders.d.ts b/TypeScript/18CustomItemService/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/18CustomItemService/types/models/enums/Traders.d.ts +++ b/TypeScript/18CustomItemService/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IItemConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/18CustomItemService/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/18CustomItemService/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/18CustomItemService/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/18CustomItemService/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/18CustomItemService/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/18CustomItemService/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/18CustomItemService/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/18CustomItemService/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/18CustomItemService/types/services/GiftService.d.ts b/TypeScript/18CustomItemService/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/18CustomItemService/types/services/GiftService.d.ts +++ b/TypeScript/18CustomItemService/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/18CustomItemService/types/services/ItemFilterService.d.ts b/TypeScript/18CustomItemService/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/18CustomItemService/types/services/ItemFilterService.d.ts +++ b/TypeScript/18CustomItemService/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts b/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/18CustomItemService/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts b/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts +++ b/TypeScript/18CustomItemService/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts +++ b/TypeScript/18CustomItemService/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts b/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/19UseExternalLibraries/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/19UseExternalLibraries/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/19UseExternalLibraries/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts +++ b/TypeScript/19UseExternalLibraries/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/Money.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/Money.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/19UseExternalLibraries/types/models/enums/Traders.d.ts b/TypeScript/19UseExternalLibraries/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/19UseExternalLibraries/types/models/enums/Traders.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IItemConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/19UseExternalLibraries/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/19UseExternalLibraries/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/19UseExternalLibraries/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/19UseExternalLibraries/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/19UseExternalLibraries/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts b/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/19UseExternalLibraries/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts b/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/19UseExternalLibraries/types/services/ItemFilterService.d.ts b/TypeScript/19UseExternalLibraries/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/19UseExternalLibraries/types/services/ItemFilterService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts b/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts b/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts +++ b/TypeScript/19UseExternalLibraries/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts b/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts +++ b/TypeScript/19UseExternalLibraries/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/1LogToConsole/types/controllers/BotController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/1LogToConsole/types/models/enums/Money.d.ts b/TypeScript/1LogToConsole/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/1LogToConsole/types/models/enums/Money.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/1LogToConsole/types/models/enums/Traders.d.ts b/TypeScript/1LogToConsole/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/1LogToConsole/types/models/enums/Traders.d.ts +++ b/TypeScript/1LogToConsole/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IItemConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/1LogToConsole/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/1LogToConsole/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/1LogToConsole/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/1LogToConsole/types/services/GiftService.d.ts b/TypeScript/1LogToConsole/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/1LogToConsole/types/services/GiftService.d.ts +++ b/TypeScript/1LogToConsole/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts b/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts +++ b/TypeScript/1LogToConsole/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/1LogToConsole/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts +++ b/TypeScript/1LogToConsole/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts +++ b/TypeScript/1LogToConsole/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts b/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/20CustomChatBot/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts b/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/20CustomChatBot/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/20CustomChatBot/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/20CustomChatBot/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/20CustomChatBot/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/20CustomChatBot/types/helpers/TradeHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/20CustomChatBot/types/helpers/TradeHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts b/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts +++ b/TypeScript/20CustomChatBot/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/20CustomChatBot/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/20CustomChatBot/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/20CustomChatBot/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/20CustomChatBot/types/models/enums/Money.d.ts b/TypeScript/20CustomChatBot/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/Money.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/20CustomChatBot/types/models/enums/Traders.d.ts b/TypeScript/20CustomChatBot/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/20CustomChatBot/types/models/enums/Traders.d.ts +++ b/TypeScript/20CustomChatBot/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IItemConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/20CustomChatBot/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/20CustomChatBot/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/20CustomChatBot/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/20CustomChatBot/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/20CustomChatBot/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/20CustomChatBot/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/20CustomChatBot/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts b/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/20CustomChatBot/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/20CustomChatBot/types/services/GiftService.d.ts b/TypeScript/20CustomChatBot/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/20CustomChatBot/types/services/GiftService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/20CustomChatBot/types/services/ItemFilterService.d.ts b/TypeScript/20CustomChatBot/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/20CustomChatBot/types/services/ItemFilterService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts b/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts b/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts +++ b/TypeScript/20CustomChatBot/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts b/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts +++ b/TypeScript/20CustomChatBot/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts b/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/TradeHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/TradeHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts b/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/Money.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/Money.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/enums/Traders.d.ts b/TypeScript/21CustomCommandoCommand/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/enums/Traders.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IItemConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/21CustomCommandoCommand/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/21CustomCommandoCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/21CustomCommandoCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/21CustomCommandoCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts b/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/21CustomCommandoCommand/types/services/ItemFilterService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/ItemFilterService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts b/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts b/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts +++ b/TypeScript/21CustomCommandoCommand/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts b/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/22CustomAkiCommand/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/22CustomAkiCommand/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/22CustomAkiCommand/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/22CustomAkiCommand/types/helpers/TradeHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/TradeHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts b/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts +++ b/TypeScript/22CustomAkiCommand/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/Money.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/Money.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/22CustomAkiCommand/types/models/enums/Traders.d.ts b/TypeScript/22CustomAkiCommand/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/22CustomAkiCommand/types/models/enums/Traders.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IItemConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/22CustomAkiCommand/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/22CustomAkiCommand/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/22CustomAkiCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/22CustomAkiCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/22CustomAkiCommand/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts b/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/22CustomAkiCommand/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts b/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/22CustomAkiCommand/types/services/ItemFilterService.d.ts b/TypeScript/22CustomAkiCommand/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/22CustomAkiCommand/types/services/ItemFilterService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts b/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts b/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts +++ b/TypeScript/22CustomAkiCommand/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts b/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts +++ b/TypeScript/22CustomAkiCommand/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/2EditDatabase/types/controllers/BotController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/2EditDatabase/types/models/enums/Money.d.ts b/TypeScript/2EditDatabase/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/2EditDatabase/types/models/enums/Money.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/2EditDatabase/types/models/enums/Traders.d.ts b/TypeScript/2EditDatabase/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/2EditDatabase/types/models/enums/Traders.d.ts +++ b/TypeScript/2EditDatabase/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IItemConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/2EditDatabase/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/2EditDatabase/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/2EditDatabase/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/2EditDatabase/types/services/GiftService.d.ts b/TypeScript/2EditDatabase/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/2EditDatabase/types/services/GiftService.d.ts +++ b/TypeScript/2EditDatabase/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts b/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts +++ b/TypeScript/2EditDatabase/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/2EditDatabase/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts b/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts +++ b/TypeScript/2EditDatabase/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts +++ b/TypeScript/2EditDatabase/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/Money.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/Money.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/Traders.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/3GetSptConfigFile/types/models/enums/Traders.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IItemConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/3GetSptConfigFile/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts b/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts b/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/3GetSptConfigFile/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Money.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Money.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Traders.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Traders.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IItemConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemFilterService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemFilterService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/4.1UseACustomJson5OrJsonCConfigFile/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/Money.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/Money.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/Traders.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/enums/Traders.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IItemConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/5ReplaceMethod/types/models/enums/Money.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/Money.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/5ReplaceMethod/types/models/enums/Traders.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/5ReplaceMethod/types/models/enums/Traders.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IItemConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/5ReplaceMethod/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts b/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts b/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts b/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts +++ b/TypeScript/5ReplaceMethod/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/Money.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/Money.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/Traders.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/enums/Traders.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IItemConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/7OnLoadHook/types/models/enums/Money.d.ts b/TypeScript/7OnLoadHook/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/Money.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/7OnLoadHook/types/models/enums/Traders.d.ts b/TypeScript/7OnLoadHook/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/7OnLoadHook/types/models/enums/Traders.d.ts +++ b/TypeScript/7OnLoadHook/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IItemConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/7OnLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/7OnLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/7OnLoadHook/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/7OnLoadHook/types/services/GiftService.d.ts b/TypeScript/7OnLoadHook/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/7OnLoadHook/types/services/GiftService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts b/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts b/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts b/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/7OnLoadHook/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/8OnUpdateHook/types/models/enums/Money.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/Money.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/8OnUpdateHook/types/models/enums/Traders.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/8OnUpdateHook/types/models/enums/Traders.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IItemConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/8OnUpdateHook/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts b/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts b/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts b/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts b/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts +++ b/TypeScript/8OnUpdateHook/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object diff --git a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts index 43abcfc..7d22dcf 100644 --- a/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/BotCallbacks.d.ts @@ -34,7 +34,7 @@ export declare class BotCallbacks { * Handle singleplayer/settings/bot/maxCap * @returns string */ - getBotCap(): string; + getBotCap(url: string, info: any, sessionID: string): string; /** * Handle singleplayer/settings/bot/getBotBehaviours * @returns string diff --git a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts index f7e81fe..41f1d0c 100644 --- a/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/DataCallbacks.d.ts @@ -1,5 +1,6 @@ import { HideoutController } from "@spt/controllers/HideoutController"; import { RagfairController } from "@spt/controllers/RagfairController"; +import { TraderHelper } from "@spt/helpers/TraderHelper"; import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IGlobals } from "@spt/models/eft/common/IGlobals"; import { ICustomizationItem } from "@spt/models/eft/common/tables/ICustomizationItem"; @@ -13,15 +14,18 @@ import { IGetBodyResponseData } from "@spt/models/eft/httpResponse/IGetBodyRespo import { ISettingsBase } from "@spt/models/spt/server/ISettingsBase"; import { DatabaseService } from "@spt/services/DatabaseService"; import { HttpResponseUtil } from "@spt/utils/HttpResponseUtil"; +import { TimeUtil } from "@spt/utils/TimeUtil"; /** * Handle client requests */ export declare class DataCallbacks { protected httpResponse: HttpResponseUtil; + protected timeUtil: TimeUtil; + protected traderHelper: TraderHelper; protected databaseService: DatabaseService; protected ragfairController: RagfairController; protected hideoutController: HideoutController; - constructor(httpResponse: HttpResponseUtil, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); + constructor(httpResponse: HttpResponseUtil, timeUtil: TimeUtil, traderHelper: TraderHelper, databaseService: DatabaseService, ragfairController: RagfairController, hideoutController: HideoutController); /** * Handle client/settings * @returns ISettingsBase diff --git a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts index 181fe67..94f6ab8 100644 --- a/TypeScript/9RouterHooks/types/controllers/BotController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/BotController.d.ts @@ -102,7 +102,7 @@ export declare class BotController { */ protected generateWithBotDetails(condition: Condition, botGenerationDetails: BotGenerationDetails, sessionId: string): Promise; /** - * Generate a single bot and store it in the cache + * Generate a single bot and store in the cache * @param botGenerationDetails the bot details to generate the bot with * @param sessionId Session id * @param cacheKey the cache key to store the bot with @@ -125,8 +125,9 @@ export declare class BotController { /** * Get the max number of bots allowed on a map * Looks up location player is entering when getting cap value + * @param location The map location cap was requested for * @returns cap number */ - getBotCap(): number; + getBotCap(location: string): number; getAiBotBrainTypes(): any; } diff --git a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts index 46dfe26..789fc00 100644 --- a/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/LauncherController.d.ts @@ -36,7 +36,7 @@ export declare class LauncherController { * @returns Dictionary of profile types with related descriptive text */ protected getProfileDescriptions(): Record; - find(sessionIdKey: string): Info; + find(sessionId: string): Info; login(info: ILoginRequestData): string; register(info: IRegisterData): string; protected createAccount(info: IRegisterData): string; diff --git a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts index 5d35cdf..d500c1b 100644 --- a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts @@ -10,6 +10,7 @@ import { IMiniProfile } from "@spt/models/eft/launcher/IMiniProfile"; import { GetProfileStatusResponseData } from "@spt/models/eft/profile/GetProfileStatusResponseData"; import { IGetOtherProfileRequest } from "@spt/models/eft/profile/IGetOtherProfileRequest"; import { IGetOtherProfileResponse } from "@spt/models/eft/profile/IGetOtherProfileResponse"; +import { IGetProfileSettingsRequest } from "@spt/models/eft/profile/IGetProfileSettingsRequest"; import { IProfileChangeNicknameRequestData } from "@spt/models/eft/profile/IProfileChangeNicknameRequestData"; import { IProfileChangeVoiceRequestData } from "@spt/models/eft/profile/IProfileChangeVoiceRequestData"; import { IProfileCreateRequestData } from "@spt/models/eft/profile/IProfileCreateRequestData"; @@ -25,11 +26,13 @@ import { LocalisationService } from "@spt/services/LocalisationService"; import { MailSendService } from "@spt/services/MailSendService"; import { ProfileFixerService } from "@spt/services/ProfileFixerService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; +import { ICloner } from "@spt/utils/cloners/ICloner"; import { HashUtil } from "@spt/utils/HashUtil"; import { TimeUtil } from "@spt/utils/TimeUtil"; export declare class ProfileController { protected logger: ILogger; protected hashUtil: HashUtil; + protected cloner: ICloner; protected timeUtil: TimeUtil; protected saveServer: SaveServer; protected databaseService: DatabaseService; @@ -45,7 +48,7 @@ export declare class ProfileController { protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; protected defaultInventoryTpl: string; - constructor(logger: ILogger, hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(logger: ILogger, hashUtil: HashUtil, cloner: ICloner, timeUtil: TimeUtil, saveServer: SaveServer, databaseService: DatabaseService, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, localisationService: LocalisationService, seasonalEventService: SeasonalEventService, mailSendService: MailSendService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); /** * Handle /launcher/profiles */ @@ -53,7 +56,7 @@ export declare class ProfileController { /** * Handle launcher/profile/info */ - getMiniProfile(sessionID: string): any; + getMiniProfile(sessionID: string): IMiniProfile; /** * Handle client/game/profile/list */ @@ -117,4 +120,8 @@ export declare class ProfileController { */ getProfileStatus(sessionId: string): GetProfileStatusResponseData; getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse; + /** + * Handle client/profile/settings + */ + setChosenProfileIcon(sessionId: string, request: IGetProfileSettingsRequest): void; } diff --git a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts index 94416bf..5a771ca 100644 --- a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts @@ -90,6 +90,7 @@ export declare class QuestController { * @returns IItemEventRouterResponse */ acceptRepeatableQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; + protected createAcceptedQuestClientResponse(sessionID: string, pmcData: IPmcData, repeatableQuestProfile: IRepeatableQuest): IItemEventRouterResponse; /** * Look for an accepted quest inside player profile, return matching * @param pmcData Profile to search through diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index aa7d106..a96a855 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -2,7 +2,6 @@ import { RepeatableQuestGenerator } from "@spt/generators/RepeatableQuestGenerat import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { QuestHelper } from "@spt/helpers/QuestHelper"; import { RepeatableQuestHelper } from "@spt/helpers/RepeatableQuestHelper"; -import { IEmptyRequestData } from "@spt/models/eft/common/IEmptyRequestData"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -62,12 +61,31 @@ export declare class RepeatableQuestController { * (if the are on "Succeed" but not "Completed" we keep them, to allow the player to complete them and get the rewards) * The new quests generated are again persisted in profile.RepeatableQuests * - * @param {string} _info Request from client * @param {string} sessionID Player's session id * * @returns {array} Array of "repeatableQuestObjects" as described above */ - getClientRepeatableQuests(_info: IEmptyRequestData, sessionID: string): IPmcDataRepeatableQuest[]; + getClientRepeatableQuests(sessionID: string): IPmcDataRepeatableQuest[]; + /** + * Check if a repeatable quest type (daily/weekly) is active for the given profile + * @param repeatableConfig Repeatable quest config + * @param pmcData Player profile + * @returns True if profile is allowed to access dailies + */ + protected canProfileAccessRepeatableQuests(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): boolean; + /** + * Does player have daily scav quests unlocked + * @param pmcData Player profile to check + * @returns True if unlocked + */ + protected playerHasDailyScavQuestsUnlocked(pmcData: IPmcData): boolean; + /** + * Does player have daily pmc quests unlocked + * @param pmcData Player profile to check + * @param repeatableConfig Config of daily type to check + * @returns True if unlocked + */ + protected playerHasDailyPmcQuestsUnlocked(pmcData: IPmcData, repeatableConfig: IRepeatableQuestConfig): boolean; /** * Get the number of quests to generate - takes into account charisma state of player * @param repeatableConfig Config @@ -99,10 +117,10 @@ export declare class RepeatableQuestController { /** * Return the locations this PMC is allowed to get daily quests for based on their level * @param locations The original list of locations - * @param pmcLevel The level of the player PMC + * @param pmcLevel The players level * @returns A filtered list of locations that allow the player PMC level to access it */ - protected getAllowedLocations(locations: Record, pmcLevel: number): Partial>; + protected getAllowedLocationsForPmcLevel(locations: Record, pmcLevel: number): Partial>; /** * Return true if the given pmcLevel is allowed on the given location * @param location The location name to check @@ -113,6 +131,12 @@ export declare class RepeatableQuestController { debugLogRepeatableQuestIds(pmcData: IPmcData): void; /** * Handle RepeatableQuestChange event + * + * Replace a players repeatable quest + * @param pmcData Player profile + * @param changeRequest Request object + * @param sessionID Session id + * @returns IItemEventRouterResponse */ changeRepeatableQuest(pmcData: IPmcData, changeRequest: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse; protected attemptToGenerateRepeatableQuest(pmcData: IPmcData, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IRepeatableQuest; diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index cb2699d..7ff2a0d 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -5,7 +5,7 @@ import { BotHelper } from "@spt/helpers/BotHelper"; import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IBaseJsonSkills, IBaseSkill, IBotBase, Info, Health as PmcHealth, Skills as botSkills } from "@spt/models/eft/common/tables/IBotBase"; -import { Appearance, Health, IBotType } from "@spt/models/eft/common/tables/IBotType"; +import { Appearance, Health, IBotType, Inventory } from "@spt/models/eft/common/tables/IBotType"; import { BotGenerationDetails } from "@spt/models/spt/bots/BotGenerationDetails"; import { IBotConfig } from "@spt/models/spt/config/IBotConfig"; import { IPmcConfig } from "@spt/models/spt/config/IPmcConfig"; @@ -13,6 +13,7 @@ import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { BotEquipmentFilterService } from "@spt/services/BotEquipmentFilterService"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -34,11 +35,12 @@ export declare class BotGenerator { protected botDifficultyHelper: BotDifficultyHelper; protected seasonalEventService: SeasonalEventService; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected botConfig: IBotConfig; protected pmcConfig: IPmcConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, profileHelper: ProfileHelper, databaseService: DatabaseService, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot @@ -54,6 +56,14 @@ export declare class BotGenerator { * @returns constructed bot */ prepareAndGenerateBot(sessionId: string, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Get a clone of the default bot base object and adjust its role/side/difficulty values + * @param botRole Role bot should have + * @param botSide Side bot should have + * @param difficulty Difficult bot should have + * @returns Cloned bot base + */ + protected getPreparedBotBase(botRole: string, botSide: string, difficulty: string): IBotBase; /** * Get a clone of the database\bots\base.json file * @returns IBotBase object @@ -62,12 +72,17 @@ export declare class BotGenerator { /** * Create a IBotBase object with equipment/loot/exp etc * @param sessionId Session id - * @param bot bots base file + * @param bot Bots base file * @param botJsonTemplate Bot template from db/bots/x.json * @param botGenerationDetails details on how to generate the bot * @returns IBotBase object */ protected generateBot(sessionId: string, bot: IBotBase, botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails): IBotBase; + /** + * Remove items from item.json/lootableItemBlacklist from bots inventory + * @param botInventory Bot to filter + */ + protected removeBlacklistedLootFromBotTemplate(botInventory: Inventory): void; /** * Choose various appearance settings for a bot using weights * @param bot Bot to adjust @@ -80,10 +95,12 @@ export declare class BotGenerator { * @param botJsonTemplate x.json from database * @param botGenerationDetails * @param botRole role of bot e.g. assault - * @param sessionId profile session id + * @param sessionId OPTIONAL: profile session id * @returns Nickname for bot */ protected generateBotNickname(botJsonTemplate: IBotType, botGenerationDetails: BotGenerationDetails, botRole: string, sessionId?: string): string; + protected shouldSimulatePlayerScavName(botRole: string, isPlayerScav: boolean): boolean; + protected addPlayerScavNameSimulationSuffix(nickname: string): string; /** * Log the number of PMCs generated to the debug console * @param output Generated bot array, ready to send to client @@ -110,12 +127,17 @@ export declare class BotGenerator { */ protected getSkillsWithRandomisedProgressValue(skills: Record, isCommonSkills: boolean): IBaseSkill[]; /** - * Generate a random Id for a bot and apply to bots _id and aid value + * Generate an id+aid for a bot and apply * @param bot bot to update * @returns updated IBotBase object */ - protected generateId(bot: IBotBase): void; - protected generateInventoryID(profile: IBotBase): void; + protected addIdsToBot(bot: IBotBase): void; + /** + * Update a profiles profile.Inventory.equipment value with a freshly generated one + * Update all inventory items that make use of this value too + * @param profile Profile to update + */ + protected generateInventoryId(profile: IBotBase): void; /** * Randomise a bots game version and account category * Chooses from all the game versions (standard, eod etc) diff --git a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index 73fbf61..fee56ce 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -60,7 +60,7 @@ export declare class BotLootGenerator { /** * Force healing items onto bot to ensure they can heal in-raid * @param botInventory Inventory to add items to - * @param botRole Role of bot (sptBear/sptUsec) + * @param botRole Role of bot (pmcBEAR/pmcUSEC) */ protected addForcedMedicalItemsToPmcSecure(botInventory: PmcInventory, botRole: string): void; /** diff --git a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts index 96c0ecd..222b0ab 100644 --- a/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/LocationGenerator.d.ts @@ -9,6 +9,7 @@ import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; +import { ItemFilterService } from "@spt/services/ItemFilterService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { SeasonalEventService } from "@spt/services/SeasonalEventService"; import { ICloner } from "@spt/utils/cloners/ICloner"; @@ -37,14 +38,15 @@ export declare class LocationGenerator { protected containerHelper: ContainerHelper; protected presetHelper: PresetHelper; protected localisationService: LocalisationService; + protected itemFilterService: ItemFilterService; protected configServer: ConfigServer; protected cloner: ICloner; protected locationConfig: ILocationConfig; - constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, configServer: ConfigServer, cloner: ICloner); + constructor(logger: ILogger, databaseService: DatabaseService, objectId: ObjectId, randomUtil: RandomUtil, itemHelper: ItemHelper, mathUtil: MathUtil, seasonalEventService: SeasonalEventService, containerHelper: ContainerHelper, presetHelper: PresetHelper, localisationService: LocalisationService, itemFilterService: ItemFilterService, configServer: ConfigServer, cloner: ICloner); /** * Create an array of container objects with randomised loot * @param locationBase Map base to generate containers for - * @param staticAmmoDist Static ammo distribution - database.loot.staticAmmo + * @param staticAmmoDist Static ammo distribution * @returns Array of container objects */ generateStaticContainers(locationBase: ILocationBase, staticAmmoDist: Record): SpawnpointTemplate[]; diff --git a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts index 7dc88aa..436aad0 100644 --- a/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/RepeatableQuestRewardGenerator.d.ts @@ -4,7 +4,8 @@ import { PresetHelper } from "@spt/helpers/PresetHelper"; import { Item } from "@spt/models/eft/common/tables/IItem"; import { IQuestReward, IQuestRewards } from "@spt/models/eft/common/tables/IQuest"; import { ITemplateItem } from "@spt/models/eft/common/tables/ITemplateItem"; -import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig } from "@spt/models/spt/config/IQuestConfig"; +import { IBaseQuestConfig, IQuestConfig, IRepeatableQuestConfig, IRewardScaling } from "@spt/models/spt/config/IQuestConfig"; +import { IQuestRewardValues } from "@spt/models/spt/repeatable/IQuestRewardValues"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseService } from "@spt/services/DatabaseService"; @@ -52,6 +53,29 @@ export declare class RepeatableQuestRewardGenerator { * @returns {object} object of "Reward"-type that can be given for a repeatable mission */ generateReward(pmcLevel: number, difficulty: number, traderId: string, repeatableConfig: IRepeatableQuestConfig, questConfig: IBaseQuestConfig): IQuestRewards; + protected getQuestRewardValues(rewardScaling: IRewardScaling, difficulty: number, pmcLevel: number): IQuestRewardValues; + /** + * Get an array of items + stack size to give to player as reward that fit inside of a rouble budget + * @param itemPool All possible items to choose rewards from + * @param maxItemCount Total number of items to reward + * @param itemRewardBudget Rouble buget all item rewards must fit in + * @param repeatableConfig config for quest type + * @returns Items and stack size + */ + protected getRewardableItemsFromPoolWithinBudget(itemPool: ITemplateItem[], maxItemCount: number, itemRewardBudget: number, repeatableConfig: IRepeatableQuestConfig): { + item: ITemplateItem; + stackSize: number; + }[]; + /** + * Choose a random Weapon preset that fits inside of a rouble amount limit + * @param roublesBudget + * @param rewardIndex + * @returns IQuestReward + */ + protected getRandomWeaponPresetWithinBudget(roublesBudget: number, rewardIndex: number): { + weapon: IQuestReward; + price: number; + } | undefined; /** * @param rewardItems List of reward items to filter * @param roublesBudget The budget remaining for rewards @@ -62,21 +86,31 @@ export declare class RepeatableQuestRewardGenerator { /** * Get a randomised number a reward items stack size should be based on its handbook price * @param item Reward item to get stack size for - * @returns Stack size value + * @returns matching stack size for the passed in items price */ protected getRandomisedRewardItemStackSizeByPrice(item: ITemplateItem): number; /** * Should reward item have stack size increased (25% chance) - * @param item Item to possibly increase stack size of + * @param item Item to increase reward stack size of * @param maxRoublePriceToStack Maximum rouble price an item can be to still be chosen for stacking - * @returns True if it should + * @param randomChanceToPass Additional randomised chance of passing + * @returns True if items stack size can be increased + */ + protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number, randomChanceToPass?: number): boolean; + /** + * Get a count of cartridges that fits the rouble budget amount provided + * e.g. how many M80s for 50,000 roubles + * @param itemSelected Cartridge + * @param roublesBudget Rouble budget + * @param rewardNumItems + * @returns Count that fits budget (min 1) */ - protected canIncreaseRewardItemStackSize(item: ITemplateItem, maxRoublePriceToStack: number): boolean; protected calculateAmmoStackSizeThatFitsBudget(itemSelected: ITemplateItem, roublesBudget: number, rewardNumItems: number): number; /** * Select a number of items that have a colelctive value of the passed in parameter * @param repeatableConfig Config * @param roublesBudget Total value of items to return + * @param traderId Id of the trader who will give player reward * @returns Array of reward items that fit budget */ protected chooseRewardItemsWithinBudget(repeatableConfig: IRepeatableQuestConfig, roublesBudget: number, traderId: string): ITemplateItem[]; @@ -86,12 +120,18 @@ export declare class RepeatableQuestRewardGenerator { * @param {string} tpl ItemId of the rewarded item * @param {integer} value Amount of items to give * @param {integer} index All rewards will be appended to a list, for unknown reasons the client wants the index + * @param preset Optional array of preset items * @returns {object} Object of "Reward"-item-type */ protected generateRewardItem(tpl: string, value: number, index: number, preset?: Item[]): IQuestReward; /** - * Picks rewardable items from items.json. This means they need to fit into the inventory and they shouldn't be keys (debatable) + * Picks rewardable items from items.json + * This means they must: + * - Fit into the inventory + * - Shouldn't be keys + * - Have a price greater than 0 * @param repeatableQuestConfig Config file + * @param traderId Id of trader who will give reward to player * @returns List of rewardable items [[_tpl, itemTemplate],...] */ getRewardableItems(repeatableQuestConfig: IRepeatableQuestConfig, traderId: string): [string, ITemplateItem][]; @@ -102,5 +142,5 @@ export declare class RepeatableQuestRewardGenerator { * @returns True if item is valid reward */ protected isValidRewardItem(tpl: string, repeatableQuestConfig: IRepeatableQuestConfig, itemBaseWhitelist: string[]): boolean; - protected addMoneyReward(traderId: string, rewards: IQuestRewards, rewardRoubles: number, rewardIndex: number): void; + protected getMoneyReward(traderId: string, rewardRoubles: number, rewardIndex: number): IQuestReward; } diff --git a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts index facc597..63572a5 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotDifficultyHelper.d.ts @@ -21,8 +21,8 @@ export declare class BotDifficultyHelper { * Get a difficulty object modified to handle fighting other PMCs * @param pmcType 'bear or 'usec' * @param difficulty easy / normal / hard / impossible - * @param usecType sptUsec - * @param bearType sptBear + * @param usecType pmcUSEC + * @param bearType pmcBEAR * @returns Difficulty object */ getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty; diff --git a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts index 811306b..eea8ff8 100644 --- a/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/BotHelper.d.ts @@ -56,12 +56,12 @@ export declare class BotHelper { */ getBotRandomizationDetails(botLevel: number, botEquipConfig: EquipmentFilters): RandomisationDetails | undefined; /** - * Choose between sptBear and sptUsec at random based on the % defined in pmcConfig.isUsec + * Choose between pmcBEAR and pmcUSEC at random based on the % defined in pmcConfig.isUsec * @returns pmc role */ getRandomizedPmcRole(): string; /** - * Get the corresponding side when sptBear or sptUsec is passed in + * Get the corresponding side when pmcBEAR or pmcUSEC is passed in * @param botRole role to get side for * @returns side (usec/bear) */ diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 34a2973..0e86b0c 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -416,7 +416,7 @@ export declare class ItemHelper { /** * Get the name of an item from the locale file using the item tpl * @param itemTpl Tpl of item to get name of - * @returns Name of item + * @returns Full name, short name if not found */ getItemName(itemTpl: string): string; /** diff --git a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts index e943bd3..a52d565 100644 --- a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts @@ -42,10 +42,10 @@ export declare class ProfileHelper { getProfiles(): Record; /** * Get the pmc and scav profiles as an array by profile id - * @param sessionID + * @param sessionId * @returns Array of IPmcData objects */ - getCompleteProfile(sessionID: string): IPmcData[]; + getCompleteProfile(sessionId: string): IPmcData[]; /** * Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen * Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using @@ -58,12 +58,12 @@ export declare class ProfileHelper { * @param scavProfile post-raid scav profile * @returns Updated profile array */ - protected postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[]; + protected postRaidXpWorkaroundFix(sessionId: string, pmcProfile: IPmcData, scavProfile: IPmcData, output: IPmcData[]): IPmcData[]; /** * Check if a nickname is used by another profile loaded by the server * @param nicknameRequest nickname request object * @param sessionID Session id - * @returns True if already used + * @returns True if already in use */ isNicknameTaken(nicknameRequest: IValidateNicknameRequestData, sessionID: string): boolean; protected profileHasInfoProperty(profile: ISptProfile): boolean; @@ -79,10 +79,10 @@ export declare class ProfileHelper { * @param pmcId Profile id to find * @returns IPmcData */ - getProfileByPmcId(pmcId: string): IPmcData; + getProfileByPmcId(pmcId: string): IPmcData | undefined; /** - * Get the experiecne for the given level - * @param level level to get xp for + * Get experience value for given level + * @param level Level to get xp for * @returns Number of xp points for level */ getExperience(level: number): number; @@ -105,9 +105,9 @@ export declare class ProfileHelper { */ getPmcProfile(sessionID: string): IPmcData | undefined; /** - * Is this user id the logged in player - * @param userId Id to test - * @returns True is the current player + * Is given user id a player + * @param userId Id to validate + * @returns True is a player */ isPlayer(userId: string): boolean; /** @@ -127,7 +127,6 @@ export declare class ProfileHelper { * @returns True if profile is to be wiped of data/progress */ protected isWiped(sessionID: string): boolean; - protected getServerVersion(): string; /** * Iterate over player profile inventory items and find the secure container and remove it * @param profile Profile to remove secure container from @@ -139,15 +138,17 @@ export declare class ProfileHelper { * Store giftid in profile spt object * @param playerId Player to add gift flag to * @param giftId Gift player received + * @param maxCount Limit of how many of this gift a player can have */ - addGiftReceivedFlagToProfile(playerId: string, giftId: string): void; + flagGiftReceivedInProfile(playerId: string, giftId: string, maxCount: number): void; /** * Check if profile has recieved a gift by id * @param playerId Player profile to check for gift * @param giftId Gift to check for + * @param maxGiftCount Max times gift can be given to player * @returns True if player has recieved gift previously */ - playerHasRecievedGift(playerId: string, giftId: string): boolean; + playerHasRecievedMaxNumberOfGift(playerId: string, giftId: string, maxGiftCount: number): boolean; /** * Find Stat in profile counters and increment by one * @param counters Counters to search for key @@ -189,4 +190,11 @@ export declare class ProfileHelper { * @param rowsToAdd How many rows to give profile */ addStashRowsBonusToProfile(sessionId: string, rowsToAdd: number): void; + playerIsFleaBanned(pmcProfile: IPmcData): boolean; + /** + * Add an achievement to player profile + * @param pmcProfile Profile to add achievement to + * @param achievementId Id of achievement to add + */ + addAchievementToProfile(pmcProfile: IPmcData, achievementId: string): void; } diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts index a08e60a..87d152e 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts @@ -177,7 +177,7 @@ export declare class RagfairOfferHelper { * @param pmcProfile Player profile * @returns True = should be shown to player */ - isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData): boolean; + isDisplayableOffer(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, offer: IRagfairOffer, pmcProfile: IPmcData, playerIsFleaBanned?: boolean): boolean; isDisplayableOfferThatNeedsItem(searchRequest: ISearchRequestData, offer: IRagfairOffer): boolean; /** * Does the passed in item have a condition property diff --git a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts index 7bb999c..f994fda 100644 --- a/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TradeHelper.d.ts @@ -59,10 +59,11 @@ export declare class TradeHelper { /** * Traders allow a limited number of purchases per refresh cycle (default 60 mins) * @param sessionId Session id + * @param pmcData Profile making the purchase * @param traderId Trader assort is purchased from * @param assortBeingPurchased the item from trader being bought * @param assortId Id of assort being purchased * @param count How many of the item are being bought */ - protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; + protected checkPurchaseIsWithinTraderItemLimit(sessionId: string, pmcData: IPmcData, traderId: string, assortBeingPurchased: Item, assortId: string, count: number): void; } diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index eec1cc7..52c0d9b 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -31,8 +31,6 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader sell rouble price */ protected highestTraderPriceItems?: Record; - /** Dictionary of item tpl and the highest trader buy back rouble price */ - protected highestTraderBuyPriceItems?: Record; constructor(logger: ILogger, databaseService: DatabaseService, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, itemHelper: ItemHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, randomUtil: RandomUtil, configServer: ConfigServer); /** * Get a trader base object, update profile to reflect players current standing in profile @@ -133,6 +131,13 @@ export declare class TraderHelper { }[]; traderId: string; }, itemPurchased: Item): void; + /** + * EoD and Unheard get a 20% bonus to personal trader limit purchases + * @param buyRestrictionMax Existing value from trader item + * @param gameVersion Profiles game version + * @returns buyRestrictionMax value + */ + getAccountTypeAdjustedTraderPurchaseLimit(buyRestrictionMax: number, gameVersion: string): number; /** * Get the highest rouble price for an item from traders * UNUSED diff --git a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts index a0bb051..e4ff654 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/IGlobals.d.ts @@ -31,7 +31,6 @@ export interface IConfig { TradingUnlimitedItems: boolean; MaxLoyaltyLevelForAll: boolean; GlobalLootChanceModifier: number; - GlobalLootChanceModifierPvE: number; GraphicSettings: IGraphicSettings; TimeBeforeDeploy: number; TimeBeforeDeployLocal: number; @@ -49,6 +48,7 @@ export interface IConfig { BotsEnabled: boolean; BufferZone: IBufferZone; ArmorMaterials: IArmorMaterials; + ArenaEftTransferSettings: IArenaEftTransferSettings; LegsOverdamage: number; HandsOverdamage: number; StomachOverdamage: number; @@ -76,6 +76,7 @@ export interface IConfig { SkillPointsBeforeFatigue: number; SkillFatigueReset: number; DiscardLimitsEnabled: boolean; + EnvironmentSettings: IEnvironmentSetting2; EventSettings: IEventSettings; FavoriteItemsSettings: IFavoriteItemsSettings; VaultingSettings: IVaultingSettings; @@ -102,6 +103,12 @@ export interface IConfig { Ballistic: IBallistic; RepairSettings: IRepairSettings; } +export interface IEnvironmentSetting2 { + EnvironmentUIData: IEnvironmentUIData; +} +export interface IEnvironmentUIData { + TheUnheardEditionEnvironmentUiType: string[]; +} export interface IBodyPartColliderSettings { BackHead: IBodyPartColliderPart; Ears: IBodyPartColliderPart; @@ -178,8 +185,12 @@ export interface IItemsCommonSettings { ItemRemoveAfterInterruptionTime: number; } export interface ITradingSettings { + BuyRestrictionMaxBonus: Record; BuyoutRestrictions: IBuyoutRestrictions; } +export interface IBuyRestrictionMaxBonus { + multiplier: number; +} export interface IBuyoutRestrictions { MinDurability: number; MinFoodDrinkResource: number; @@ -381,6 +392,17 @@ export interface IBodyParts { Feet: string; Hands: string; } +export interface IArenaEftTransferSettings { + ArenaEftTransferSettings: ArenaEftTransferSettings; +} +export interface ArenaEftTransferSettings { + ArenaManagerReputationTaxMultiplier: number; + CharismaTaxMultiplier: number; + CreditPriceTaxMultiplier: number; + RubTaxMultiplier: number; + TransferLimitsByGameEdition: Record; + TransferLimitsSettings: Record; +} export interface IArmorMaterials { UHMWPE: IArmorType; Aramid: IArmorType; @@ -802,6 +824,7 @@ export interface IMaxActiveOfferCount { from: number; to: number; count: number; + countForSpecialEditions: number; } export interface IMaxSumForRarity { Common: IRarityMaxSum; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts index 06c1604..a7fe1ca 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IBotBase.d.ts @@ -35,9 +35,17 @@ export interface IBotBase { CoopExtractCounts: Record; SurvivorClass: SurvivorClass; WishList: string[]; + moneyTransferLimitData: IMoneyTransferLimits; /** SPT specific property used during bot generation in raid */ sptIsPmc?: boolean; } +export interface IMoneyTransferLimits { + /** TODO: Implement */ + nextResetTime: number; + remainingLimit: number; + totalLimit: number; + resetInterval: number; +} export interface ITaskConditionCounter { id: string; type: string; @@ -74,6 +82,8 @@ export interface Info { BannedUntil: number; IsStreamerModeAvailable: boolean; lastCompletedEvent?: LastCompleted; + SelectedMemberCategory: number; + isMigratedSkills: boolean; } export interface Settings { Role: string; @@ -107,6 +117,7 @@ export interface Health { Temperature: CurrentMax; BodyParts: BodyPartsHealth; UpdateTime: number; + Immortal?: boolean; } export interface BodyPartsHealth { Head: BodyPartHealth; diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts index e5c6632..5451a73 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/ITemplateItem.d.ts @@ -37,6 +37,7 @@ export interface Props { IsUngivable?: boolean; IsUnremovable?: boolean; IsLockedafterEquip?: boolean; + IsRagfairCurrency?: boolean; IsSpecialSlotOnly?: boolean; IsStationaryWeapon?: boolean; QuestItem?: boolean; diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/IGetProfileSettingsRequest.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/IGetProfileSettingsRequest.d.ts index 8168615..1141522 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/IGetProfileSettingsRequest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/IGetProfileSettingsRequest.d.ts @@ -1,3 +1,5 @@ export interface IGetProfileSettingsRequest { + /** Chosen value for profile.Info.SelectedMemberCategory */ + memberCategory: number; squadInviteRestriction: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts b/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts index 8ebf223..858207d 100644 --- a/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/profile/ISptProfile.d.ts @@ -168,6 +168,8 @@ export interface Spt { receivedGifts: ReceivedGift[]; /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[]; + /** key: daily type */ + freeRepeatableChangeCount: Record; } export interface ModDetails { name: string; @@ -178,7 +180,8 @@ export interface ModDetails { } export interface ReceivedGift { giftId: string; - timestampAccepted: number; + timestampLastAccepted: number; + current: number; } export interface Vitality { health: Health; diff --git a/TypeScript/9RouterHooks/types/models/enums/Money.d.ts b/TypeScript/9RouterHooks/types/models/enums/Money.d.ts index 0d39613..97b0d14 100644 --- a/TypeScript/9RouterHooks/types/models/enums/Money.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/Money.d.ts @@ -1,5 +1,6 @@ export declare enum Money { ROUBLES = "5449016a4bdc2d6f028b456f", EUROS = "569668774bdc2da2298b4568", - DOLLARS = "5696686a4bdc2da3298b456a" + DOLLARS = "5696686a4bdc2da3298b456a", + GP = "5d235b4d86f7742e017bc88a" } diff --git a/TypeScript/9RouterHooks/types/models/enums/Traders.d.ts b/TypeScript/9RouterHooks/types/models/enums/Traders.d.ts index f7d340a..10e5f4b 100644 --- a/TypeScript/9RouterHooks/types/models/enums/Traders.d.ts +++ b/TypeScript/9RouterHooks/types/models/enums/Traders.d.ts @@ -8,5 +8,6 @@ export declare enum Traders { RAGMAN = "5ac3b934156ae10c4430e83c", JAEGER = "5c0647fdd443bc2504c2d371", LIGHTHOUSEKEEPER = "638f541a29ffd1183d187f57", - BTR = "656f0f98d80a697f855d34b1" + BTR = "656f0f98d80a697f855d34b1", + REF = "6617beeaa9cfa777ca915b7c" } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts index b0bc491..6cf8943 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IBotConfig.d.ts @@ -6,7 +6,7 @@ export interface IBotConfig extends IBaseConfig { kind: "spt-bot"; /** How many variants of each bot should be generated on raid start */ presetBatch: PresetBatch; - /** Bot roles that should not have PMC types (sptBear/sptUsec) added as enemies to */ + /** Bot roles that should not have PMC types (pmcBEAR/pmcUSEC) added as enemies to */ botsToNotAddPMCsAsEnemiesTo: string[]; /** What bot types should be classified as bosses */ bosses: string[]; @@ -80,8 +80,8 @@ export interface PresetBatch { crazyAssaultEvent: number; bossBoar: number; bossBoarSniper: number; - sptUsec: number; - sptBear: number; + pmcUSEC: number; + pmcBEAR: number; } export interface IWalletLootSettings { /** Chance wallets have loot in them */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts index 2cbd320..2ccaeca 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ICoreConfig.d.ts @@ -67,6 +67,7 @@ export interface IChatbotFeatures { sptFriendEnabled: boolean; commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; + commandUseLimits: Record; } export interface ICommandoFeatures { giveCommandEnabled: boolean; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts index c3c8799..5dd5540 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IGiftsConfig.d.ts @@ -28,4 +28,5 @@ export interface Gift { collectionTimeHours: number; /** Optional, can be used to change profile settings like level/skills */ profileChangeEvents?: IProfileChangeEvent[]; + maxToSendPlayer?: number; } diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IItemConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IItemConfig.d.ts index 0530278..b9dfaea 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IItemConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IItemConfig.d.ts @@ -3,6 +3,8 @@ export interface IItemConfig extends IBaseConfig { kind: "spt-item"; /** Items that should be globally blacklisted */ blacklist: string[]; + /** Items that should not be lootable from any location */ + lootableItemBlacklist: string[]; /** items that should not be given as rewards */ rewardItemBlacklist: string[]; /** Items that can only be found on bosses */ diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts index 2cdf4fa..a4257cf 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts @@ -54,6 +54,7 @@ export interface IRewardScaling { levels: number[]; experience: number[]; roubles: number[]; + gpCoins: number[]; items: number[]; reputation: number[]; rewardSpread: number; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IScavCaseConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IScavCaseConfig.d.ts index c611948..f2ff2f2 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IScavCaseConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IScavCaseConfig.d.ts @@ -16,6 +16,7 @@ export interface MoneyRewards { rubCount: MoneyLevels; usdCount: MoneyLevels; eurCount: MoneyLevels; + gpCount: MoneyLevels; } export interface MoneyLevels { common: MinMax; diff --git a/TypeScript/9RouterHooks/types/models/spt/repeatable/IQuestRewardValues.d.ts b/TypeScript/9RouterHooks/types/models/spt/repeatable/IQuestRewardValues.d.ts new file mode 100644 index 0000000..bcee532 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/spt/repeatable/IQuestRewardValues.d.ts @@ -0,0 +1,9 @@ +export interface IQuestRewardValues { + skillPointReward: number; + skillRewardChance: number; + rewardReputation: number; + rewardNumItems: number; + rewardRoubles: number; + gpCoinRewardCount: number; + rewardXP: number; +} diff --git a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts index 9a57df9..ef20706 100644 --- a/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts +++ b/TypeScript/9RouterHooks/types/routers/EventOutputHolder.d.ts @@ -9,12 +9,15 @@ export declare class EventOutputHolder { protected profileHelper: ProfileHelper; protected timeUtil: TimeUtil; protected cloner: ICloner; - /** What has client been informed of this game session */ - protected clientActiveSessionStorage: Record; + }>>; + protected outputStore: Record; constructor(profileHelper: ProfileHelper, timeUtil: TimeUtil, cloner: ICloner); - protected output: IItemEventRouterResponse; getOutput(sessionID: string): IItemEventRouterResponse; /** * Reset the response object to a default state @@ -44,7 +47,7 @@ export declare class EventOutputHolder { * @param pmcData Player profile * @returns dictionary of hideout productions */ - protected getProductionsFromProfileAndFlagComplete(productions: Record): Record | undefined; + protected getProductionsFromProfileAndFlagComplete(productions: Record, sessionId: string): Record | undefined; /** * Required as continuous productions don't reset and stay at 100% completion but client thinks it hasn't started * @param productions Productions in a profile diff --git a/TypeScript/9RouterHooks/types/services/GiftService.d.ts b/TypeScript/9RouterHooks/types/services/GiftService.d.ts index a379fa3..261b475 100644 --- a/TypeScript/9RouterHooks/types/services/GiftService.d.ts +++ b/TypeScript/9RouterHooks/types/services/GiftService.d.ts @@ -24,6 +24,17 @@ export declare class GiftService { * @returns True if it exists in db */ giftExists(giftId: string): boolean; + getGiftById(giftId: string): Gift; + /** + * Get dictionary of all gifts + * @returns Dict keyed by gift id + */ + getGifts(): Record; + /** + * Get an array of all gift ids + * @returns string array of gift ids + */ + getGiftIds(): string[]; /** * Send player a gift from a range of sources * @param playerId Player to send gift to / sessionId diff --git a/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts b/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts index fde948b..7ff6532 100644 --- a/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts +++ b/TypeScript/9RouterHooks/types/services/ItemFilterService.d.ts @@ -2,19 +2,29 @@ import { IItemConfig } from "@spt/models/spt/config/IItemConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; import { DatabaseServer } from "@spt/servers/DatabaseServer"; +import { ICloner } from "@spt/utils/cloners/ICloner"; /** Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items */ export declare class ItemFilterService { protected logger: ILogger; + protected cloner: ICloner; protected databaseServer: DatabaseServer; protected configServer: ConfigServer; protected itemConfig: IItemConfig; - constructor(logger: ILogger, databaseServer: DatabaseServer, configServer: ConfigServer); + protected itemBlacklistCache: Set; + protected lootableItemBlacklistCache: Set; + constructor(logger: ILogger, cloner: ICloner, databaseServer: DatabaseServer, configServer: ConfigServer); /** - * Check if the provided template id is blacklisted in config/item.json + * Check if the provided template id is blacklisted in config/item.json/blacklist * @param tpl template id * @returns true if blacklisted */ isItemBlacklisted(tpl: string): boolean; + /** + * Check if the provided template id is blacklisted in config/item.json/lootableItemBlacklist + * @param tpl template id + * @returns true if blacklisted + */ + isLootableItemBlacklisted(tpl: string): boolean; /** * Check if item is blacklisted from being a reward for player * @param tpl item tpl to check is on blacklist @@ -31,6 +41,11 @@ export declare class ItemFilterService { * @returns string array of blacklisted tempalte ids */ getBlacklistedItems(): string[]; + /** + * Return every template id blacklisted in config/item.json/lootableItemBlacklist + * @returns string array of blacklisted tempalte ids + */ + getBlacklistedLootableItems(): string[]; /** * Check if the provided template id is boss item in config/item.json * @param tpl template id diff --git a/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts b/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts index 613e5f3..4a22f10 100644 --- a/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts +++ b/TypeScript/9RouterHooks/types/services/PmcChatResponseService.d.ts @@ -3,9 +3,11 @@ import { WeightedRandomHelper } from "@spt/helpers/WeightedRandomHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { Aggressor, Victim } from "@spt/models/eft/common/tables/IBotBase"; import { IUserDialogInfo } from "@spt/models/eft/profile/ISptProfile"; +import { IGiftsConfig } from "@spt/models/spt/config/IGiftsConfig"; import { IPmcChatResponse } from "@spt/models/spt/config/IPmChatResponse"; import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; +import { GiftService } from "@spt/services/GiftService"; import { LocalisationService } from "@spt/services/LocalisationService"; import { MatchBotDetailsCacheService } from "@spt/services/MatchBotDetailsCacheService"; import { HashUtil } from "@spt/utils/HashUtil"; @@ -17,10 +19,12 @@ export declare class PmcChatResponseService { protected notificationSendHelper: NotificationSendHelper; protected matchBotDetailsCacheService: MatchBotDetailsCacheService; protected localisationService: LocalisationService; + protected giftService: GiftService; protected weightedRandomHelper: WeightedRandomHelper; protected configServer: ConfigServer; protected pmcResponsesConfig: IPmcChatResponse; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); + protected giftConfig: IGiftsConfig; + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, notificationSendHelper: NotificationSendHelper, matchBotDetailsCacheService: MatchBotDetailsCacheService, localisationService: LocalisationService, giftService: GiftService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer); /** * For each PMC victim of the player, have a chance to send a message to the player, can be positive or negative * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts b/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts index 2353e4e..0750f38 100644 --- a/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts +++ b/TypeScript/9RouterHooks/types/services/SeasonalEventService.d.ts @@ -146,9 +146,9 @@ export declare class SeasonalEventService { /** * Send gift to player if they'e not already received it * @param playerId Player to send gift to - * @param giftkey Key of gift to give + * @param giftKey Key of gift to give */ - protected giveGift(playerId: string, giftkey: string): void; + protected giveGift(playerId: string, giftKey: string): void; /** * Get the underlying bot type for an event bot e.g. `peacefullZryachiyEvent` will return `bossZryachiy` * @param eventBotRole Event bot role type diff --git a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts index f364db5..b30822c 100644 --- a/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts +++ b/TypeScript/9RouterHooks/types/utils/JsonUtil.d.ts @@ -52,7 +52,8 @@ export declare class JsonUtil { deserializeJson5(jsonString: string, filename?: string): T | undefined; deserializeWithCacheCheckAsync(jsonString: string, filePath: string): Promise; /** - * From json string to object + * Take json from file and convert into object + * Perform valadation on json during process if json file has not been processed before * @param jsonString String to turn into object * @param filePath Path to json file being processed * @returns Object