Rework of eq_dictionary

This commit is contained in:
Uleat
2016-04-07 17:21:55 -04:00
parent 6ea061dc55
commit e75a53b775
70 changed files with 2786 additions and 2779 deletions
+34 -34
View File
@@ -1314,7 +1314,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
}
/* Set item material tint */
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++)
for (int i = EQEmu::Constants::MATERIAL_BEGIN; i <= EQEmu::Constants::MATERIAL_END; i++)
{
if (m_pp.item_tint[i].RGB.UseTint == 1 || m_pp.item_tint[i].RGB.UseTint == 255)
{
@@ -1690,7 +1690,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (iter == m_inv.cursor_cbegin())
continue;
const ItemInst *inst = *iter;
SendItemPacket(MainCursor, inst, ItemPacketSummonItem);
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
}
}
@@ -2028,7 +2028,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
ItemInst *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(MainCursor, *inst);
PutLootInInventory(SlotCursor, *inst);
}
Save(1);
}
@@ -2551,7 +2551,7 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
ItemInst *inst = database.CreateItem(item, charges);
if (!AutoPutLootInInventory(*inst, true, true))
{
PutLootInInventory(MainCursor, *inst);
PutLootInInventory(SlotCursor, *inst);
}
Save(1);
@@ -2601,7 +2601,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
SetAlternateCurrencyValue(reclaim->currency_id, 0);
}
else {
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, MainCursor);
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, SlotCursor);
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
}
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
@@ -2812,8 +2812,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
}
uint32 ApplyPoisonSuccessResult = 0;
ApplyPoison_Struct* ApplyPoisonData = (ApplyPoison_Struct*)app->pBuffer;
const ItemInst* PrimaryWeapon = GetInv().GetItem(MainPrimary);
const ItemInst* SecondaryWeapon = GetInv().GetItem(MainSecondary);
const ItemInst* PrimaryWeapon = GetInv().GetItem(SlotPrimary);
const ItemInst* SecondaryWeapon = GetInv().GetItem(SlotSecondary);
const ItemInst* PoisonItemInstance = GetInv()[ApplyPoisonData->inventorySlot];
bool IsPoison = PoisonItemInstance && (PoisonItemInstance->GetItem()->ItemType == ItemTypePoison);
@@ -2995,7 +2995,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
case 0: // Adding an augment
case 2: // Swapping augment
new_aug = user_inv.GetItem(MainCursor);
new_aug = user_inv.GetItem(SlotCursor);
if (!new_aug) // Shouldn't get the OP code without the augment on the user's cursor, but maybe it's h4x.
{
@@ -3053,7 +3053,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemOneToPush)
{
DeleteItemInInventory(item_slot, 0, true);
DeleteItemInInventory(MainCursor, new_aug->IsStackable() ? 1 : 0, true);
DeleteItemInInventory(SlotCursor, new_aug->IsStackable() ? 1 : 0, true);
if (solvent)
{
@@ -3064,7 +3064,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
if (itemTwoToPush)
{
// This is a swap. Return the old aug to the player's cursor.
if (!PutItemInInventory(MainCursor, *itemTwoToPush, true))
if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning old augment to player's cursor after augmentation swap.");
Message(15, "Error: Failed to retrieve old augment after augmentation swap!");
@@ -3077,7 +3077,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != _MaterialInvalid)
if (mat != MaterialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
@@ -3142,13 +3142,13 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != _MaterialInvalid)
if (mat != MaterialInvalid)
{
SendWearChange(mat); // Visible item augged while equipped. Send WC in case ornamentation changed.
}
// Drop the removed augment on the player's cursor
if (!PutItemInInventory(MainCursor, *itemTwoToPush, true))
if (!PutItemInInventory(SlotCursor, *itemTwoToPush, true))
{
Log.Out(Logs::General, Logs::Error, "Problem returning augment to player's cursor after safe removal.");
Message(15, "Error: Failed to return augment after removal from item!");
@@ -3197,7 +3197,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
CalcBonuses();
if (mat != _MaterialInvalid)
if (mat != MaterialInvalid)
{
SendWearChange(mat);
}
@@ -4073,7 +4073,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
}
else
{
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", MainCursor, castspell->inventoryslot);
Message(0, "Error: castspell->inventoryslot >= %i (0x%04x)", SlotCursor, castspell->inventoryslot);
InterruptSpell(castspell->spell_id);
}
}
@@ -4992,7 +4992,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app)
void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
{
DropItem(MainCursor);
DropItem(SlotCursor);
return;
}
@@ -6906,7 +6906,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
return;
}
ItemInst *CursorItemInst = GetInv().GetItem(MainCursor);
ItemInst *CursorItemInst = GetInv().GetItem(SlotCursor);
bool Allowed = true;
@@ -6954,7 +6954,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
GuildBankDepositAck(false, sentAction);
DeleteItemInInventory(MainCursor, 0, false);
DeleteItemInInventory(SlotCursor, 0, false);
}
break;
@@ -6975,7 +6975,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
case GuildBankWithdraw:
{
if (GetInv()[MainCursor])
if (GetInv()[SlotCursor])
{
Message_StringID(13, GUILD_BANK_EMPTY_HANDS);
@@ -7021,7 +7021,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
{
PushItemOnCursor(*inst);
SendItemPacket(MainCursor, inst, ItemPacketSummonItem);
SendItemPacket(SlotCursor, inst, ItemPacketSummonItem);
GuildBanks->DeleteItem(GuildID(), gbwis->Area, gbwis->SlotID, gbwis->Quantity);
}
@@ -7995,7 +7995,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
const Item_Struct* item = nullptr;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
for (int16 L = EmuConstants::EQUIPMENT_BEGIN; L <= MainWaist; L++) {
for (int16 L = EQEmu::Constants::EQUIPMENT_BEGIN; L <= SlotWaist; L++) {
const ItemInst* inst = GetInv().GetItem(L);
item = inst ? inst->GetItem() : nullptr;
@@ -8015,15 +8015,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
else { insr->itemicons[L] = 0xFFFFFFFF; }
}
const ItemInst* inst = GetInv().GetItem(MainAmmo);
const ItemInst* inst = GetInv().GetItem(SlotAmmo);
item = inst ? inst->GetItem() : nullptr;
if (item) {
// another one..I did these, didn't I!!?
strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name);
insr->itemicons[SoF::slots::MainAmmo] = item->Icon;
strcpy(insr->itemnames[SoF::inventory::SlotAmmo], item->Name);
insr->itemicons[SoF::inventory::SlotAmmo] = item->Icon;
}
else { insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF; }
else { insr->itemicons[SoF::inventory::SlotAmmo] = 0xFFFFFFFF; }
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
InspectMessage_Struct& playermessage = this->GetInspectMessage();
@@ -8475,7 +8475,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
ItemInst* clickaug = 0;
Item_Struct* augitem = 0;
for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) {
for (r = 0; r < EQEmu::Constants::ITEM_COMMON_SIZE; r++) {
const ItemInst* aug_i = inst->GetAugment(r);
if (!aug_i)
continue;
@@ -9676,7 +9676,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer;
if (spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id))
{
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EmuConstants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
if (mi->from_slot != mi->to_slot && (mi->from_slot <= EQEmu::Constants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
{
char *detect = nullptr;
const ItemInst *itm_from = GetInv().GetItem(mi->from_slot);
@@ -9697,8 +9697,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
// Illegal bagslot usage checks. Currently, user only receives a message if this check is triggered.
bool mi_hack = false;
if (mi->from_slot >= EmuConstants::GENERAL_BAGS_BEGIN && mi->from_slot <= EmuConstants::CURSOR_BAG_END) {
if (mi->from_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; }
if (mi->from_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->from_slot <= EQEmu::Constants::CURSOR_BAG_END) {
if (mi->from_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else {
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
if (!m_inv[from_parent]) { mi_hack = true; }
@@ -9707,8 +9707,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
}
}
if (mi->to_slot >= EmuConstants::GENERAL_BAGS_BEGIN && mi->to_slot <= EmuConstants::CURSOR_BAG_END) {
if (mi->to_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; }
if (mi->to_slot >= EQEmu::Constants::GENERAL_BAGS_BEGIN && mi->to_slot <= EQEmu::Constants::CURSOR_BAG_END) {
if (mi->to_slot >= EQEmu::Constants::CURSOR_BAG_BEGIN) { mi_hack = true; }
else {
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
if (!m_inv[to_parent]) { mi_hack = true; }
@@ -12024,7 +12024,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
shield_target = entity_list.GetMob(shield->target_id);
bool ack = false;
ItemInst* inst = GetInv().GetItem(MainSecondary);
ItemInst* inst = GetInv().GetItem(SlotSecondary);
if (!shield_target)
return;
if (inst)
@@ -12241,8 +12241,8 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app)
// shouldn't we be reimbursing if these two fail?
//make sure we are not completely full...
if (freeslotid == MainCursor) {
if (m_inv.GetItem(MainCursor) != nullptr) {
if (freeslotid == SlotCursor) {
if (m_inv.GetItem(SlotCursor) != nullptr) {
Message(13, "You do not have room for any more items.");
safe_delete(outapp);
safe_delete(inst);