Reintegration of inventory-based EQDictionary references

This commit is contained in:
Uleat
2018-07-05 21:05:26 -04:00
parent d2683022e1
commit c435a77813
91 changed files with 4474 additions and 4546 deletions
+17 -17
View File
@@ -310,7 +310,7 @@ bool Client::Process() {
}
if (AutoFireEnabled()) {
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::inventory::slotRange);
EQEmu::ItemInstance *ranged = GetInv().GetItem(EQEmu::invslot::slotRange);
if (ranged)
{
if (ranged->GetItem() && ranged->GetItem()->ItemType == EQEmu::item::ItemTypeBow) {
@@ -405,11 +405,11 @@ bool Client::Process() {
}
else if (auto_attack_target->GetHP() > -10) // -10 so we can watch people bleed in PvP
{
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotPrimary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotPrimary);
TriggerDefensiveProcs(auto_attack_target, EQEmu::inventory::slotPrimary, false);
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::invslot::slotPrimary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::invslot::slotPrimary);
TriggerDefensiveProcs(auto_attack_target, EQEmu::invslot::slotPrimary, false);
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotPrimary);
DoAttackRounds(auto_attack_target, EQEmu::invslot::slotPrimary);
if (CheckAATimer(aaTimerRampage))
entity_list.AEAttack(this, 30);
}
@@ -445,10 +445,10 @@ bool Client::Process() {
else if (auto_attack_target->GetHP() > -10) {
CheckIncreaseSkill(EQEmu::skills::SkillDualWield, auto_attack_target, -10);
if (CheckDualWield()) {
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::inventory::slotSecondary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::inventory::slotSecondary);
EQEmu::ItemInstance *wpn = GetInv().GetItem(EQEmu::invslot::slotSecondary);
TryWeaponProc(wpn, auto_attack_target, EQEmu::invslot::slotSecondary);
DoAttackRounds(auto_attack_target, EQEmu::inventory::slotSecondary);
DoAttackRounds(auto_attack_target, EQEmu::invslot::slotSecondary);
}
}
}
@@ -776,7 +776,7 @@ void Client::BulkSendInventoryItems()
{
// LINKDEAD TRADE ITEMS
// Move trade slot items back into normal inventory..need them there now for the proceeding validity checks
for (int16 slot_id = EQEmu::legacy::TRADE_BEGIN; slot_id <= EQEmu::legacy::TRADE_END; slot_id++) {
for (int16 slot_id = EQEmu::invslot::TRADE_BEGIN; slot_id <= EQEmu::invslot::TRADE_END; slot_id++) {
EQEmu::ItemInstance* inst = m_inv.PopItem(slot_id);
if(inst) {
bool is_arrow = (inst->GetItem()->ItemType == EQEmu::item::ItemTypeArrow) ? true : false;
@@ -802,7 +802,7 @@ void Client::BulkSendInventoryItems()
EQEmu::OutBuffer::pos_type last_pos = ob.tellp();
// Possessions items
for (int16 slot_id = EQEmu::inventory::slotBegin; slot_id < EQEmu::legacy::TYPE_POSSESSIONS_SIZE; slot_id++) {
for (int16 slot_id = EQEmu::invslot::POSSESSIONS_BEGIN; slot_id <= EQEmu::invslot::POSSESSIONS_END; slot_id++) {
const EQEmu::ItemInstance* inst = m_inv[slot_id];
if (!inst)
continue;
@@ -817,19 +817,19 @@ void Client::BulkSendInventoryItems()
// PowerSource item
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotPowerSource];
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::SLOT_POWER_SOURCE];
if (inst) {
inst->Serialize(ob, EQEmu::inventory::slotPowerSource);
inst->Serialize(ob, EQEmu::invslot::SLOT_POWER_SOURCE);
if (ob.tellp() == last_pos)
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::inventory::slotPowerSource);
Log(Logs::General, Logs::Inventory, "Serialization failed on item slot %d during BulkSendInventoryItems. Item skipped.", EQEmu::invslot::SLOT_POWER_SOURCE);
last_pos = ob.tellp();
}
}
// Bank items
for (int16 slot_id = EQEmu::legacy::BANK_BEGIN; slot_id <= EQEmu::legacy::BANK_END; slot_id++) {
for (int16 slot_id = EQEmu::invslot::BANK_BEGIN; slot_id <= EQEmu::invslot::BANK_END; slot_id++) {
const EQEmu::ItemInstance* inst = m_inv[slot_id];
if (!inst)
continue;
@@ -843,7 +843,7 @@ void Client::BulkSendInventoryItems()
}
// SharedBank items
for (int16 slot_id = EQEmu::legacy::SHARED_BANK_BEGIN; slot_id <= EQEmu::legacy::SHARED_BANK_END; slot_id++) {
for (int16 slot_id = EQEmu::invslot::SHARED_BANK_BEGIN; slot_id <= EQEmu::invslot::SHARED_BANK_END; slot_id++) {
const EQEmu::ItemInstance* inst = m_inv[slot_id];
if (!inst)
continue;
@@ -1133,7 +1133,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
switch(memspell->scribing)
{
case memSpellScribing: { // scribing spell to book
const EQEmu::ItemInstance* inst = m_inv[EQEmu::inventory::slotCursor];
const EQEmu::ItemInstance* inst = m_inv[EQEmu::invslot::slotCursor];
if (inst && inst->IsClassCommon())
{
@@ -1147,7 +1147,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app)
if(item && item->Scroll.Effect == (int32)(memspell->spell_id))
{
ScribeSpell(memspell->spell_id, memspell->slot);
DeleteItemInInventory(EQEmu::inventory::slotCursor, 1, true);
DeleteItemInInventory(EQEmu::invslot::slotCursor, 1, true);
}
else
Message(0,"Scribing spell: inst exists but item does not or spell ids do not match.");