From 45eea666a143145c4bcdc51aeaf58cb9b67bf96b Mon Sep 17 00:00:00 2001 From: Kurt Gilpin Date: Sun, 13 Jun 2021 18:06:58 -0500 Subject: [PATCH] [Items] Allow any bag type 51 to be used for Trader (#1392) * Allow any bag type 51 to be used for Trader Most commonly this would allow the different color satchels to be used in Trader mode. PEQ database has 1 item (Yellow Trader's Satchel Token - 35037) marked as type 51, but otherwise only the proper bags are already set. Bonus of removing the hard-coded ID from source. * Updated Fixed where I missed it in a couple more spots too. * Update bonuses.cpp --- zone/bonuses.cpp | 6 +++--- zone/trading.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 19ad4a45e..e6c99f154 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -3382,10 +3382,10 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) { if (Trader) if (i >= EQ::invbag::GENERAL_BAGS_BEGIN && i <= EQ::invbag::GENERAL_BAGS_END) { EQ::ItemInstance* parent_item = m_inv.GetItem(EQ::InventoryProfile::CalcSlotId(i)); - if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel + if (parent_item && parent_item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel) continue; } - + bool update_slot = false; if(inst->IsScaling()) { @@ -3468,7 +3468,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) { if (Trader) if (i >= EQ::invbag::GENERAL_BAGS_BEGIN && i <= EQ::invbag::GENERAL_BAGS_END) { EQ::ItemInstance* parent_item = m_inv.GetItem(EQ::InventoryProfile::CalcSlotId(i)); - if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel + if (parent_item && parent_item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel) continue; } diff --git a/zone/trading.cpp b/zone/trading.cpp index 1d75bd941..92b132477 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1266,7 +1266,7 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) { uint16 SlotID = 0; for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++){ item = this->GetInv().GetItem(i); - if (item && item->GetItem()->ID == 17899){ //Traders Satchel + if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){ for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) { // we already have the parent bag and a contents iterator..why not just iterate the bag!?? SlotID = EQ::InventoryProfile::CalcSlotId(i, x); @@ -1289,7 +1289,7 @@ EQ::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ uint16 SlotID = 0; for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++){ item = this->GetInv().GetItem(i); - if(item && item->GetItem()->ID == 17899){ //Traders Satchel + if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){ for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) { // we already have the parent bag and a contents iterator..why not just iterate the bag!?? SlotID = EQ::InventoryProfile::CalcSlotId(i, x); @@ -1322,7 +1322,7 @@ GetItems_Struct* Client::GetTraderItems(){ if (ndx >= 80) break; item = this->GetInv().GetItem(i); - if(item && item->GetItem()->ID == 17899){ //Traders Satchel + if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){ for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) { if (ndx >= 80) break; @@ -1349,7 +1349,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ uint16 SlotID = 0; for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++) { item = this->GetInv().GetItem(i); - if(item && item->GetItem()->ID == 17899){ //Traders Satchel + if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){ for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++){ SlotID = EQ::InventoryProfile::CalcSlotId(i, x);