mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
fix: remove ninjago missions items for completed missions (#1643)
* fix: ninjago missions remove items fixes an issue where this mission was completed prior to a bug fix, causing the items to remain in the inventory. Tested that players with the mission completed have the item correctly removed from their inventory. * Update eCharacterVersion.h
This commit is contained in:
parent
628ac9807e
commit
677e7c1097
@ -15,7 +15,8 @@ enum class eCharacterVersion : uint32_t {
|
|||||||
// Fixes vault size value
|
// Fixes vault size value
|
||||||
VAULT_SIZE,
|
VAULT_SIZE,
|
||||||
// Fixes speed base value in level component
|
// 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__
|
#endif //!__ECHARACTERVERSION__H__
|
||||||
|
@ -79,7 +79,9 @@
|
|||||||
#include "PositionUpdate.h"
|
#include "PositionUpdate.h"
|
||||||
#include "PlayerManager.h"
|
#include "PlayerManager.h"
|
||||||
#include "eLoginResponse.h"
|
#include "eLoginResponse.h"
|
||||||
|
#include "MissionComponent.h"
|
||||||
#include "SlashCommandHandler.h"
|
#include "SlashCommandHandler.h"
|
||||||
|
#include "InventoryComponent.h"
|
||||||
|
|
||||||
namespace Game {
|
namespace Game {
|
||||||
Logger* logger = nullptr;
|
Logger* logger = nullptr;
|
||||||
@ -1042,7 +1044,9 @@ void HandlePacket(Packet* packet) {
|
|||||||
|
|
||||||
// Do charxml fixes here
|
// Do charxml fixes here
|
||||||
auto* levelComponent = player->GetComponent<LevelProgressionComponent>();
|
auto* levelComponent = player->GetComponent<LevelProgressionComponent>();
|
||||||
if (!levelComponent) return;
|
auto* const inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||||
|
const auto* const missionComponent = player->GetComponent<MissionComponent>();
|
||||||
|
if (!levelComponent || !missionComponent || !inventoryComponent) return;
|
||||||
|
|
||||||
auto version = levelComponent->GetCharacterVersion();
|
auto version = levelComponent->GetCharacterVersion();
|
||||||
switch (version) {
|
switch (version) {
|
||||||
@ -1059,7 +1063,23 @@ void HandlePacket(Packet* packet) {
|
|||||||
case eCharacterVersion::VAULT_SIZE:
|
case eCharacterVersion::VAULT_SIZE:
|
||||||
LOG("Updaing Speedbase");
|
LOG("Updaing Speedbase");
|
||||||
levelComponent->SetRetroactiveBaseSpeed();
|
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);
|
levelComponent->SetCharacterVersion(eCharacterVersion::UP_TO_DATE);
|
||||||
|
}
|
||||||
case eCharacterVersion::UP_TO_DATE:
|
case eCharacterVersion::UP_TO_DATE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user