From 83928fa4d09dec2407367ed40f6019380f03b446 Mon Sep 17 00:00:00 2001 From: Trust Date: Wed, 2 Dec 2020 17:21:22 -0500 Subject: [PATCH 1/2] [REBASE] Prevent Bards from auto equip loot when using instrument --- zone/inventory.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index b047197d2..71749be45 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -1154,9 +1154,34 @@ bool Client::AutoPutLootInInventory(EQ::ItemInstance& inst, bool try_worn, bool } } } + if( i == EQ::invslot::slotPrimary && m_inv[EQ::invslot::slotSecondary] ) { + uint8 instrument = m_inv[MainSecondary]->GetItem()->ItemType; + if( + instrument == EQ::item::ItemTypeWindInstrument || + instrument == EQ::item::ItemTypeStringedInstrument || + instrument == EQ::item::ItemTypeBrassInstrument || + instrument == EQ::item::ItemTypePercussionInstrument + ) { + LogInventory("Cannot equip a primary item with [{}] already in the secondary.", m_inv[MainSecondary]->GetItem()->Name); + continue; // Do not auto-equip Primary when instrument is in Secondary + } + } if (i == EQ::invslot::slotSecondary && m_inv[EQ::invslot::slotPrimary]) { // check to see if primary slot is a two hander - if (m_inv[EQ::invslot::slotPrimary]->GetItem()->IsType2HWeapon()) + uint8 instrument = inst.GetItem()->ItemType; + if( + instrument == EQ::item::ItemTypeWindInstrument || + instrument == EQ::item::ItemTypeStringedInstrument || + instrument == EQ::item::ItemTypeBrassInstrument || + instrument == EQ::item::ItemTypePercussionInstrument + ) { + LogInventory("Cannot equip a secondary instrument with [{}] already in the primary.", m_inv[MainPrimary]->GetItem()->Name); + continue; // Do not auto-equip instrument in Secondary when Primary is equipped. + } + + uint8 use = m_inv[MainPrimary]->GetItem()->ItemType; + if(use == EQ::item::ItemType2HSlash || use == EQ::item::ItemType2HBlunt || use == EQ::item::ItemType2HPiercing) { continue; + } } if (i == EQ::invslot::slotSecondary && inst.IsWeapon() && !CanThisClassDualWield()) { continue; @@ -1169,7 +1194,6 @@ bool Client::AutoPutLootInInventory(EQ::ItemInstance& inst, bool try_worn, bool if (worn_slot_material != EQ::textures::materialInvalid) { SendWearChange(worn_slot_material); } - parse->EventItem(EVENT_EQUIP_ITEM, this, &inst, nullptr, "", i); return true; } From 538092d59ecb1bc87eb1ddffda57eddc07096068 Mon Sep 17 00:00:00 2001 From: Trust Date: Thu, 31 Dec 2020 11:33:04 -0500 Subject: [PATCH 2/2] Fix for incorrect slot definition. --- zone/inventory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 71749be45..0a052824a 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -1155,14 +1155,14 @@ bool Client::AutoPutLootInInventory(EQ::ItemInstance& inst, bool try_worn, bool } } if( i == EQ::invslot::slotPrimary && m_inv[EQ::invslot::slotSecondary] ) { - uint8 instrument = m_inv[MainSecondary]->GetItem()->ItemType; + uint8 instrument = m_inv[EQ::invslot::slotSecondary]->GetItem()->ItemType; if( instrument == EQ::item::ItemTypeWindInstrument || instrument == EQ::item::ItemTypeStringedInstrument || instrument == EQ::item::ItemTypeBrassInstrument || instrument == EQ::item::ItemTypePercussionInstrument ) { - LogInventory("Cannot equip a primary item with [{}] already in the secondary.", m_inv[MainSecondary]->GetItem()->Name); + LogInventory("Cannot equip a primary item with [{}] already in the secondary.", m_inv[EQ::invslot::slotSecondary]->GetItem()->Name); continue; // Do not auto-equip Primary when instrument is in Secondary } } @@ -1174,11 +1174,11 @@ bool Client::AutoPutLootInInventory(EQ::ItemInstance& inst, bool try_worn, bool instrument == EQ::item::ItemTypeBrassInstrument || instrument == EQ::item::ItemTypePercussionInstrument ) { - LogInventory("Cannot equip a secondary instrument with [{}] already in the primary.", m_inv[MainPrimary]->GetItem()->Name); + LogInventory("Cannot equip a secondary instrument with [{}] already in the primary.", m_inv[EQ::invslot::slotPrimary]->GetItem()->Name); continue; // Do not auto-equip instrument in Secondary when Primary is equipped. } - uint8 use = m_inv[MainPrimary]->GetItem()->ItemType; + uint8 use = m_inv[EQ::invslot::slotPrimary]->GetItem()->ItemType; if(use == EQ::item::ItemType2HSlash || use == EQ::item::ItemType2HBlunt || use == EQ::item::ItemType2HPiercing) { continue; }