diff --git a/dCommon/dEnums/eCharacterVersion.h b/dCommon/dEnums/eCharacterVersion.h index 683951e3..51e6e5e5 100644 --- a/dCommon/dEnums/eCharacterVersion.h +++ b/dCommon/dEnums/eCharacterVersion.h @@ -16,7 +16,9 @@ enum class eCharacterVersion : uint32_t { VAULT_SIZE, // Fixes speed base value in level component SPEED_BASE, - UP_TO_DATE, // will become NJ_JAYMISSIONS + // Fixes nexus force explorer missions + NJ_JAYMISSIONS, + UP_TO_DATE, // will become NEXUS_FORCE_EXPLORER }; #endif //!__ECHARACTERVERSION__H__ diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index 1506cac4..cd50fd73 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -1042,25 +1042,29 @@ void HandlePacket(Packet* packet) { // Do charxml fixes here auto* levelComponent = player->GetComponent(); auto* const inventoryComponent = player->GetComponent(); - const auto* const missionComponent = player->GetComponent(); + auto* const missionComponent = player->GetComponent(); if (!levelComponent || !missionComponent || !inventoryComponent) return; auto version = levelComponent->GetCharacterVersion(); switch (version) { case eCharacterVersion::RELEASE: // TODO: Implement, super low priority + [[fallthrough]]; case eCharacterVersion::LIVE: LOG("Updating Character Flags"); c->SetRetroactiveFlags(); levelComponent->SetCharacterVersion(eCharacterVersion::PLAYER_FACTION_FLAGS); + [[fallthrough]]; case eCharacterVersion::PLAYER_FACTION_FLAGS: LOG("Updating Vault Size"); player->RetroactiveVaultSize(); levelComponent->SetCharacterVersion(eCharacterVersion::VAULT_SIZE); + [[fallthrough]]; case eCharacterVersion::VAULT_SIZE: LOG("Updaing Speedbase"); levelComponent->SetRetroactiveBaseSpeed(); levelComponent->SetCharacterVersion(eCharacterVersion::SPEED_BASE); + [[fallthrough]]; case eCharacterVersion::SPEED_BASE: { LOG("Removing lots from NJ Jay missions bugged at foss"); // https://explorer.lu/missions/1789 @@ -1075,7 +1079,22 @@ void HandlePacket(Packet* packet) { inventoryComponent->RemoveItem(14493, 1, eInventoryType::ITEMS); inventoryComponent->RemoveItem(14493, 1, eInventoryType::VAULT_ITEMS); } - levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE); + levelComponent->SetCharacterVersion(eCharacterVersion::NJ_JAYMISSIONS); + [[fallthrough]]; + } + case eCharacterVersion::NJ_JAYMISSIONS: { + LOG("Fixing Nexus Force Explorer missions"); + auto missions = { 502 /* Pet Cove */, 593/* Nimbus Station */, 938/* Avant Gardens */, 284/* Gnarled Forest */, 754/* Forbidden Valley */ }; + bool complete = true; + for (auto missionID : missions) { + auto* mission = missionComponent->GetMission(missionID); + if (!mission->IsComplete()) { + complete = false; + } + } + + if (complete) missionComponent->CompleteMission(937 /* Nexus Force explorer */); + [[fallthrough]]; } case eCharacterVersion::UP_TO_DATE: break;