mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 14:58:27 +00:00
fix item exploits
Update VendorComponent.cpp Update Mail.cpp
This commit is contained in:
@@ -24,6 +24,6 @@ void AgCagedBricksServer::OnUse(Entity* self, Entity* user) {
|
||||
auto inv = static_cast<InventoryComponent*>(user->GetComponent(eReplicaComponentType::INVENTORY));
|
||||
|
||||
if (inv) {
|
||||
inv->RemoveItem(14553, 1);
|
||||
inv->RemoveItem(14553, 1, eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ void NpcCowboyServer::OnMissionDialogueOK(Entity* self, Entity* target, int miss
|
||||
inventoryComponent->AddItem(14378, 1, eLootSourceType::NONE);
|
||||
}
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventoryComponent->RemoveItem(14378, 1);
|
||||
inventoryComponent->RemoveItem(14378, 1, eInventoryType::ALL);
|
||||
}
|
||||
|
||||
// Next up hide or show the samples based on the mission state
|
||||
|
@@ -22,7 +22,7 @@ void NpcWispServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
&& maelstromVacuum == nullptr) {
|
||||
inventory->AddItem(maelstromVacuumLot, 1, eLootSourceType::NONE);
|
||||
} else if (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
|
||||
inventory->RemoveItem(maelstromVacuumLot, 1);
|
||||
inventory->RemoveItem(maelstromVacuumLot, 1, eInventoryType::ALL);
|
||||
}
|
||||
|
||||
// Next up hide or show the samples based on the mission state
|
||||
|
@@ -31,7 +31,7 @@ void RemoveRentalGear::OnMissionDialogueOK(Entity* self, Entity* target, int mis
|
||||
auto* id = inv->FindItemByLot(item);
|
||||
if (id) {
|
||||
inv->UnEquipItem(id);
|
||||
inv->RemoveItem(id->GetLot(), id->GetCount());
|
||||
inv->RemoveItem(id->GetLot(), id->GetCount(), eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -74,13 +74,13 @@ void ImgBrickConsoleQB::OnUse(Entity* self, Entity* user) {
|
||||
|
||||
if (missionComponent != nullptr && inventoryComponent != nullptr) {
|
||||
if (missionComponent->GetMissionState(1302) == eMissionState::ACTIVE) {
|
||||
inventoryComponent->RemoveItem(13074, 1);
|
||||
inventoryComponent->RemoveItem(13074, 1, eInventoryType::ALL);
|
||||
|
||||
missionComponent->ForceProgressTaskType(1302, 1, 1);
|
||||
}
|
||||
|
||||
if (missionComponent->GetMissionState(1926) == eMissionState::ACTIVE) {
|
||||
inventoryComponent->RemoveItem(14472, 1);
|
||||
inventoryComponent->RemoveItem(14472, 1, eInventoryType::ALL);
|
||||
|
||||
missionComponent->ForceProgressTaskType(1926, 1, 1);
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ void TokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
//make sure the user has the required amount of infected bricks
|
||||
if (inv && inv->GetLotCount(6194) >= bricksToTake) {
|
||||
//yeet the bricks
|
||||
inv->RemoveItem(6194, bricksToTake);
|
||||
inv->RemoveItem(6194, bricksToTake, eInventoryType::ALL);
|
||||
|
||||
//play sound
|
||||
if (self->HasVar(u"sound1")) {
|
||||
|
@@ -34,7 +34,7 @@ void NsTokenConsoleServer::OnUse(Entity* self, Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
inventoryComponent->RemoveItem(6194, 25);
|
||||
inventoryComponent->RemoveItem(6194, 25, eInventoryType::ALL);
|
||||
|
||||
const auto useSound = self->GetVar<std::string>(u"sound1");
|
||||
|
||||
|
@@ -51,7 +51,7 @@ void NtCombatChallengeServer::OnMessageBoxResponse(Entity* self, Entity* sender,
|
||||
auto* inventoryComponent = sender->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent != nullptr) {
|
||||
inventoryComponent->RemoveItem(3039, 1);
|
||||
inventoryComponent->RemoveItem(3039, 1, eInventoryType::ALL);
|
||||
}
|
||||
|
||||
GameMessages::SendPlayNDAudioEmitter(self, sender->GetSystemAddress(), startSound);
|
||||
|
@@ -34,7 +34,7 @@ void NtDukeServer::OnMissionDialogueOK(Entity* self, Entity* target, int mission
|
||||
if ((state == eMissionState::AVAILABLE || state == eMissionState::ACTIVE) && lotCount < 1) {
|
||||
inventoryComponent->AddItem(m_SwordLot, 1, eLootSourceType::NONE);
|
||||
} else if (state == eMissionState::READY_TO_COMPLETE) {
|
||||
inventoryComponent->RemoveItem(m_SwordLot, lotCount);
|
||||
inventoryComponent->RemoveItem(m_SwordLot, lotCount, eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
NtBcSubmitServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
||||
|
@@ -8,7 +8,7 @@ void NtVandaServer::OnMissionDialogueOK(Entity* self, Entity* target, int missio
|
||||
if (missionID == m_AlienPartMissionID && missionState == eMissionState::READY_TO_COMPLETE) {
|
||||
auto* inventoryComponent = target->GetComponent<InventoryComponent>();
|
||||
for (const auto& alienPartLot : m_AlienPartLots) {
|
||||
inventoryComponent->RemoveItem(alienPartLot, 1);
|
||||
inventoryComponent->RemoveItem(alienPartLot, 1, eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
NtBcSubmitServer::OnMissionDialogueOK(self, target, missionID, missionState);
|
||||
|
@@ -20,7 +20,7 @@ void SpawnGryphonServer::OnUse(Entity* self, Entity* user) {
|
||||
// Little extra for handling the case of the egg being placed the first time
|
||||
if (missionComponent != nullptr && inventoryComponent != nullptr
|
||||
&& missionComponent->GetMissionState(1391) == eMissionState::ACTIVE) {
|
||||
inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483));
|
||||
inventoryComponent->RemoveItem(12483, inventoryComponent->GetLotCount(12483), eInventoryType::ALL);
|
||||
GameMessages::SendTerminateInteraction(user->GetObjectID(), eTerminateType::FROM_INTERACTION, self->GetObjectID());
|
||||
return;
|
||||
}
|
||||
|
@@ -39,7 +39,7 @@ void NjColeNPC::OnMissionDialogueOK(Entity* self, Entity* target, int missionID,
|
||||
}
|
||||
|
||||
if (inventoryComponent->GetLotCount(14499) > 0) {
|
||||
inventoryComponent->RemoveItem(14499, 1);
|
||||
inventoryComponent->RemoveItem(14499, 1, eInventoryType::ALL);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ void NjScrollChestServer::OnUse(Entity* self, Entity* user) {
|
||||
if (playerInventory != nullptr && playerInventory->GetLotCount(keyLOT) == 1) {
|
||||
|
||||
// Check for the key and remove
|
||||
playerInventory->RemoveItem(keyLOT, 1);
|
||||
playerInventory->RemoveItem(keyLOT, 1, eInventoryType::ALL);
|
||||
|
||||
// Reward the player with the item set
|
||||
playerInventory->AddItem(rewardItemLOT, 1, eLootSourceType::NONE);
|
||||
|
@@ -14,7 +14,7 @@ void NPCAddRemoveItem::OnMissionDialogueOK(Entity* self, Entity* target, int mis
|
||||
if (itemSetting.add && (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE)) {
|
||||
inventory->AddItem(lot, 1, eLootSourceType::NONE);
|
||||
} else if (itemSetting.remove && (missionState == eMissionState::READY_TO_COMPLETE || missionState == eMissionState::COMPLETE_READY_TO_COMPLETE)) {
|
||||
inventory->RemoveItem(lot, 1);
|
||||
inventory->RemoveItem(lot, 1, eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ void AgPropGuard::OnMissionDialogueOK(Entity* self, Entity* target, int missionI
|
||||
|
||||
if (id) {
|
||||
inventoryComponent->UnEquipItem(id);
|
||||
inventoryComponent->RemoveItem(id->GetLot(), id->GetCount());
|
||||
inventoryComponent->RemoveItem(id->GetLot(), id->GetCount(), eInventoryType::ALL);
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
|
Reference in New Issue
Block a user