From d2f59081852cb4556ace8733a9abe39165aac00a Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 20 Jul 2022 17:54:29 +0100 Subject: [PATCH] Update types for 3.1.0 --- .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../13AddTrader/types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../7OnLoadHook/types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ .../types/callbacks/MatchCallbacks.d.ts | 11 ++- .../types/callbacks/PresetBuildCallbacks.d.ts | 3 +- .../types/callbacks/RagfairCallbacks.d.ts | 3 +- .../types/controllers/HealthController.d.ts | 23 +++++- .../controllers/InventoryController.d.ts | 2 +- .../types/controllers/MatchController.d.ts | 3 +- .../types/generators/BotGenerator.d.ts | 40 +++++++++- .../types/generators/BotWeaponGenerator.d.ts | 4 +- .../types/helpers/HealthHelper.d.ts | 36 +++++++-- .../types/helpers/InRaidHelper.d.ts | 12 +++ .../types/helpers/ItemHelper.d.ts | 73 ++++++++++++++++--- .../types/helpers/PresetHelper.d.ts | 4 +- .../types/helpers/ProfileHelper.d.ts | 6 ++ .../types/helpers/QuestHelper.d.ts | 14 ++++ .../types/helpers/TraderHelper.d.ts | 17 ++++- .../models/eft/common/tables/IQuest.d.ts | 5 +- .../types/models/eft/health/Effect.d.ts | 5 ++ .../eft/match/ICreateGroupRequestData.d.ts | 6 ++ .../eft/match/IGetGroupStatusRequestData.d.ts | 3 +- .../eft/match/IPutMetricsRequestData.d.ts | 10 +++ .../match/IStartOffineRaidRequestData.d.ts | 8 +- .../eft/match/IUpdatePingRequestData.d.ts | 3 + .../eft/quests/ICompleteQuestRequestData.d.ts | 1 + .../ISendRagfairReportRequestData.d.ts | 3 + .../types/models/enums/BotAmount.d.ts | 7 ++ .../types/models/enums/BotDifficulty.d.ts | 8 ++ .../types/models/enums/QuestRewardType.d.ts | 8 ++ .../types/models/enums/QuestStatus.d.ts | 10 +++ .../types/models/enums/RaidMode.d.ts | 5 ++ .../models/spt/config/IInRaidConfig.d.ts | 1 + .../types/services/MatchLocationService.d.ts | 3 +- .../types/services/RagfairPriceService.d.ts | 8 ++ 448 files changed, 4312 insertions(+), 518 deletions(-) create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/10ScopesAndTypes/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/11BundleLoadingSample/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/12ClassExtensionOverride/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/13AddTrader/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/13AddTrader/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/13AddTrader/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/13AddTrader/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/13AddTrader/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/13AddTrader/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/13AddTrader/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/13AddTrader/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/13AddTrader/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/13AddTrader/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/14AfterDBLoadHook/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/1LogToConsole/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/2EditDatabase/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/3GetSptConfigFile/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/4UseACustomConfigFile/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/5ReplaceMethod/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/6ReferenceAnotherClass/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/7OnLoadHook/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/8OnUpdateHook/types/models/enums/RaidMode.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/eft/health/Effect.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/eft/match/ICreateGroupRequestData.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/eft/match/IPutMetricsRequestData.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/eft/match/IUpdatePingRequestData.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/enums/BotAmount.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/enums/BotDifficulty.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/enums/QuestRewardType.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/enums/QuestStatus.d.ts create mode 100644 TypeScript/9RouterHooks/types/models/enums/RaidMode.d.ts diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BotAmount.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/BotDifficulty.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/10ScopesAndTypes/types/models/enums/RaidMode.d.ts b/TypeScript/10ScopesAndTypes/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/10ScopesAndTypes/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/10ScopesAndTypes/types/services/MatchLocationService.d.ts b/TypeScript/10ScopesAndTypes/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/10ScopesAndTypes/types/services/MatchLocationService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts +++ b/TypeScript/10ScopesAndTypes/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/health/Effect.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/BotAmount.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/BotDifficulty.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/QuestRewardType.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/QuestStatus.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/11BundleLoadingSample/types/models/enums/RaidMode.d.ts b/TypeScript/11BundleLoadingSample/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/11BundleLoadingSample/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/11BundleLoadingSample/types/services/MatchLocationService.d.ts b/TypeScript/11BundleLoadingSample/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/11BundleLoadingSample/types/services/MatchLocationService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts +++ b/TypeScript/11BundleLoadingSample/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/health/Effect.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/BotAmount.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/BotDifficulty.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/QuestRewardType.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/QuestStatus.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/enums/RaidMode.d.ts b/TypeScript/12ClassExtensionOverride/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/12ClassExtensionOverride/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/services/MatchLocationService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/MatchLocationService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/13AddTrader/types/controllers/HealthController.d.ts b/TypeScript/13AddTrader/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/13AddTrader/types/controllers/HealthController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/13AddTrader/types/controllers/MatchController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts b/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/13AddTrader/types/models/eft/health/Effect.d.ts b/TypeScript/13AddTrader/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/13AddTrader/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/13AddTrader/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/13AddTrader/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/13AddTrader/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/13AddTrader/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/13AddTrader/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/13AddTrader/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/13AddTrader/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/13AddTrader/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/13AddTrader/types/models/enums/BotAmount.d.ts b/TypeScript/13AddTrader/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/13AddTrader/types/models/enums/BotDifficulty.d.ts b/TypeScript/13AddTrader/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/13AddTrader/types/models/enums/QuestRewardType.d.ts b/TypeScript/13AddTrader/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/13AddTrader/types/models/enums/QuestStatus.d.ts b/TypeScript/13AddTrader/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/13AddTrader/types/models/enums/RaidMode.d.ts b/TypeScript/13AddTrader/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/13AddTrader/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/13AddTrader/types/services/MatchLocationService.d.ts b/TypeScript/13AddTrader/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/13AddTrader/types/services/MatchLocationService.d.ts +++ b/TypeScript/13AddTrader/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts +++ b/TypeScript/13AddTrader/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/health/Effect.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/BotAmount.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/BotDifficulty.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/QuestRewardType.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/QuestStatus.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/enums/RaidMode.d.ts b/TypeScript/14AfterDBLoadHook/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/14AfterDBLoadHook/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/services/MatchLocationService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/MatchLocationService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/health/Effect.d.ts b/TypeScript/1LogToConsole/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/1LogToConsole/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/1LogToConsole/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/1LogToConsole/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/1LogToConsole/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/1LogToConsole/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/1LogToConsole/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/1LogToConsole/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/1LogToConsole/types/models/enums/BotAmount.d.ts b/TypeScript/1LogToConsole/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/BotDifficulty.d.ts b/TypeScript/1LogToConsole/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts b/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts b/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/1LogToConsole/types/models/enums/RaidMode.d.ts b/TypeScript/1LogToConsole/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/1LogToConsole/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/1LogToConsole/types/services/MatchLocationService.d.ts b/TypeScript/1LogToConsole/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/1LogToConsole/types/services/MatchLocationService.d.ts +++ b/TypeScript/1LogToConsole/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts +++ b/TypeScript/1LogToConsole/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts b/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/health/Effect.d.ts b/TypeScript/2EditDatabase/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/2EditDatabase/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/2EditDatabase/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/2EditDatabase/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/2EditDatabase/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/2EditDatabase/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/2EditDatabase/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/2EditDatabase/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/2EditDatabase/types/models/enums/BotAmount.d.ts b/TypeScript/2EditDatabase/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/BotDifficulty.d.ts b/TypeScript/2EditDatabase/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/QuestRewardType.d.ts b/TypeScript/2EditDatabase/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/2EditDatabase/types/models/enums/QuestStatus.d.ts b/TypeScript/2EditDatabase/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/2EditDatabase/types/models/enums/RaidMode.d.ts b/TypeScript/2EditDatabase/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/2EditDatabase/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/2EditDatabase/types/services/MatchLocationService.d.ts b/TypeScript/2EditDatabase/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/2EditDatabase/types/services/MatchLocationService.d.ts +++ b/TypeScript/2EditDatabase/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts +++ b/TypeScript/2EditDatabase/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/health/Effect.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/BotAmount.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/BotDifficulty.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/QuestRewardType.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/QuestStatus.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/3GetSptConfigFile/types/models/enums/RaidMode.d.ts b/TypeScript/3GetSptConfigFile/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/3GetSptConfigFile/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/3GetSptConfigFile/types/services/MatchLocationService.d.ts b/TypeScript/3GetSptConfigFile/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/3GetSptConfigFile/types/services/MatchLocationService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/3GetSptConfigFile/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/health/Effect.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/BotAmount.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/BotDifficulty.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/QuestRewardType.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/QuestStatus.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/enums/RaidMode.d.ts b/TypeScript/4UseACustomConfigFile/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/4UseACustomConfigFile/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/services/MatchLocationService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/MatchLocationService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/health/Effect.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/5ReplaceMethod/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/5ReplaceMethod/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/BotAmount.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/BotDifficulty.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/QuestRewardType.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/QuestStatus.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/5ReplaceMethod/types/models/enums/RaidMode.d.ts b/TypeScript/5ReplaceMethod/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/5ReplaceMethod/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/5ReplaceMethod/types/services/MatchLocationService.d.ts b/TypeScript/5ReplaceMethod/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/5ReplaceMethod/types/services/MatchLocationService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts +++ b/TypeScript/5ReplaceMethod/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/health/Effect.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/BotAmount.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/BotDifficulty.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestRewardType.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestStatus.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/enums/RaidMode.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/6ReferenceAnotherClass/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/services/MatchLocationService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/MatchLocationService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts b/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/health/Effect.d.ts b/TypeScript/7OnLoadHook/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/7OnLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/7OnLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/7OnLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/BotAmount.d.ts b/TypeScript/7OnLoadHook/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/BotDifficulty.d.ts b/TypeScript/7OnLoadHook/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/QuestRewardType.d.ts b/TypeScript/7OnLoadHook/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/QuestStatus.d.ts b/TypeScript/7OnLoadHook/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/7OnLoadHook/types/models/enums/RaidMode.d.ts b/TypeScript/7OnLoadHook/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/7OnLoadHook/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/7OnLoadHook/types/services/MatchLocationService.d.ts b/TypeScript/7OnLoadHook/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/7OnLoadHook/types/services/MatchLocationService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/7OnLoadHook/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/health/Effect.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/8OnUpdateHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/8OnUpdateHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/BotAmount.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/BotDifficulty.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/QuestRewardType.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/QuestStatus.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/8OnUpdateHook/types/models/enums/RaidMode.d.ts b/TypeScript/8OnUpdateHook/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/8OnUpdateHook/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/8OnUpdateHook/types/services/MatchLocationService.d.ts b/TypeScript/8OnUpdateHook/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/8OnUpdateHook/types/services/MatchLocationService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts +++ b/TypeScript/8OnUpdateHook/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; } diff --git a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts index 158d8df..2a92ef5 100644 --- a/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/MatchCallbacks.d.ts @@ -3,12 +3,15 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { INullResponseData } from "../models/eft/httpResponse/INullResponseData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; import { IJoinMatchRequestData } from "../models/eft/match/IJoinMatchRequestData"; import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; +import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IStartOfflineRaidRequestData } from "../models/eft/match/IStartOffineRaidRequestData"; +import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; import { JsonUtil } from "../utils/JsonUtil"; @@ -18,21 +21,21 @@ export declare class MatchCallbacks { protected matchController: MatchController; protected databaseServer: DatabaseServer; constructor(httpResponse: HttpResponseUtil, jsonUtil: JsonUtil, matchController: MatchController, databaseServer: DatabaseServer); - updatePing(url: string, info: any, sessionID: string): INullResponseData; - exitMatch(url: string, info: any, sessionID: string): INullResponseData; + updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData; + exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData; sendGroupInvite(url: string, info: any, sessionID: string): INullResponseData; acceptGroupInvite(url: string, info: any, sessionID: string): INullResponseData; cancelGroupInvite(url: string, info: any, sessionID: string): INullResponseData; - putMetrics(url: string, info: any, sessionID: string): INullResponseData; + putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData; getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData; serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData; joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData; getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData; getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData; - createGroup(url: string, info: any, sessionID: string): IGetBodyResponseData; + createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData; deleteGroup(url: string, info: any, sessionID: string): INullResponseData; startOfflineRaid(url: string, info: IStartOfflineRaidRequestData, sessionID: string): INullResponseData; endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData; diff --git a/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts index 8a0c155..541715a 100644 --- a/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/PresetBuildCallbacks.d.ts @@ -1,4 +1,5 @@ import { PresetBuildController } from "../controllers/PresetBuildController"; +import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; @@ -9,7 +10,7 @@ export declare class PresetBuildCallbacks { protected httpResponse: HttpResponseUtil; protected presetBuildController: PresetBuildController; constructor(httpResponse: HttpResponseUtil, presetBuildController: PresetBuildController); - getHandbookUserlist(url: string, info: any, sessionID: string): IGetBodyResponseData; + getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts index da782e1..3a405c9 100644 --- a/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/RagfairCallbacks.d.ts @@ -12,6 +12,7 @@ import { IGetMarketPriceRequestData } from "../models/eft/ragfair/IGetMarketPric import { IGetOffersResult } from "../models/eft/ragfair/IGetOffersResult"; import { IRemoveOfferRequestData } from "../models/eft/ragfair/IRemoveOfferRequestData"; import { ISearchRequestData } from "../models/eft/ragfair/ISearchRequestData"; +import { ISendRagfairReportRequestData } from "../models/eft/ragfair/ISendRagfairReportRequestData"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -36,5 +37,5 @@ export declare class RagfairCallbacks extends OnLoadOnUpdate { removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse; extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse; onUpdate(timeSinceLastRun: number): boolean; - sendReport(url: string, info: any, sessionID: string): INullResponseData; + sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData; } diff --git a/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts b/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts index aafb8df..cc13603 100644 --- a/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/HealthController.d.ts @@ -18,8 +18,29 @@ export declare class HealthController { protected inventoryHelper: InventoryHelper; protected healthHelper: HealthHelper; constructor(logger: ILogger, itemEventRouter: ItemEventRouter, itemHelper: ItemHelper, paymentService: PaymentService, inventoryHelper: InventoryHelper, healthHelper: HealthHelper); - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * stores in-raid player health + * @param pmcData Player profile + * @param info Request data + * @param sessionID + * @param addEffects Should effects found be added or removed from profile + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; + /** + * When healing in menu + * @param pmcData + * @param body + * @param sessionID + * @returns + */ offraidHeal(pmcData: IPmcData, body: IOffraidHealRequestData, sessionID: string): IItemEventRouterResponse; offraidEat(pmcData: IPmcData, body: IOffraidEatRequestData, sessionID: string): IItemEventRouterResponse; + /** + * Occurs on post-raid healing page + * @param pmcData player profile + * @param info Request data from client + * @param sessionID Session id + * @returns + */ healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse; } diff --git a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts index f24ab62..f57f731 100644 --- a/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/InventoryController.d.ts @@ -109,7 +109,7 @@ export declare class InventoryController { * @param body response request * @returns tplid */ - protected getItemTpl(body: IInventoryExamineRequestData): string; + protected getExaminedItemTpl(body: IInventoryExamineRequestData): string; readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse; /** * Handles sorting of Inventory. diff --git a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts index 7ef3fcc..87a070c 100644 --- a/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/MatchController.d.ts @@ -1,6 +1,7 @@ import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderHelper } from "../helpers/TraderHelper"; import { IPmcData } from "../models/eft/common/IPmcData"; +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { IEndOfflineRaidRequestData } from "../models/eft/match/IEndOfflineRaidRequestData"; import { IGetGroupStatusRequestData } from "../models/eft/match/IGetGroupStatusRequestData"; import { IGetProfileRequestData } from "../models/eft/match/IGetProfileRequestData"; @@ -23,7 +24,7 @@ export declare class MatchController { constructor(saveServer: SaveServer, profileHelper: ProfileHelper, matchLocationService: MatchLocationService, traderHelper: TraderHelper, configServer: ConfigServer); getEnabled(): boolean; getProfile(info: IGetProfileRequestData): IPmcData[]; - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[]; protected getMatch(location: string): any; diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 88a8014..28f05a9 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -31,16 +31,54 @@ export declare class BotGenerator { protected botConfig: IBotConfig; constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer); generate(info: IGenerateBotsRequestData, playerScav?: boolean): IBotBase[]; + /** + * Choose if a bot should become a Pmc by checking if bot type is allowed to become a Pmc in bot config + * @param isPlayerScav is a player scav being generated, forces choice returned to never be a pmc + */ + protected shouldBotBePmc(isPlayerScav: boolean, role: string): boolean; + /** + * Get a randomised PMC side based on bot config value 'isUsec' + * @returns pmc side as string + */ + protected getRandomisedPmcSide(): string; + /** + * Get a clone of the database\bots\base.json file + * @returns IBotBase object + */ + protected getCloneOfBotBase(): IBotBase; protected generateBot(bot: IBotBase, role: string, isPmc: boolean): IBotBase; + /** + * Log the number of PMCs generated to the debug console + */ + protected logPmcGeneratedCount(output: IBotBase[]): void; protected generateRandomLevel(min: number, max: number): BotGenerator.IRandomisedBotLevelResult; - /** Converts health object to the required format */ + /** + * Converts health object to the required format + * @param healthObj health object from bot json + * @param playerScav Is a pscav bot being generated + * @returns PmcHealth object + */ protected generateHealth(healthObj: Health, playerScav?: boolean): PmcHealth; protected generateSkills(skillsObj: Skills): Skills; + /** + * Convert from pmc side (usec/bear) to the side as defined in the bot config (usecType/bearType) + * @param pmcSide eft side (usec/bear) + * @returns pmc side as defined in config + */ protected getPmcRole(pmcSide: string): string; + /** + * Iterate through bots inventory and loot to find and remove christmas items (as defined in GameEventHelper) + * @param nodeInventory Bots inventory to iterate over + */ protected removeChristmasItemsFromBotInventory(nodeInventory: Inventory): void; protected generateId(bot: IBotBase): IBotBase; protected generateInventoryID(profile: IBotBase): IBotBase; protected getPMCDifficulty(requestedDifficulty: string): string; + /** + * Add a side-specific (usec/bear) dogtag item to a bots inventory + * @param bot bot to add dogtag to + * @returns Bot with dogtag added + */ protected generateDogtag(bot: IBotBase): IBotBase; } export {}; diff --git a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts index dd3ad69..80dc37c 100644 --- a/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotWeaponGenerator.d.ts @@ -9,7 +9,9 @@ import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HashUtil } from "../utils/HashUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class BotWeaponGenerator { + protected jsonUtil: JsonUtil; protected logger: ILogger; protected hashUtil: HashUtil; protected databaseServer: DatabaseServer; @@ -18,7 +20,7 @@ export declare class BotWeaponGenerator { protected botGeneratorHelper: BotGeneratorHelper; protected randomUtil: RandomUtil; private readonly modMagazineSlotId; - constructor(logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); + constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil); generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void; /** * Get the mods necessary to kit out a weapon to its preset level diff --git a/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts index 518c23f..3116c9c 100644 --- a/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/HealthHelper.d.ts @@ -15,13 +15,37 @@ export declare class HealthHelper { protected configServer: ConfigServer; protected healthConfig: IHealthConfig; constructor(jsonUtil: JsonUtil, logger: ILogger, timeUtil: TimeUtil, saveServer: SaveServer, configServer: ConfigServer); + /** + * Resets the profiles vitality/healh and vitality/effects properties to their defaults + * @param sessionID Session Id + * @returns updated profile + */ resetVitality(sessionID: string): IAkiProfile; - saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string): void; + /** + * Update player profile with changes from request object + * @param pmcData Player profile + * @param info Request object + * @param sessionID Session id + * @param addEffects Should effects be added or removed (default - add) + */ + saveVitality(pmcData: IPmcData, info: ISyncHealthRequestData, sessionID: string, addEffects?: boolean): void; protected saveHealth(pmcData: IPmcData, sessionID: string): void; - protected saveEffects(pmcData: IPmcData, sessionID: string): void; - protected addEffect(pmcData: IPmcData, sessionID: string, effect: { - bodyPart: string; - effectType: string; - }): void; + /** + * Save effects to profile + * Works by removing all effects and adding them back from profile + * Remoces empty 'Effects' objects if found + * @param pmcData Player profile + * @param sessionID Session id + * @param addEffects Should effects be added back to profile + * @returns + */ + protected saveEffects(pmcData: IPmcData, sessionID: string, addEffects: boolean): void; + /** + * Add effect to body part in profile + * @param pmcData Player profile + * @param effectBodyPart body part to edit + * @param effectType Effect to add to body part + */ + protected addEffect(pmcData: IPmcData, effectBodyPart: string, effectType: string): void; protected isEmpty(map: any): boolean; } diff --git a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts index 05b6fdf..58e0f6a 100644 --- a/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/InRaidHelper.d.ts @@ -28,6 +28,18 @@ export declare class InRaidHelper { markFoundItems(pmcData: IPmcData, profile: IPmcData, isPlayerScav: boolean): IPmcData; removeFoundInRaidStatusFromItems(profile: IPmcData): IPmcData; setInventory(sessionID: string, pmcData: IPmcData, profile: IPmcData): IPmcData; + /** + * Clear pmc inventory of all items except those that are exempt + * @param pmcData Player profile + * @param sessionID Session id + * @returns Player profile with pmc inventory cleared + */ deleteInventory(pmcData: IPmcData, sessionID: string): IPmcData; + /** + * Does the provided items slotId mean its kept on the player after death + * @param slotId slotid of item to check + * @returns true if item is kept after death + */ + isItemKeptAfterDeath(slotId: string): boolean; getPlayerGear(items: Item[]): Item[]; } diff --git a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts index 4fff11e..a6b61d0 100644 --- a/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ItemHelper.d.ts @@ -1,5 +1,5 @@ import { InsuredItem, IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; +import { Item, Repairable } from "../models/eft/common/tables/IItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -18,7 +18,7 @@ declare class ItemHelper { */ isValidItem(tpl: string, invalidBaseTypes?: string[]): boolean; /** - * Checks if a id is a valid item. Valid meaning that it's an item that may be a reward + * Checks if an id is a valid item. Valid meaning that it's an item that may be a reward * or content of bot loot. Items that are tested as valid may be in a player backpack or stash. * @param {*} tpl template id of item to check * @returns boolean: true if item is valid reward @@ -83,6 +83,11 @@ declare class ItemHelper { * @returns {array} The array of StackSlotItems */ generateItemsFromStackSlot(item: ITemplateItem, parentId: string): Item[]; + /** + * Gets item data from items.json + * @param tpl items template id to look up + * @returns bool - is valid + template item object as array + */ getItem(tpl: string): [boolean, ITemplateItem]; /** * get normalized value (0-1) based on item condition @@ -90,24 +95,64 @@ declare class ItemHelper { * @returns number between 0 and 1 */ getItemQualityModifier(item: Item): number; + /** + * Get a quality value based on a repairable items (weapon/armor) current state between current and max durability + * @param itemDetails + * @param repairable repairable object + * @param item + * @returns a number between 0 and 1 + */ + protected getRepairableItemQualityValue(itemDetails: ITemplateItem, repairable: Repairable, item: Item): number; + /** + * Recursive function that looks at every item from parameter and gets their childrens Ids + * @param items + * @param itemID + * @returns an array of strings + */ findAndReturnChildrenByItems(items: Item[], itemID: string): string[]; /** * A variant of findAndReturnChildren where the output is list of item objects instead of their ids. + * @param items + * @param baseItemId + * @returns An array of Item objects */ findAndReturnChildrenAsItems(items: Item[], baseItemId: string): Item[]; /** - * find children of the item in a given assort (weapons parts for example, need recursive loop function) + * Find children of the item in a given assort (weapons parts for example, need recursive loop function) + * @param itemIdToFind Template id of item to check for + * @param assort Array of items to check in + * @returns Array of children of requested item */ findAndReturnChildrenByAssort(itemIdToFind: string, assort: Item[]): Item[]; + /** + * Check if the passed in item has buy count restrictions + * @param itemToCheck Item to check + * @returns true if it has buy restrictions + */ hasBuyRestrictions(itemToCheck: Item): boolean; /** - * Is Dogtag - * Checks if an item is a dogtag. Used under profile_f.js to modify preparePrice based - * on the level of the dogtag + * is the passed in template id a dog tag + * @param tpl Template id to check + * @returns true if it is a dogtag */ isDogtag(tpl: string): boolean; + /** + * Can the item passed in be sold to a trader because it is raw money + * @param tpl Item template id to check + * @returns true if unsellable + */ isNotSellable(tpl: string): boolean; + /** + * Gets the identifier for a child using slotId, locationX and locationY. + * @param item + * @returns "slotId OR slotid,locationX,locationY" + */ getChildId(item: Item): string; + /** + * Can the pased in item be stacked + * @param tpl item to check + * @returns true if it can be stacked + */ isItemTplStackable(tpl: string): boolean; /** * split item stack if it exceeds StackMaxSize @@ -122,10 +167,12 @@ declare class ItemHelper { */ findBarterItems(by: string, pmcData: IPmcData, barter_itemID: string): any[]; /** - * @param {Object} pmcData - * @param {Array} items - * @param {Object} fastPanel - * @returns Array + * + * @param pmcData + * @param items + * @param insuredItems insured items to not replace ids for + * @param fastPanel + * @returns */ replaceIDs(pmcData: IPmcData, items: Item[], insuredItems?: InsuredItem[], fastPanel?: any): any[]; /** @@ -141,6 +188,12 @@ declare class ItemHelper { * @returns boolean */ isQuestItem(tpl: string): boolean; + /** + * Get the inventory size of an item + * @param items + * @param rootItemId + * @returns ItemSize object (width and height) + */ getItemSize(items: Item[], rootItemId: string): ItemHelper.ItemSize; } declare namespace ItemHelper { diff --git a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts index 0371886..a469582 100644 --- a/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/PresetHelper.d.ts @@ -1,9 +1,11 @@ import { Preset } from "../models/eft/common/IGlobals"; import { DatabaseServer } from "../servers/DatabaseServer"; +import { JsonUtil } from "../utils/JsonUtil"; export declare class PresetHelper { + protected jsonUtil: JsonUtil; protected databaseServer: DatabaseServer; protected lookup: Record; - constructor(databaseServer: DatabaseServer); + constructor(jsonUtil: JsonUtil, databaseServer: DatabaseServer); hydratePresetStore(input: Record): void; isPreset(id: string): boolean; hasPreset(templateId: string): boolean; diff --git a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts index 6a64291..b369000 100644 --- a/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/ProfileHelper.d.ts @@ -20,6 +20,12 @@ export declare class ProfileHelper { resetProfileQuestCondition(sessionID: string, conditionId: string): void; getCompleteProfile(sessionID: string): IPmcData[]; isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean; + /** + * Add experience to a PMC inside the players profile + * @param sessionID Session id + * @param experienceToAdd Experiecne to add to PMC character + */ + addExperienceToPmc(sessionID: string, experienceToAdd: number): void; getProfileByPmcId(pmcId: string): IPmcData; getExperience(level: number): number; getMaxLevel(): number; diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index d6e382b..0b10135 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -75,8 +75,22 @@ export declare class QuestHelper { */ cleanQuestConditions(quest: IQuest): IQuest; failQuest(pmcData: IPmcData, body: any, sessionID: string): any; + /** + * Get quest by id from database + * @param questId questid to look for + * @param pmcData player profile + * @returns IQuest object + */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; getQuestLocaleIdFromDb(messageId: string): string; + /** + * Give player quest rewards - Skills/exp/trader standing/items/assort unlocks + * @param pmcData Player profile + * @param body complete quest request + * @param state State of the quest now its complete + * @param sessionID Seession id + * @returns array of reward objects + */ applyQuestReward(pmcData: IPmcData, body: ICompleteQuestRequestData, state: string, sessionID: string): Reward[]; /** * Get the intel center bonus a player has diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index 717351f..ba0c564 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -35,7 +35,13 @@ export declare class TraderHelper { * @param traderID trader id to reset */ resetTrader(sessionID: string, traderID: string): void; - changeTraderDisplay(traderID: string, status: boolean, sessionID: string): void; + /** + * Alter a traders unlocked status + * @param traderID Trader to alter + * @param status New status to use + * @param sessionID Session id + */ + setTraderUnlockedState(traderID: string, status: boolean, sessionID: string): void; /** * Get a list of items and their prices from player inventory that can be sold to a trader * @param traderID trader id being traded with @@ -79,7 +85,14 @@ export declare class TraderHelper { protected getRawItemPrice(pmcData: IPmcData, item: Item): number; protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderID: string): number; /** - * Calculate traders level based on exp amount and increment level if over threshold + * Add standing to a trader and level them up if exp goes over level threshold + * @param sessionID Session id + * @param traderId traders id + * @param standingToAdd Standing value to add to trader + */ + addStandingToTrader(sessionID: string, traderId: string, standingToAdd: number): void; + /** + * Calculate traders level based on exp amount and increments level if over threshold * @param traderID trader to process * @param sessionID session id */ diff --git a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts index 942339b..a349a6d 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -1,3 +1,4 @@ +import { QuestRewardType } from "../../../enums/QuestRewardType"; import { Item } from "./IItem"; export interface IQuest { QuestName: string; @@ -99,9 +100,9 @@ export interface Rewards { Expired: Reward[]; } export interface Reward { - value?: string; + value?: string | number; id: string; - type: string; + type: QuestRewardType; index: number; target?: string; items?: Item[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/health/Effect.d.ts b/TypeScript/9RouterHooks/types/models/eft/health/Effect.d.ts new file mode 100644 index 0000000..2f0adac --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/health/Effect.d.ts @@ -0,0 +1,5 @@ +export declare enum Effect { + Fracture = "Fracture", + LightBleeding = "LightBleeding", + HeavyBleeding = "HeavyBleeding" +} diff --git a/TypeScript/9RouterHooks/types/models/eft/match/ICreateGroupRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/ICreateGroupRequestData.d.ts new file mode 100644 index 0000000..7413a8a --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/match/ICreateGroupRequestData.d.ts @@ -0,0 +1,6 @@ +import { RaidMode } from "../../enums/RaidMode"; +export interface ICreateGroupRequestData { + location: string; + raidMode: RaidMode; + startInGroup: boolean; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusRequestData.d.ts index cbdb77f..55d7079 100644 --- a/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/match/IGetGroupStatusRequestData.d.ts @@ -1,8 +1,9 @@ +import { RaidMode } from "../../enums/RaidMode"; export interface IGetGroupStatusRequestData { location: string; savage: boolean; dt: string; keyId: string; - raidMode: string; + raidMode: RaidMode; startInGroup: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/eft/match/IPutMetricsRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/IPutMetricsRequestData.d.ts new file mode 100644 index 0000000..d9ed214 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/match/IPutMetricsRequestData.d.ts @@ -0,0 +1,10 @@ +export interface IPutMetricsRequestData { + sid: string; + settings: any; + SharedSettings: any; + HardwareDescription: any; + Location: string; + Metrics: any; + ClientEvents: any; + SpikeSamples: any[]; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/match/IStartOffineRaidRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/IStartOffineRaidRequestData.d.ts index 7cc457c..af0625e 100644 --- a/TypeScript/9RouterHooks/types/models/eft/match/IStartOffineRaidRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/match/IStartOffineRaidRequestData.d.ts @@ -1,3 +1,5 @@ +import { BotAmount } from "../../enums/BotAmount"; +import { BotDifficulty } from "../../enums/BotDifficulty"; export interface IStartOfflineRaidRequestData { locationName: string; startTime: number; @@ -16,11 +18,11 @@ export interface TimeAndWeatherSettings { export interface BotsSettings { isEnabled: boolean; isScavWars: boolean; - botAmount: string; + botAmount: BotAmount; } export interface WavesSettings { - botDifficulty: string; + botDifficulty: BotDifficulty; isBosses: boolean; isTaggedAndCursed: boolean; - wavesBotAmount: string; + wavesBotAmount: BotAmount; } diff --git a/TypeScript/9RouterHooks/types/models/eft/match/IUpdatePingRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/match/IUpdatePingRequestData.d.ts new file mode 100644 index 0000000..defbd66 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/match/IUpdatePingRequestData.d.ts @@ -0,0 +1,3 @@ +export interface IUpdatePingRequestData { + servers: any[]; +} diff --git a/TypeScript/9RouterHooks/types/models/eft/quests/ICompleteQuestRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/quests/ICompleteQuestRequestData.d.ts index cc67404..36a6db3 100644 --- a/TypeScript/9RouterHooks/types/models/eft/quests/ICompleteQuestRequestData.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/quests/ICompleteQuestRequestData.d.ts @@ -1,5 +1,6 @@ export interface ICompleteQuestRequestData { Action: string; + /** Quest Id */ qid: string; removeExcessItems: boolean; } diff --git a/TypeScript/9RouterHooks/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts b/TypeScript/9RouterHooks/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts new file mode 100644 index 0000000..2d14d20 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/eft/ragfair/ISendRagfairReportRequestData.d.ts @@ -0,0 +1,3 @@ +export interface ISendRagfairReportRequestData { + offerId: number; +} diff --git a/TypeScript/9RouterHooks/types/models/enums/BotAmount.d.ts b/TypeScript/9RouterHooks/types/models/enums/BotAmount.d.ts new file mode 100644 index 0000000..d0e1df1 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/BotAmount.d.ts @@ -0,0 +1,7 @@ +export declare enum BotAmount { + AsOnline = "AsOnline", + Low = "Low", + Medium = "Medium", + High = "High", + Horde = "Horde" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/BotDifficulty.d.ts b/TypeScript/9RouterHooks/types/models/enums/BotDifficulty.d.ts new file mode 100644 index 0000000..c901bcf --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/BotDifficulty.d.ts @@ -0,0 +1,8 @@ +export declare enum BotDifficulty { + AsOnline = "AsOnline", + Easy = "Easy", + Medium = "Medium", + Hard = "Hard", + Impossible = "Impossible", + Random = "Random" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/QuestRewardType.d.ts b/TypeScript/9RouterHooks/types/models/enums/QuestRewardType.d.ts new file mode 100644 index 0000000..1d3db86 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/QuestRewardType.d.ts @@ -0,0 +1,8 @@ +export declare enum QuestRewardType { + Skill = "Skill", + Experience = "Experience", + TraderStanding = "TraderStanding", + TraderUnlock = "TraderUnlock", + Item = "Item", + AssortmentUnlock = "AssortmentUnlock" +} diff --git a/TypeScript/9RouterHooks/types/models/enums/QuestStatus.d.ts b/TypeScript/9RouterHooks/types/models/enums/QuestStatus.d.ts new file mode 100644 index 0000000..6335c73 --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/QuestStatus.d.ts @@ -0,0 +1,10 @@ +export declare enum QuestStatus { + Locked = 0, + AvailableForStart = 1, + Started = 2, + AvailableForFinish = 3, + Success = 4, + Fail = 5, + FailRestartable = 6, + MarkedAsFailed = 7 +} diff --git a/TypeScript/9RouterHooks/types/models/enums/RaidMode.d.ts b/TypeScript/9RouterHooks/types/models/enums/RaidMode.d.ts new file mode 100644 index 0000000..c5a8cff --- /dev/null +++ b/TypeScript/9RouterHooks/types/models/enums/RaidMode.d.ts @@ -0,0 +1,5 @@ +export declare enum RaidMode { + Online = "Online", + Local = "Local", + Coop = "Coop" +} diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts index baaf083..3ae2972 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IInRaidConfig.d.ts @@ -14,6 +14,7 @@ export interface RaidMenuSettings { bossEnabled: boolean; scavWars: boolean; taggedAndCursed: boolean; + enablePve: boolean; } export interface Save { loot: boolean; diff --git a/TypeScript/9RouterHooks/types/services/MatchLocationService.d.ts b/TypeScript/9RouterHooks/types/services/MatchLocationService.d.ts index 2b5fc0e..c027bec 100644 --- a/TypeScript/9RouterHooks/types/services/MatchLocationService.d.ts +++ b/TypeScript/9RouterHooks/types/services/MatchLocationService.d.ts @@ -1,8 +1,9 @@ +import { ICreateGroupRequestData } from "../models/eft/match/ICreateGroupRequestData"; import { TimeUtil } from "../utils/TimeUtil"; export declare class MatchLocationService { protected timeUtil: TimeUtil; protected locations: {}; constructor(timeUtil: TimeUtil); - createGroup(sessionID: string, info: any): any; + createGroup(sessionID: string, info: ICreateGroupRequestData): any; deleteGroup(info: any): void; } diff --git a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts index e3168a6..e33bbb9 100644 --- a/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts +++ b/TypeScript/9RouterHooks/types/services/RagfairPriceService.d.ts @@ -1,6 +1,7 @@ import { HandbookHelper } from "../helpers/HandbookHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { PresetHelper } from "../helpers/PresetHelper"; +import { Preset } from "../models/eft/common/IGlobals"; import { Item } from "../models/eft/common/tables/IItem"; import { IBarterScheme } from "../models/eft/common/tables/ITrader"; import { IRagfairConfig } from "../models/spt/config/IRagfairConfig"; @@ -43,4 +44,11 @@ export declare class RagfairPriceService { * @returns */ getWeaponPresetPrice(item: Item, items: Item[], existingPrice: number): number; + /** + * Attempt to get the default preset for a weapon, failing that get the first preset in the array + * (assumes default = has encyclopedia entry) + * @param presets weapon presets to choose from + * @returns Default preset object + */ + protected getDefaultWeaponPreset(presets: Preset[], weapon: Item): Preset; }