Revert "Merge pull request #1101 from KinglyKrab/custom"

This reverts commit 43108acae1, reversing
changes made to daa1db65b9.
This commit is contained in:
Akkadius
2020-08-03 22:21:51 -05:00
parent 43108acae1
commit bda13383ef
14 changed files with 20 additions and 190 deletions
-34
View File
@@ -2720,40 +2720,6 @@ int QuestManager::countitem(uint32 item_id) {
return quantity;
}
void QuestManager::removeitem(uint32 item_id, uint32 quantity) {
QuestManagerCurrentQuestVars();
EQ::ItemInstance *item = nullptr;
static const int16 slots[][2] = {
{ EQ::invslot::POSSESSIONS_BEGIN, EQ::invslot::POSSESSIONS_END },
{ EQ::invbag::GENERAL_BAGS_BEGIN, EQ::invbag::GENERAL_BAGS_END },
{ EQ::invbag::CURSOR_BAG_BEGIN, EQ::invbag::CURSOR_BAG_END},
{ EQ::invslot::BANK_BEGIN, EQ::invslot::BANK_END },
{ EQ::invbag::BANK_BAGS_BEGIN, EQ::invbag::BANK_BAGS_END },
{ EQ::invslot::SHARED_BANK_BEGIN, EQ::invslot::SHARED_BANK_END },
{ EQ::invbag::SHARED_BANK_BAGS_BEGIN, EQ::invbag::SHARED_BANK_BAGS_END },
};
int removed_count = 0;
const size_t size = sizeof(slots) / sizeof(slots[0]);
for (int slot_index = 0; slot_index < size; ++slot_index) {
for (int slot_id = slots[slot_index][0]; slot_id <= slots[slot_index][1]; ++slot_id) {
item = initiator->GetInv().GetItem(slot_id);
if (item && item->GetID() == item_id) {
int stack_size = item->IsStackable() ? item->GetCharges() : 1;
if ((removed_count + stack_size) <= quantity) {
removed_count += stack_size;
initiator->DeleteItemInInventory(slot_id, stack_size, true);
} else {
int amount_left = (quantity - removed_count);
if (amount_left > 0 && stack_size >= amount_left) {
removed_count += amount_left;
initiator->DeleteItemInInventory(slot_id, amount_left, true);
}
}
}
}
}
}
void QuestManager::UpdateSpawnTimer(uint32 id, uint32 newTime)
{
bool found = false;