From f01d0bab6ee0cb8c5c0f43c41b2525efe95d9b39 Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 19 Feb 2023 20:42:07 +0000 Subject: [PATCH] Update types for 3.5.1 --- .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../models/eft/ragfair/IRagfairOffer.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/utils/UUidGenerator.d.ts | 2 +- .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../models/eft/ragfair/IRagfairOffer.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/utils/UUidGenerator.d.ts | 2 +- .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../models/eft/ragfair/IRagfairOffer.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/utils/UUidGenerator.d.ts | 2 +- .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - .../types/callbacks/TraderCallbacks.d.ts | 7 +- .../types/controllers/ProfileController.d.ts | 6 +- .../types/controllers/QuestController.d.ts | 16 ++-- .../RepeatableQuestController.d.ts | 18 +++-- .../types/controllers/TraderController.d.ts | 14 ++-- .../generators/BotEquipmentModGenerator.d.ts | 4 +- .../types/generators/BotGenerator.d.ts | 4 +- .../types/generators/BotLootGenerator.d.ts | 4 +- .../types/generators/PMCLootGenerator.d.ts | 14 ++++ .../types/helpers/AssortHelper.d.ts | 19 ++++- .../types/helpers/QuestHelper.d.ts | 9 ++- .../types/helpers/RagfairOfferHelper.d.ts | 17 ++++- .../types/helpers/TraderHelper.d.ts | 73 +------------------ .../types/models/eft/common/ILooseLoot.d.ts | 5 +- .../models/eft/common/tables/IQuest.d.ts | 2 +- .../eft/hideout/IHideoutProduction.d.ts | 1 + .../spt/callbacks/ITraderCallbacks.d.ts | 3 +- .../types/models/spt/config/IPmcConfig.d.ts | 8 +- .../types/models/spt/config/IQuestConfig.d.ts | 16 ++-- .../models/spt/config/IRagfairConfig.d.ts | 2 + .../models/spt/config/ITraderConfig.d.ts | 2 - readme.md | 2 +- 385 files changed, 2203 insertions(+), 2200 deletions(-) diff --git a/TypeScript/10ScopesAndTypes/types/callbacks/TraderCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/10ScopesAndTypes/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts +++ b/TypeScript/10ScopesAndTypes/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/10ScopesAndTypes/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/10ScopesAndTypes/types/helpers/AssortHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/AssortHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts +++ b/TypeScript/10ScopesAndTypes/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/10ScopesAndTypes/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/11BundleLoadingSample/types/callbacks/TraderCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/11BundleLoadingSample/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts +++ b/TypeScript/11BundleLoadingSample/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/11BundleLoadingSample/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/11BundleLoadingSample/types/helpers/AssortHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/AssortHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/11BundleLoadingSample/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/11BundleLoadingSample/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/12ClassExtensionOverride/types/callbacks/TraderCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/12ClassExtensionOverride/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/AssortHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/AssortHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/12ClassExtensionOverride/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/13AddTrader/types/callbacks/TraderCallbacks.d.ts b/TypeScript/13AddTrader/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/13AddTrader/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/13AddTrader/types/controllers/QuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/13AddTrader/types/controllers/TraderController.d.ts +++ b/TypeScript/13AddTrader/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/13AddTrader/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/13AddTrader/types/helpers/AssortHelper.d.ts b/TypeScript/13AddTrader/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/13AddTrader/types/helpers/AssortHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts +++ b/TypeScript/13AddTrader/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/13AddTrader/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/13AddTrader/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/13AddTrader/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/13AddTrader/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/13AddTrader/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/14AfterDBLoadHook/types/callbacks/TraderCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/14AfterDBLoadHook/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/AssortHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/AssortHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/14AfterDBLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/15HttpListenerExample/types/callbacks/TraderCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/15HttpListenerExample/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts +++ b/TypeScript/15HttpListenerExample/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/15HttpListenerExample/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/15HttpListenerExample/types/helpers/AssortHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/AssortHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts +++ b/TypeScript/15HttpListenerExample/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts index 5c939e1..52968b1 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/15HttpListenerExample/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/16ImporterUtil/types/callbacks/TraderCallbacks.d.ts b/TypeScript/16ImporterUtil/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/16ImporterUtil/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts b/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts +++ b/TypeScript/16ImporterUtil/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/16ImporterUtil/types/helpers/AssortHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/16ImporterUtil/types/helpers/AssortHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts +++ b/TypeScript/16ImporterUtil/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; diff --git a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts index 5c939e1..52968b1 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/16ImporterUtil/types/models/eft/ragfair/IRagfairOffer.d.ts b/TypeScript/16ImporterUtil/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/TypeScript/16ImporterUtil/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/TypeScript/16ImporterUtil/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/TypeScript/16ImporterUtil/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/16ImporterUtil/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/16ImporterUtil/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/16ImporterUtil/types/utils/UUidGenerator.d.ts b/TypeScript/16ImporterUtil/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/TypeScript/16ImporterUtil/types/utils/UUidGenerator.d.ts +++ b/TypeScript/16ImporterUtil/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TraderCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/AssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/AssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts index 5c939e1..52968b1 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IRagfairOffer.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/17AsyncImporterWithDependency1/types/utils/UUidGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency1/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/TypeScript/17AsyncImporterWithDependency1/types/utils/UUidGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency1/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TraderCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/AssortHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/AssortHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts index 5c939e1..52968b1 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IRagfairOffer.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IRagfairOffer.d.ts index 792ec7d..6b28718 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IRagfairOffer.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/eft/ragfair/IRagfairOffer.d.ts @@ -23,6 +23,7 @@ export interface IRagfairOffer { summaryCost: number; user: IRagfairOfferUser; notAvailable: boolean; + /** TODO - implement this value - not currently used */ CurrentItemCount: number; priority: boolean; } diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/17AsyncImporterWithDependency2/types/utils/UUidGenerator.d.ts b/TypeScript/17AsyncImporterWithDependency2/types/utils/UUidGenerator.d.ts index 000b719..ed1ffa6 100644 --- a/TypeScript/17AsyncImporterWithDependency2/types/utils/UUidGenerator.d.ts +++ b/TypeScript/17AsyncImporterWithDependency2/types/utils/UUidGenerator.d.ts @@ -1,4 +1,4 @@ import { IUUidGenerator } from "../models/spt/utils/IUuidGenerator"; export declare class UUidGenerator implements IUUidGenerator { - generate: () => string; + generate(): string; } diff --git a/TypeScript/1LogToConsole/types/callbacks/TraderCallbacks.d.ts b/TypeScript/1LogToConsole/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/1LogToConsole/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts +++ b/TypeScript/1LogToConsole/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/1LogToConsole/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts +++ b/TypeScript/1LogToConsole/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/1LogToConsole/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/1LogToConsole/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/1LogToConsole/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/1LogToConsole/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/1LogToConsole/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/2EditDatabase/types/callbacks/TraderCallbacks.d.ts b/TypeScript/2EditDatabase/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/2EditDatabase/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts +++ b/TypeScript/2EditDatabase/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/2EditDatabase/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/2EditDatabase/types/helpers/AssortHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/2EditDatabase/types/helpers/AssortHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts +++ b/TypeScript/2EditDatabase/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/2EditDatabase/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/2EditDatabase/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/2EditDatabase/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/2EditDatabase/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/2EditDatabase/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/3GetSptConfigFile/types/callbacks/TraderCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/3GetSptConfigFile/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/3GetSptConfigFile/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/3GetSptConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/3GetSptConfigFile/types/helpers/AssortHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/AssortHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/3GetSptConfigFile/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/3GetSptConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/4UseACustomConfigFile/types/callbacks/TraderCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/4UseACustomConfigFile/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/AssortHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/AssortHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/4UseACustomConfigFile/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/5ReplaceMethod/types/callbacks/TraderCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/5ReplaceMethod/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts +++ b/TypeScript/5ReplaceMethod/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/5ReplaceMethod/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/5ReplaceMethod/types/helpers/AssortHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/AssortHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts +++ b/TypeScript/5ReplaceMethod/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/5ReplaceMethod/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/6ReferenceAnotherClass/types/callbacks/TraderCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/6ReferenceAnotherClass/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/AssortHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/AssortHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/6ReferenceAnotherClass/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/7OnLoadHook/types/callbacks/TraderCallbacks.d.ts b/TypeScript/7OnLoadHook/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/7OnLoadHook/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts +++ b/TypeScript/7OnLoadHook/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/7OnLoadHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/7OnLoadHook/types/helpers/AssortHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/7OnLoadHook/types/helpers/AssortHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/7OnLoadHook/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/7OnLoadHook/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/7OnLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/7OnLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/7OnLoadHook/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/8OnUpdateHook/types/callbacks/TraderCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/8OnUpdateHook/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts +++ b/TypeScript/8OnUpdateHook/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/8OnUpdateHook/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/8OnUpdateHook/types/helpers/AssortHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/AssortHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts +++ b/TypeScript/8OnUpdateHook/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/8OnUpdateHook/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/TypeScript/9RouterHooks/types/callbacks/TraderCallbacks.d.ts b/TypeScript/9RouterHooks/types/callbacks/TraderCallbacks.d.ts index 8df1049..1e75add 100644 --- a/TypeScript/9RouterHooks/types/callbacks/TraderCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/callbacks/TraderCallbacks.d.ts @@ -2,7 +2,7 @@ import { OnLoad } from "../di/OnLoad"; import { OnUpdate } from "../di/OnUpdate"; import { TraderController } from "../controllers/TraderController"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../models/eft/httpResponse/IGetBodyResponseData"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; export declare class TraderCallbacks implements OnLoad, OnUpdate { @@ -13,11 +13,6 @@ export declare class TraderCallbacks implements OnLoad, OnUpdate { onUpdate(): Promise; getRoute(): string; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - /** - * Handle client/trading/api/getUserAssortPrice/trader - * @returns - */ - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; } diff --git a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts index e76785a..9496013 100644 --- a/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/ProfileController.d.ts @@ -1,4 +1,5 @@ import { PlayerScavGenerator } from "../generators/PlayerScavGenerator"; +import { DialogueHelper } from "../helpers/DialogueHelper"; import { ItemHelper } from "../helpers/ItemHelper"; import { ProfileHelper } from "../helpers/ProfileHelper"; import { QuestHelper } from "../helpers/QuestHelper"; @@ -11,6 +12,7 @@ import { IProfileCreateRequestData } from "../models/eft/profile/IProfileCreateR import { ISearchFriendRequestData } from "../models/eft/profile/ISearchFriendRequestData"; import { ISearchFriendResponse } from "../models/eft/profile/ISearchFriendResponse"; import { IValidateNicknameRequestData } from "../models/eft/profile/IValidateNicknameRequestData"; +import { EventOutputHolder } from "../routers/EventOutputHolder"; import { DatabaseServer } from "../servers/DatabaseServer"; import { SaveServer } from "../servers/SaveServer"; import { ProfileFixerService } from "../services/ProfileFixerService"; @@ -24,10 +26,12 @@ export declare class ProfileController { protected itemHelper: ItemHelper; protected profileFixerService: ProfileFixerService; protected playerScavGenerator: PlayerScavGenerator; + protected eventOutputHolder: EventOutputHolder; protected traderHelper: TraderHelper; + protected dialogueHelper: DialogueHelper; protected questHelper: QuestHelper; protected profileHelper: ProfileHelper; - constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, traderHelper: TraderHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); + constructor(hashUtil: HashUtil, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileFixerService: ProfileFixerService, playerScavGenerator: PlayerScavGenerator, eventOutputHolder: EventOutputHolder, traderHelper: TraderHelper, dialogueHelper: DialogueHelper, questHelper: QuestHelper, profileHelper: ProfileHelper); getMiniProfiles(): IMiniProfile[]; getMiniProfile(sessionID: string): any; getCompleteProfile(sessionID: string): IPmcData[]; diff --git a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts index fe1754d..7e4bd69 100644 --- a/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/QuestController.d.ts @@ -60,13 +60,6 @@ export declare class QuestController { * @returns client response */ acceptQuest(pmcData: IPmcData, acceptedQuest: IAcceptQuestRequestData, sessionID: string): IItemEventRouterResponse; - /** - * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead - * @param startedMessageTextId startedMessageText property from IQuest - * @param questDescriptionId description property from IQuest - * @returns message id - */ - protected getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Handle the client accepting a repeatable quest and starting it * Send starting rewards if any to player and @@ -123,7 +116,14 @@ export declare class QuestController { * @param questsToFail quests to fail */ protected failQuests(sessionID: string, pmcData: IPmcData, questsToFail: IQuest[]): void; - handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; + /** + * + * @param pmcData Player profile + * @param handoverQuestRequest handover item request + * @param sessionID Session id + * @returns IItemEventRouterResponse + */ + handoverQuest(pmcData: IPmcData, handoverQuestRequest: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse; /** * Increment a backend counter stored value by an amount, * Create counter if it does not exist diff --git a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts index dd8dc40..171062d 100644 --- a/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/RepeatableQuestController.d.ts @@ -12,7 +12,7 @@ import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IItemEventRouterResponse } from "../models/eft/itemEvent/IItemEventRouterResponse"; import { IRepeatableQuestChangeRequest } from "../models/eft/quests/IRepeatableQuestChangeRequest"; import { ELocationName } from "../models/enums/ELocationName"; -import { IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; +import { IEliminationConfig, IQuestConfig, IRepeatableQuestConfig } from "../models/spt/config/IQuestConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { EventOutputHolder } from "../routers/EventOutputHolder"; import { ConfigServer } from "../servers/ConfigServer"; @@ -159,7 +159,14 @@ export declare class RepeatableQuestController { */ generateEliminationQuest(pmcLevel: number, traderId: string, questTypePool: IQuestTypePool, repeatableConfig: IRepeatableQuestConfig): IElimination; /** - * Cpnvert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) + * Get the relevant elimination config based on the current players PMC level + * @param pmcLevel Level of PMC character + * @param repeatableConfig Main repeatable config + * @returns IEliminationConfig + */ + protected getEliminationConfigByPmcLevel(pmcLevel: number, repeatableConfig: IRepeatableQuestConfig): IEliminationConfig; + /** + * Convert a location into an quest code can read (e.g. factory4_day into 55f2d3fd4bdc2d5f408b4567) * @param locationKey e.g factory4_day * @returns guid */ @@ -203,10 +210,11 @@ export declare class RepeatableQuestController { * Used to create a quest pool during each cycle of repeatable quest generation. The pool will be subsequently * narrowed down during quest generation to avoid duplicate quests. Like duplicate extractions or elimination quests * where you have to e.g. kill scavs in same locations. - * - * @returns {object} the quest pool + * @param repeatableConfig main repeatable quest config + * @param pmcLevel level of pmc generating quest pool + * @returns IQuestTypePool */ - generateQuestPool(repeatableConfig: IRepeatableQuestConfig): IQuestTypePool; + generateQuestPool(repeatableConfig: IRepeatableQuestConfig, pmcLevel: number): IQuestTypePool; /** * Generate the reward for a mission. A reward can consist of * - Experience diff --git a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts index b67aec9..007901b 100644 --- a/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts +++ b/TypeScript/9RouterHooks/types/controllers/TraderController.d.ts @@ -2,27 +2,25 @@ import { FenceBaseAssortGenerator } from "../generators/FenceBaseAssortGenerator import { ProfileHelper } from "../helpers/ProfileHelper"; import { TraderAssortHelper } from "../helpers/TraderAssortHelper"; import { TraderHelper } from "../helpers/TraderHelper"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../models/eft/common/tables/ITrader"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { FenceService } from "../services/FenceService"; import { TraderAssortService } from "../services/TraderAssortService"; import { TraderPurchasePersisterService } from "../services/TraderPurchasePersisterService"; import { JsonUtil } from "../utils/JsonUtil"; -import { TimeUtil } from "../utils/TimeUtil"; export declare class TraderController { protected logger: ILogger; protected databaseServer: DatabaseServer; protected traderAssortHelper: TraderAssortHelper; protected profileHelper: ProfileHelper; protected traderHelper: TraderHelper; - protected timeUtil: TimeUtil; protected traderAssortService: TraderAssortService; protected traderPurchasePersisterService: TraderPurchasePersisterService; protected fenceService: FenceService; protected fenceBaseAssortGenerator: FenceBaseAssortGenerator; protected jsonUtil: JsonUtil; - constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, timeUtil: TimeUtil, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); + constructor(logger: ILogger, databaseServer: DatabaseServer, traderAssortHelper: TraderAssortHelper, profileHelper: ProfileHelper, traderHelper: TraderHelper, traderAssortService: TraderAssortService, traderPurchasePersisterService: TraderPurchasePersisterService, fenceService: FenceService, fenceBaseAssortGenerator: FenceBaseAssortGenerator, jsonUtil: JsonUtil); /** * Runs when onLoad event is fired * Iterate over traders, ensure an unmolested copy of their assorts is stored in traderAssortService @@ -42,7 +40,13 @@ export declare class TraderController { * @returns array if ITraderBase objects */ getAllTraders(sessionID: string): ITraderBase[]; + /** + * Order traders by their traderId (Ttid) + * @param traderA First trader to compare + * @param traderB Second trader to compare + * @returns 1,-1 or 0 + */ + protected sortByTraderId(traderA: ITraderBase, traderB: ITraderBase): number; getTrader(sessionID: string, traderID: string): ITraderBase; getAssort(sessionId: string, traderId: string): ITraderAssort; - getPurchasesData(sessionID: string, traderID: string): Record; } diff --git a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts index 6703a36..4a8581c 100644 --- a/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotEquipmentModGenerator.d.ts @@ -14,6 +14,7 @@ import { DatabaseServer } from "../servers/DatabaseServer"; import { BotEquipmentFilterService } from "../services/BotEquipmentFilterService"; import { BotEquipmentModPoolService } from "../services/BotEquipmentModPoolService"; import { BotModLimits, BotWeaponModLimitService } from "../services/BotWeaponModLimitService"; +import { ItemBaseClassService } from "../services/ItemBaseClassService"; import { ItemFilterService } from "../services/ItemFilterService"; import { LocalisationService } from "../services/LocalisationService"; import { HashUtil } from "../utils/HashUtil"; @@ -28,6 +29,7 @@ export declare class BotEquipmentModGenerator { protected databaseServer: DatabaseServer; protected itemHelper: ItemHelper; protected botEquipmentFilterService: BotEquipmentFilterService; + protected itemBaseClassService: ItemBaseClassService; protected itemFilterService: ItemFilterService; protected profileHelper: ProfileHelper; protected botWeaponModLimitService: BotWeaponModLimitService; @@ -38,7 +40,7 @@ export declare class BotEquipmentModGenerator { protected botEquipmentModPoolService: BotEquipmentModPoolService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); + constructor(logger: ILogger, jsonUtil: JsonUtil, hashUtil: HashUtil, randomUtil: RandomUtil, probabilityHelper: ProbabilityHelper, databaseServer: DatabaseServer, itemHelper: ItemHelper, botEquipmentFilterService: BotEquipmentFilterService, itemBaseClassService: ItemBaseClassService, itemFilterService: ItemFilterService, profileHelper: ProfileHelper, botWeaponModLimitService: BotWeaponModLimitService, botHelper: BotHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, localisationService: LocalisationService, botEquipmentModPoolService: BotEquipmentModPoolService, configServer: ConfigServer); /** * Check mods are compatible and add to array * @param equipment Equipment item to add mods to diff --git a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts index 9581259..8992e9e 100644 --- a/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotGenerator.d.ts @@ -14,12 +14,14 @@ import { SeasonalEventService } from "../services/SeasonalEventService"; import { HashUtil } from "../utils/HashUtil"; import { JsonUtil } from "../utils/JsonUtil"; import { RandomUtil } from "../utils/RandomUtil"; +import { TimeUtil } from "../utils/TimeUtil"; import { BotInventoryGenerator } from "./BotInventoryGenerator"; import { BotLevelGenerator } from "./BotLevelGenerator"; export declare class BotGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected timeUtil: TimeUtil; protected jsonUtil: JsonUtil; protected profileHelper: ProfileHelper; protected databaseServer: DatabaseServer; @@ -32,7 +34,7 @@ export declare class BotGenerator { protected seasonalEventService: SeasonalEventService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, timeUtil: TimeUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botLevelGenerator: BotLevelGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, seasonalEventService: SeasonalEventService, configServer: ConfigServer); /** * Generate a player scav bot object * @param role e.g. assault / pmcbot diff --git a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts index 6273a11..a4ce4e0 100644 --- a/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/BotLootGenerator.d.ts @@ -1,6 +1,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper"; import { BotWeaponGeneratorHelper } from "../helpers/BotWeaponGeneratorHelper"; import { HandbookHelper } from "../helpers/HandbookHelper"; +import { ItemHelper } from "../helpers/ItemHelper"; import { Inventory as PmcInventory } from "../models/eft/common/tables/IBotBase"; import { Chances, Inventory, ItemMinMax, ModsChances } from "../models/eft/common/tables/IBotType"; import { Item } from "../models/eft/common/tables/IItem"; @@ -18,6 +19,7 @@ export declare class BotLootGenerator { protected logger: ILogger; protected hashUtil: HashUtil; protected randomUtil: RandomUtil; + protected itemHelper: ItemHelper; protected databaseServer: DatabaseServer; protected handbookHelper: HandbookHelper; protected botGeneratorHelper: BotGeneratorHelper; @@ -27,7 +29,7 @@ export declare class BotLootGenerator { protected localisationService: LocalisationService; protected configServer: ConfigServer; protected botConfig: IBotConfig; - constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); + constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, itemHelper: ItemHelper, databaseServer: DatabaseServer, handbookHelper: HandbookHelper, botGeneratorHelper: BotGeneratorHelper, botWeaponGenerator: BotWeaponGenerator, botWeaponGeneratorHelper: BotWeaponGeneratorHelper, botLootCacheService: BotLootCacheService, localisationService: LocalisationService, configServer: ConfigServer); /** * Add loot to bots containers * @param sessionId Session id diff --git a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts index 10918e3..8dd47ef 100644 --- a/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts +++ b/TypeScript/9RouterHooks/types/generators/PMCLootGenerator.d.ts @@ -1,4 +1,5 @@ import { ItemHelper } from "../helpers/ItemHelper"; +import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { IBotConfig } from "../models/spt/config/IBotConfig"; import { ConfigServer } from "../servers/ConfigServer"; import { DatabaseServer } from "../servers/DatabaseServer"; @@ -15,6 +16,7 @@ export declare class PMCLootGenerator { protected itemFilterService: ItemFilterService; protected seasonalEventService: SeasonalEventService; protected pocketLootPool: string[]; + protected vestLootPool: string[]; protected backpackLootPool: string[]; protected botConfig: IBotConfig; constructor(itemHelper: ItemHelper, databaseServer: DatabaseServer, configServer: ConfigServer, itemFilterService: ItemFilterService, seasonalEventService: SeasonalEventService); @@ -23,6 +25,18 @@ export declare class PMCLootGenerator { * @returns string array of tpls */ generatePMCPocketLootPool(): string[]; + /** + * Create an array of loot items a PMC can have in their vests + * @returns string array of tpls + */ + generatePMCVestLootPool(): string[]; + /** + * Check if item has a width/hide that lets it fit into a 1x2 slot + * 1x1 / 1x2 / 2x1 + * @param item Item to check size of + * @returns true if it fits + */ + protected itemFitsInto1By2Slot(item: ITemplateItem): boolean; /** * Create an array of loot items a PMC can have in their backpack * @returns string array of tpls diff --git a/TypeScript/9RouterHooks/types/helpers/AssortHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/AssortHelper.d.ts index 13512b2..bc66b09 100644 --- a/TypeScript/9RouterHooks/types/helpers/AssortHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/AssortHelper.d.ts @@ -1,5 +1,6 @@ import { IPmcData } from "../models/eft/common/IPmcData"; import { ITraderAssort } from "../models/eft/common/tables/ITrader"; +import { QuestStatus } from "../models/enums/QuestStatus"; import { ILogger } from "../models/spt/utils/ILogger"; import { DatabaseServer } from "../servers/DatabaseServer"; import { LocalisationService } from "../services/LocalisationService"; @@ -15,12 +16,22 @@ export declare class AssortHelper { /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile - * @param traderId traders id - * @param assort assort items from a trader - * @param mergedQuestAssorts An object of quest assort to quest id unlocks for all traders + * @param traderId traders id the assort belongs to + * @param traderAssorts All assort items from same trader + * @param mergedQuestAssorts Dict of quest assort to quest id unlocks for all traders * @returns assort items minus locked quest assorts */ - stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, assort: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + stripLockedQuestAssort(pmcProfile: IPmcData, traderId: string, traderAssorts: ITraderAssort, mergedQuestAssorts: Record>, flea?: boolean): ITraderAssort; + /** + * Get a quest id + the statuses quest can be in to unlock assort + * @param mergedQuestAssorts quest assorts to search for assort id + * @param assortId Assort to look for linked quest id + * @returns quest id + array of quest status the assort should show for + */ + protected getQuestIdAndStatusThatShowAssort(mergedQuestAssorts: Record>, assortId: string): { + questId: string; + status: QuestStatus[]; + }; /** * Remove assorts from a trader that have not been unlocked yet * @param pmcProfile player profile diff --git a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts index de7cba2..20973f4 100644 --- a/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/QuestHelper.d.ts @@ -40,7 +40,7 @@ export declare class QuestHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, jsonUtil: JsonUtil, timeUtil: TimeUtil, hashUtil: HashUtil, itemHelper: ItemHelper, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, localeService: LocaleService, ragfairServerHelper: RagfairServerHelper, dialogueHelper: DialogueHelper, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, localisationService: LocalisationService, traderHelper: TraderHelper, configServer: ConfigServer); /** - * Get status of a quest by quest id + * Get status of a quest in player profile by its id * @param pmcData Profile to search * @param questID Quest id to look up * @returns QuestStatus enum @@ -160,6 +160,13 @@ export declare class QuestHelper { * @returns IQuest object */ getQuestFromDb(questId: string, pmcData: IPmcData): IQuest; + /** + * Get a quests startedMessageText key from db, if no startedMessageText key found, use description key instead + * @param startedMessageTextId startedMessageText property from IQuest + * @param questDescriptionId description property from IQuest + * @returns message id + */ + getMessageIdForQuestStart(startedMessageTextId: string, questDescriptionId: string): string; /** * Get the locale Id from locale db for a quest message * @param questMessageId Quest message id to look up diff --git a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts index 3d0d570..0e92762 100644 --- a/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/RagfairOfferHelper.d.ts @@ -47,7 +47,22 @@ export declare class RagfairOfferHelper { protected questConfig: IQuestConfig; constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, eventOutputHolder: EventOutputHolder, databaseServer: DatabaseServer, traderHelper: TraderHelper, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer); getValidOffers(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; - getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Get offers from flea/traders specifically when building weapon preset + * @param searchRequest Search request data + * @param itemsToAdd string array of item tpls to search for + * @param traderAssorts All trader assorts player can access/buy + * @param pmcProfile Player profile + * @returns ITraderAssort + */ + getOffersForBuild(searchRequest: ISearchRequestData, itemsToAdd: string[], traderAssorts: Record, pmcProfile: IPmcData): IRagfairOffer[]; + /** + * Check if offer item is quest locked for current player by looking at sptQuestLocked property in traders barter_scheme + * @param offer Offer to check is quest locked + * @param traderAssorts all trader assorts for player + * @returns true if quest locked + */ + traderOfferItemQuestLocked(offer: IRagfairOffer, traderAssorts: Record): boolean; /** * Has a traders offer ran out of stock to sell to player * @param offer Offer to check stock of diff --git a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts index 49aea28..fddacba 100644 --- a/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts +++ b/TypeScript/9RouterHooks/types/helpers/TraderHelper.d.ts @@ -1,7 +1,5 @@ -import { FenceLevel } from "../models/eft/common/IGlobals"; import { IPmcData } from "../models/eft/common/IPmcData"; -import { Item } from "../models/eft/common/tables/IItem"; -import { IBarterScheme, ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase, LoyaltyLevel } from "../models/eft/common/tables/ITrader"; import { ITraderConfig } from "../models/spt/config/ITraderConfig"; import { ILogger } from "../models/spt/utils/ILogger"; import { ConfigServer } from "../servers/ConfigServer"; @@ -12,16 +10,12 @@ import { LocalisationService } from "../services/LocalisationService"; import { PlayerService } from "../services/PlayerService"; import { TimeUtil } from "../utils/TimeUtil"; import { HandbookHelper } from "./HandbookHelper"; -import { ItemHelper } from "./ItemHelper"; -import { PaymentHelper } from "./PaymentHelper"; import { ProfileHelper } from "./ProfileHelper"; export declare class TraderHelper { protected logger: ILogger; protected databaseServer: DatabaseServer; protected saveServer: SaveServer; protected profileHelper: ProfileHelper; - protected paymentHelper: PaymentHelper; - protected itemHelper: ItemHelper; protected handbookHelper: HandbookHelper; protected playerService: PlayerService; protected localisationService: LocalisationService; @@ -31,7 +25,7 @@ export declare class TraderHelper { protected traderConfig: ITraderConfig; /** Dictionary of item tpl and the highest trader rouble price */ protected highestTraderPriceItems: Record; - constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, paymentHelper: PaymentHelper, itemHelper: ItemHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); + constructor(logger: ILogger, databaseServer: DatabaseServer, saveServer: SaveServer, profileHelper: ProfileHelper, handbookHelper: HandbookHelper, playerService: PlayerService, localisationService: LocalisationService, fenceService: FenceService, timeUtil: TimeUtil, configServer: ConfigServer); getTrader(traderID: string, sessionID: string): ITraderBase; getTraderAssortsById(traderId: string): ITraderAssort; /** @@ -48,62 +42,6 @@ export declare class TraderHelper { * @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 - * @param sessionID session id - * @returns IBarterScheme[][] - */ - getPurchasesData(traderID: string, sessionID: string): Record; - /** - * Should item be skipped when selling to trader according to its sell categories and other checks - * @param pmcData Profile - * @param item Item to be checked is sellable to trader - * @param sellCategory categories trader will buy - * @param traderId Trader item is being checked can be sold to - * @returns true if should NOT be sold to trader - */ - protected isItemUnSellableToTrader(pmcData: IPmcData, item: Item, sellCategory: string[], traderId: string): boolean; - /** - * Check if item has durability so low it precludes it from being sold to the trader (inclusive) - * @param item Item to check durability of - * @param traderId Trader item is sold to - * @returns - */ - protected itemIsBelowSellableDurabilityThreshhold(item: Item, traderId: string): boolean; - /** - * Get the percentage threshold value a trader will buy armor/weapons above - * @param traderId Trader to look up - * @returns percentage - */ - protected getTraderDurabiltyPurchaseThreshold(traderId: string): number; - /** - * Get the price of passed in item and all of its attached children (mods) - * Take into account bonuses/adjustments e.g. discounts - * @param pmcData profile data - * @param item item to calculate price of - * @param buyPriceCoefficient - * @param fenceInfo fence data - * @param traderBase trader details - * @param currencyTpl Currency to get price as - * @returns price of item + children - */ - protected getAdjustedItemPrice(pmcData: IPmcData, item: Item, buyPriceCoefficient: number, fenceInfo: FenceLevel, traderBase: ITraderBase, currencyTpl: string): number; - /** - * Get the raw price of item+child items from handbook without any modification - * @param pmcData profile data - * @param item item to calculate price of - * @returns price as number - */ - protected getRawItemPrice(pmcData: IPmcData, item: Item): number; - /** - * Get discount modifier for desired trader - * @param trader Trader to get discount for - * @param buyPriceCoefficient - * @param fenceInfo fence info, needed if getting fence modifier value - * @returns discount modifier value - */ - protected getTraderDiscount(trader: ITraderBase, buyPriceCoefficient: number, fenceInfo: FenceLevel): number; /** * Add standing to a trader and level them up if exp goes over level threshold * @param sessionId Session id @@ -129,13 +67,6 @@ export declare class TraderHelper { * @returns Time in seconds */ getTraderUpdateSeconds(traderId: string): number; - /** - * check if an item is allowed to be sold to a trader - * @param categoriesTraderBuys array of allowed categories - * @param tplToCheck itemTpl of inventory - * @returns boolean if item can be sold to trader - */ - doesTraderBuyItem(categoriesTraderBuys: string[], tplToCheck: string): boolean; getLoyaltyLevel(traderID: string, pmcData: IPmcData): LoyaltyLevel; /** * Store the purchase of an assort from a trader in the player profile diff --git a/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts b/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts index 14b795e..1350a2f 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/ILooseLoot.d.ts @@ -1,3 +1,4 @@ +import { Item } from "./tables/IItem"; export interface ILooseLoot { spawnpointCount: SpawnpointCount; spawnpointsForced: SpawnpointsForced[]; @@ -24,10 +25,6 @@ export interface SpawnpointTemplate { Root: any; Items: Item[]; } -export interface Item { - _id: string; - _tpl?: string; -} export interface Spawnpoint { locationId: string; probability: number; 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 5c939e1..52968b1 100644 --- a/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/common/tables/IQuest.d.ts @@ -46,7 +46,7 @@ export interface AvailableForProps { parentId: string; isEncoded: boolean; dynamicLocale: boolean; - value?: number; + value?: string | number; compareMethod?: string; visibilityConditions?: VisibilityCondition[]; target?: string | string[]; diff --git a/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutProduction.d.ts b/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutProduction.d.ts index 2367e08..8bed3cc 100644 --- a/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutProduction.d.ts +++ b/TypeScript/9RouterHooks/types/models/eft/hideout/IHideoutProduction.d.ts @@ -20,4 +20,5 @@ export interface Requirement { areaType?: number; requiredLevel?: number; resource?: number; + questId?: string; } diff --git a/TypeScript/9RouterHooks/types/models/spt/callbacks/ITraderCallbacks.d.ts b/TypeScript/9RouterHooks/types/models/spt/callbacks/ITraderCallbacks.d.ts index e0d7d06..b784408 100644 --- a/TypeScript/9RouterHooks/types/models/spt/callbacks/ITraderCallbacks.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/callbacks/ITraderCallbacks.d.ts @@ -1,10 +1,9 @@ import { IEmptyRequestData } from "../../eft/common/IEmptyRequestData"; -import { IBarterScheme, ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; +import { ITraderAssort, ITraderBase } from "../../eft/common/tables/ITrader"; import { IGetBodyResponseData } from "../../eft/httpResponse/IGetBodyResponseData"; export interface ITraderCallbacks { load(): void; getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; - getProfilePurchases(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData>; getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData; update(): boolean; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts index 979122c..87098da 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IPmcConfig.d.ts @@ -1,5 +1,8 @@ import { MinMax } from "../../common/MinMax"; export interface IPmcConfig { + vestLoot: SlotLootSettings; + pocketLoot: SlotLootSettings; + backpackLoot: SlotLootSettings; dynamicLoot: DynamicLoot; useDifficultyOverride: boolean; difficulty: string; @@ -22,8 +25,11 @@ export interface PmcTypes { usec: string; bear: string; } -export interface DynamicLoot { +export interface SlotLootSettings { whitelist: string[]; blacklist: string[]; moneyStackLimits: Record; } +export interface DynamicLoot { + moneyStackLimits: Record; +} diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts index 9adfaba..94c00fd 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IQuestConfig.d.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { ELocationName } from "../../enums/ELocationName"; import { IBaseConfig } from "./IBaseConfig"; export interface IQuestConfig extends IBaseConfig { @@ -50,7 +51,7 @@ export interface ITraderWhitelist { export interface IRepeatableQuestTypesConfig { Exploration: IExploration; Completion: ICompletion; - Elimination: IElimination; + Elimination: IEliminationConfig[]; } export interface IExploration { maxExtracts: number; @@ -68,7 +69,8 @@ export interface ICompletion { useWhitelist: boolean; useBlacklist: boolean; } -export interface IElimination { +export interface IEliminationConfig { + levelRange: MinMax; targets: ITarget[]; bodyPartProb: number; bodyParts: IBodyPart[]; @@ -80,11 +82,6 @@ export interface IElimination { maxKills: number; minKills: number; } -export interface IProbabilityObject { - key: string; - relativeProbability: number; - data?: any; -} export interface ITarget extends IProbabilityObject { data: IBossInfo; } @@ -94,3 +91,8 @@ export interface IBossInfo { export interface IBodyPart extends IProbabilityObject { data: string[]; } +export interface IProbabilityObject { + key: string; + relativeProbability: number; + data?: any; +} diff --git a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts index 3fa04de..75357d0 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/IRagfairConfig.d.ts @@ -30,6 +30,8 @@ export interface Reputation { } export interface Dynamic { purchasesAreFoundInRaid: boolean; + /** Use the highest trader price for an offer if its greater than the price in templates/prices.json */ + useTraderPriceForOffersIfHigher: boolean; barter: Barter; offerAdjustment: OfferAdjustment; expiredOfferThreshold: number; diff --git a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts index 56c7d35..9a7c6ea 100644 --- a/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts +++ b/TypeScript/9RouterHooks/types/models/spt/config/ITraderConfig.d.ts @@ -4,8 +4,6 @@ export interface ITraderConfig extends IBaseConfig { kind: "aki-trader"; updateTime: UpdateTime[]; updateTimeDefault: number; - /** What % of max durability an item needs to sell to a trader*/ - durabilityPurchaseThreshhold: Record; traderPriceMultipler: number; persistPurchaseDataInProfile: boolean; fence: FenceConfig; diff --git a/readme.md b/readme.md index 55094a1..41bb68f 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Mod examples for 3.5.0 +# Mod examples for 3.5.1 A collection of example mods that perform typical actions in SPT