diff --git a/dCommon/dEnums/eCharacterVersion.h b/dCommon/dEnums/eCharacterVersion.h index 0fab4498..683951e3 100644 --- a/dCommon/dEnums/eCharacterVersion.h +++ b/dCommon/dEnums/eCharacterVersion.h @@ -15,7 +15,8 @@ enum class eCharacterVersion : uint32_t { // Fixes vault size value VAULT_SIZE, // Fixes speed base value in level component - UP_TO_DATE, // will become SPEED_BASE + SPEED_BASE, + UP_TO_DATE, // will become NJ_JAYMISSIONS }; #endif //!__ECHARACTERVERSION__H__ diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index e07104d6..51ece550 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -79,7 +79,9 @@ #include "PositionUpdate.h" #include "PlayerManager.h" #include "eLoginResponse.h" +#include "MissionComponent.h" #include "SlashCommandHandler.h" +#include "InventoryComponent.h" namespace Game { Logger* logger = nullptr; @@ -1042,7 +1044,9 @@ void HandlePacket(Packet* packet) { // Do charxml fixes here auto* levelComponent = player->GetComponent(); - if (!levelComponent) return; + auto* const inventoryComponent = player->GetComponent(); + const auto* const missionComponent = player->GetComponent(); + if (!levelComponent || !missionComponent || !inventoryComponent) return; auto version = levelComponent->GetCharacterVersion(); switch (version) { @@ -1059,7 +1063,23 @@ void HandlePacket(Packet* packet) { case eCharacterVersion::VAULT_SIZE: LOG("Updaing Speedbase"); levelComponent->SetRetroactiveBaseSpeed(); + levelComponent->SetCharacterVersion(eCharacterVersion::SPEED_BASE); + case eCharacterVersion::SPEED_BASE: { + LOG("Removing lots from NJ Jay missions bugged at foss"); + // https://explorer.lu/missions/1789 + const auto* mission = missionComponent->GetMission(1789); + if (mission && mission->IsComplete()) { + inventoryComponent->RemoveItem(14474, 1, eInventoryType::ITEMS); + inventoryComponent->RemoveItem(14474, 1, eInventoryType::VAULT_ITEMS); + } + // https://explorer.lu/missions/1927 + mission = missionComponent->GetMission(1927); + if (mission && mission->IsComplete()) { + inventoryComponent->RemoveItem(14493, 1, eInventoryType::ITEMS); + inventoryComponent->RemoveItem(14493, 1, eInventoryType::VAULT_ITEMS); + } levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE); + } case eCharacterVersion::UP_TO_DATE: break; }