From 200027bf89ea3ef75a3abea1e03e77b7d80fa369 Mon Sep 17 00:00:00 2001 From: Trevius Date: Mon, 15 Dec 2014 17:55:23 -0600 Subject: [PATCH] (RoF+) Implemented the 6th Augment Slot for Items. Player Corpses now saved attuned settings for Items. Renamed IsInstNoDrop() and SetInstNoDrop() to IsAttuned() and SetAttuned() respectively. --- changelog.txt | 6 + common/database.cpp | 33 ++++-- common/database.h | 2 + common/eq_dictionary.h | 4 +- common/eq_packet_structs.h | 8 +- common/item.cpp | 8 +- common/item.h | 8 +- common/item_fieldlist.h | 2 + common/item_struct.h | 6 +- common/patches/client62.cpp | 2 +- common/patches/rof.cpp | 12 +- common/patches/rof2.cpp | 13 +-- common/patches/rof2_itemfields.h | 3 + common/patches/rof_itemfields.h | 3 + common/patches/sod.cpp | 4 +- common/patches/sof.cpp | 4 +- common/patches/titanium.cpp | 2 +- common/patches/underfoot.cpp | 4 +- common/shareddb.cpp | 103 ++++++++++-------- common/shareddb.h | 4 +- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + .../optional/2014_12_15_heromodelCommand.sql | 2 + .../2014_12_15_multiple_table_updates.sql | 16 +++ zone/bot.cpp | 4 +- zone/client.h | 2 +- zone/client_packet.cpp | 8 +- zone/command.cpp | 40 ++++--- zone/corpse.cpp | 12 +- zone/corpse.h | 2 +- zone/embparser.cpp | 2 +- zone/inventory.cpp | 68 ++++++------ zone/loottables.cpp | 2 + zone/lua_client.cpp | 4 +- zone/lua_iteminst.cpp | 4 +- zone/perl_client.cpp | 2 +- zone/perl_questitem.cpp | 2 +- zone/tradeskills.cpp | 4 +- zone/trading.cpp | 4 +- zone/zonedb.cpp | 38 ++++--- zone/zonedump.h | 2 + 41 files changed, 263 insertions(+), 189 deletions(-) create mode 100644 utils/sql/git/optional/2014_12_15_heromodelCommand.sql create mode 100644 utils/sql/git/required/2014_12_15_multiple_table_updates.sql diff --git a/changelog.txt b/changelog.txt index ae004543f..1a0be1590 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 12/15/2014 == +Trevius: (RoF+) Implemented the 6th Augment Slot for Items. +Trevius: Player Corpses now saved attuned settings for Items. + +Required SQL: utils/sql/git/required/2014_12_15_multiple_table_updates.sql + == 12/13/2014 == demonstar55: Fix guild rank spam on zone (needed to be in OP_PP). Trevius: (RoF+) Implemented Armor Ornamentation using Hero's Forge Armor Models. To use, create an ornamentation augment and set the herosforgemodel field in the items table. diff --git a/common/database.cpp b/common/database.cpp index 4cafc56d1..80ff355d7 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2099,6 +2099,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ "`aug_3` int(11) unsigned DEFAULT '0', " "`aug_4` int(11) unsigned DEFAULT '0', " "`aug_5` int(11) unsigned DEFAULT '0', " + "`aug_6` int(11) unsigned DEFAULT '0', " "`attuned` smallint(5) NOT NULL DEFAULT '0', " "PRIMARY KEY(`corpse_id`, `equip_slot`) " ") ENGINE = InnoDB DEFAULT CHARSET = latin1; " @@ -2276,8 +2277,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ for (unsigned int i = 0; i < dbpc->itemcount; i++) { if (first_entry != 1){ scquery = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc->items[i].equipSlot, dbpc->items[i].item_id, @@ -2286,12 +2287,14 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc->items[i].aug2, dbpc->items[i].aug3, dbpc->items[i].aug4, - dbpc->items[i].aug5 + dbpc->items[i].aug5, + dbpc->items[i].aug6, + dbpc->items[i].attuned ); first_entry = 1; } else{ - scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc->items[i].equipSlot, dbpc->items[i].item_id, @@ -2300,7 +2303,9 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc->items[i].aug2, dbpc->items[i].aug3, dbpc->items[i].aug4, - dbpc->items[i].aug5 + dbpc->items[i].aug5, + dbpc->items[i].aug6, + dbpc->items[i].attuned ); } } @@ -2310,7 +2315,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ /* Classic Converter */ scquery = StringFormat("UPDATE `character_corpses` SET \n" "`is_locked` = %d,\n" - "`exp` = %u,\n" + "`exp` = %u,\n" "`size` = %f,\n" "`level` = %u,\n" "`race` = %u,\n" @@ -2338,7 +2343,7 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ "`wc_6` = %u,\n" "`wc_7` = %u,\n" "`wc_8` = %u,\n" - "`wc_9` = %u \n" + "`wc_9` = %u \n" "WHERE `id` = %u \n", dbpc_c->locked, dbpc_c->exp, @@ -2381,8 +2386,8 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ for (unsigned int i = 0; i < dbpc_c->itemcount; i++) { if (first_entry != 1){ scquery = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc_c->items[i].equipSlot, dbpc_c->items[i].item_id, @@ -2391,12 +2396,14 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc_c->items[i].aug2, dbpc_c->items[i].aug3, dbpc_c->items[i].aug4, - dbpc_c->items[i].aug5 + dbpc_c->items[i].aug5, + dbpc_c->items[i].aug6, + dbpc_c->items[i].attuned ); first_entry = 1; } else{ - scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + scquery = scquery + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", atoi(row2[0]), dbpc_c->items[i].equipSlot, dbpc_c->items[i].item_id, @@ -2405,7 +2412,9 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ dbpc_c->items[i].aug2, dbpc_c->items[i].aug3, dbpc_c->items[i].aug4, - dbpc_c->items[i].aug5 + dbpc_c->items[i].aug5, + dbpc_c->items[i].aug6, + dbpc_c->items[i].attuned ); } } diff --git a/common/database.h b/common/database.h index 6325b4e3d..8f5d7430c 100644 --- a/common/database.h +++ b/common/database.h @@ -426,6 +426,8 @@ namespace Convert { uint32 aug3; uint32 aug4; uint32 aug5; + uint32 aug6; + uint8 attuned; }; } diff --git a/common/eq_dictionary.h b/common/eq_dictionary.h index 8ef38c77c..a17ade924 100644 --- a/common/eq_dictionary.h +++ b/common/eq_dictionary.h @@ -138,8 +138,8 @@ public: // items // common and container sizes will not increase until the new 'location' struct is implemented - static const uint16 ITEM_COMMON_SIZE = Underfoot::consts::ITEM_COMMON_SIZE; - static const uint16 ITEM_CONTAINER_SIZE = Underfoot::consts::ITEM_CONTAINER_SIZE; + static const uint16 ITEM_COMMON_SIZE = RoF::consts::ITEM_COMMON_SIZE; + static const uint16 ITEM_CONTAINER_SIZE = Titanium::consts::ITEM_CONTAINER_SIZE; // player profile //static const uint32 CLASS_BITMASK = 0; // needs value diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 930b76843..ed62bb183 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -2919,7 +2919,7 @@ uint8 npccastfilters; // 0) No, 1) Ignore NPC Casts (all), 2) Ignore NPC Casts */ struct ItemViewRequest_Struct { /*000*/ uint32 item_id; -/*004*/ uint32 augments[5]; +/*004*/ uint32 augments[6]; /*024*/ uint32 link_hash; /*028*/ uint32 unknown028; /*032*/ char unknown032[12]; //probably includes loregroup & evolving info. see Client::MakeItemLink() in zone/inventory.cpp:469 @@ -5242,8 +5242,10 @@ struct ServerLootItem_Struct { uint32 aug_3; // uint32 aug_3; uint32 aug_4; // uint32 aug_4; uint32 aug_5; // uint32 aug_5; - uint8 min_level; // - uint8 max_level; // + uint32 aug_6; // uint32 aug_5; + uint8 attuned; + uint8 min_level; + uint8 max_level; }; //Found in client near a ref to the string: diff --git a/common/item.cpp b/common/item.cpp index 8af7f8b06..df4997470 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1400,7 +1400,7 @@ ItemInst::ItemInst(const Item_Struct* item, int16 charges) { m_item = item; m_charges = charges; m_price = 0; - m_instnodrop = false; + m_attuned = false; m_merchantslot = 0; if(m_item &&m_item->ItemClass == ItemClassCommon) m_color = m_item->Color; @@ -1426,7 +1426,7 @@ ItemInst::ItemInst(SharedDatabase *db, uint32 item_id, int16 charges) { m_charges = charges; m_price = 0; m_merchantslot = 0; - m_instnodrop=false; + m_attuned=false; if(m_item && m_item->ItemClass == ItemClassCommon) m_color = m_item->Color; else @@ -1450,7 +1450,7 @@ ItemInst::ItemInst(ItemInstTypes use_type) { m_item = nullptr; m_charges = 0; m_price = 0; - m_instnodrop = false; + m_attuned = false; m_merchantslot = 0; m_color = 0; @@ -1475,7 +1475,7 @@ ItemInst::ItemInst(const ItemInst& copy) m_color=copy.m_color; m_merchantslot=copy.m_merchantslot; m_currentslot=copy.m_currentslot; - m_instnodrop=copy.m_instnodrop; + m_attuned=copy.m_attuned; m_merchantcount=copy.m_merchantcount; // Copy container contents iter_contents it; diff --git a/common/item.h b/common/item.h index 4827f042b..995f121d6 100644 --- a/common/item.h +++ b/common/item.h @@ -294,7 +294,7 @@ public: // // Augements // - inline bool IsAugmentable() const { return m_item->AugSlotType[0]!=0 || m_item->AugSlotType[1]!=0 || m_item->AugSlotType[2]!=0 || m_item->AugSlotType[3]!=0 || m_item->AugSlotType[4]!=0; } + inline bool IsAugmentable() const { return m_item->AugSlotType[0] != 0 || m_item->AugSlotType[1] != 0 || m_item->AugSlotType[2] != 0 || m_item->AugSlotType[3] != 0 || m_item->AugSlotType[4] != 0 || m_item->AugSlotType[5] != 0; } bool AvailableWearSlot(uint32 aug_wear_slots) const; int8 AvailableAugmentSlot(int32 augtype) const; bool IsAugmentSlotAvailable(int32 augtype, uint8 slot) const; @@ -362,8 +362,8 @@ public: void SetCurrentSlot(int16 curr_slot) { m_currentslot = curr_slot; } // Is this item already attuned? - bool IsInstNoDrop() const { return m_instnodrop; } - void SetInstNoDrop(bool flag) { m_instnodrop=flag; } + bool IsAttuned() const { return m_attuned; } + void SetAttuned(bool flag) { m_attuned=flag; } std::string GetCustomDataString() const; std::string GetCustomData(std::string identifier); @@ -435,7 +435,7 @@ protected: uint32 m_color; uint32 m_merchantslot; int16 m_currentslot; - bool m_instnodrop; + bool m_attuned; int32 m_merchantcount; //number avaliable on the merchant, -1=unlimited int32 m_SerialNumber; // Unique identifier for this instance of an item. Needed for Bazaar. uint32 m_exp; diff --git a/common/item_fieldlist.h b/common/item_fieldlist.h index 42ec12554..1b3fe0cb0 100644 --- a/common/item_fieldlist.h +++ b/common/item_fieldlist.h @@ -101,6 +101,8 @@ F(augslot4type) F(augslot4visible) F(augslot5type) F(augslot5visible) +F(augslot6type) +F(augslot6visible) F(ldontheme) F(ldonprice) F(ldonsold) diff --git a/common/item_struct.h b/common/item_struct.h index 66af3d0c6..3ef26db94 100644 --- a/common/item_struct.h +++ b/common/item_struct.h @@ -183,9 +183,9 @@ struct Item_Struct { int32 FactionAmt4; // Faction Amt 4 char CharmFile[32]; // ? uint32 AugType; - uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Type - uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Visible - uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // LDoN: Augment Slot 1-5 Unknown + uint8 AugSlotType[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Type + uint8 AugSlotVisible[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Visible + uint8 AugSlotUnk2[EmuConstants::ITEM_COMMON_SIZE]; // RoF: Augment Slot 1-6 Unknown uint32 LDoNTheme; uint32 LDoNPrice; uint32 LDoNSold; diff --git a/common/patches/client62.cpp b/common/patches/client62.cpp index f3681721e..102414b16 100644 --- a/common/patches/client62.cpp +++ b/common/patches/client62.cpp @@ -1249,7 +1249,7 @@ namespace Client62 //merchant_slot, //instance ID, bullshit for now // The 'Merchant Slot' needs to be some unique id for bazaar to work properly (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot, - inst->IsInstNoDrop() ? 1 : 0, //not sure where this field is + inst->IsAttuned() ? 1 : 0, //not sure where this field is (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? charges : 0) : charges), 0 ); diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 202d4f090..1659dbd1c 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -4406,7 +4406,7 @@ namespace RoF IN(item_id); int r; - for (r = 0; r < 5; r++) { + for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } // Max Augs is now 6, but no code to support that many yet @@ -4855,7 +4855,7 @@ namespace RoF hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -5074,7 +5074,7 @@ namespace RoF isbs.augdistiller = 65535; isbs.augrestrict = item->AugRestrict; - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; @@ -5082,9 +5082,9 @@ namespace RoF } // Increased to 6 max aug slots - isbs.augslots[5].type = 0; - isbs.augslots[5].visible = 1; - isbs.augslots[5].unknown = 0; + //isbs.augslots[5].type = 0; + //isbs.augslots[5].visible = 1; + //isbs.augslots[5].unknown = 0; isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 531aa8c4d..fbbceda2c 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -4410,10 +4410,9 @@ namespace RoF2 IN(item_id); int r; - for (r = 0; r < 5; r++) { + for (r = 0; r < EmuConstants::ITEM_COMMON_SIZE; r++) { IN(augments[r]); } - // Max Augs is now 6, but no code to support that many yet IN(link_hash); IN(icon); @@ -4859,7 +4858,7 @@ namespace RoF2 hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; hdr.unknown052 = 7300 + Inventory::CalcMaterialFromSlot(slot_id_in); //0; @@ -5079,7 +5078,7 @@ namespace RoF2 isbs.augdistiller = 65535; isbs.augrestrict = item->AugRestrict; - for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x) + for (int x = AUG_BEGIN; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; @@ -5087,9 +5086,9 @@ namespace RoF2 } // Increased to 6 max aug slots - isbs.augslots[5].type = 0; - isbs.augslots[5].visible = 1; - isbs.augslots[5].unknown = 0; + //isbs.augslots[5].type = 0; + //isbs.augslots[5].visible = 1; + //isbs.augslots[5].unknown = 0; isbs.ldonpoint_type = item->PointType; isbs.ldontheme = item->LDoNTheme; diff --git a/common/patches/rof2_itemfields.h b/common/patches/rof2_itemfields.h index ccba333b5..b7b2223d3 100644 --- a/common/patches/rof2_itemfields.h +++ b/common/patches/rof2_itemfields.h @@ -332,6 +332,9 @@ These fields must be in the order of how they are serialized! /* 091 */ I(AugSlotType[4]) /* 092 */ I(AugSlotVisible[4]) /* 092 */ I(AugSlotUnk2[4]) +/* 091 */ I(AugSlotType[5]) +/* 092 */ I(AugSlotVisible[5]) +/* 092 */ I(AugSlotUnk2[5]) /* 093 */ I(PointType) /* 093 */ I(LDoNTheme) /* 094 */ I(LDoNPrice) diff --git a/common/patches/rof_itemfields.h b/common/patches/rof_itemfields.h index ccba333b5..b7b2223d3 100644 --- a/common/patches/rof_itemfields.h +++ b/common/patches/rof_itemfields.h @@ -332,6 +332,9 @@ These fields must be in the order of how they are serialized! /* 091 */ I(AugSlotType[4]) /* 092 */ I(AugSlotVisible[4]) /* 092 */ I(AugSlotUnk2[4]) +/* 091 */ I(AugSlotType[5]) +/* 092 */ I(AugSlotVisible[5]) +/* 092 */ I(AugSlotUnk2[5]) /* 093 */ I(PointType) /* 093 */ I(LDoNTheme) /* 094 */ I(LDoNPrice) diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index baca905a2..50d787472 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -3223,7 +3223,7 @@ namespace SoD hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -3370,7 +3370,7 @@ namespace SoD isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 8430a51bb..f7d35d403 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -2547,7 +2547,7 @@ namespace SoF hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -2693,7 +2693,7 @@ namespace SoF isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 0fc9d5e75..26ab0f531 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1678,7 +1678,7 @@ namespace Titanium (merchant_slot == 0) ? inst->GetSerialNumber() : merchant_slot, 0, // item recast timer timestamp field (aka..last_cast_time field in SoF+ clients) (stackable ? ((inst->GetItem()->ItemType == ItemTypePotion) ? 1 : 0) : charges), - inst->IsInstNoDrop() ? 1 : 0, + inst->IsAttuned() ? 1 : 0, 0 ); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 16095faa9..3ddfeafd0 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -3637,7 +3637,7 @@ namespace Underfoot hdr.unknown028 = 0; hdr.last_cast_time = ((item->RecastDelay > 1) ? 1212693140 : 0); hdr.charges = (stackable ? (item->MaxCharges ? 1 : 0) : charges); - hdr.inst_nodrop = inst->IsInstNoDrop() ? 1 : 0; + hdr.inst_nodrop = inst->IsAttuned() ? 1 : 0; hdr.unknown044 = 0; hdr.unknown048 = 0; hdr.unknown052 = 0; @@ -3817,7 +3817,7 @@ namespace Underfoot isbs.augtype = item->AugType; isbs.augrestrict = item->AugRestrict; - for (int x = 0; x < 5; ++x) + for (int x = 0; x < consts::ITEM_COMMON_SIZE; x++) { isbs.augslots[x].type = item->AugSlotType[x]; isbs.augslots[x].visible = item->AugSlotVisible[x]; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 8f99ac03d..4ba16b441 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -183,7 +183,7 @@ bool SharedDatabase::SaveInventory(uint32 char_id, const ItemInst* inst, int16 s bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { ItemInst *auginst=inst->GetItem(i); @@ -199,14 +199,14 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i // Update/Insert item std::string query = StringFormat("REPLACE INTO inventory " "(charid, slotid, itemid, charges, instnodrop, custom_data, color, " - "augslot1, augslot2, augslot3, augslot4, augslot5, ornamenticon, ornamentidfile, ornament_hero_model) " + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, ornamenticon, ornamentidfile, ornament_hero_model) " "VALUES( %lu, %lu, %lu, %lu, %lu, '%s', %lu, " - "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", + "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)char_id, (unsigned long)slot_id, (unsigned long)inst->GetItem()->ID, - (unsigned long)charges, (unsigned long)(inst->IsInstNoDrop()? 1: 0), + (unsigned long)charges, (unsigned long)(inst->IsAttuned()? 1: 0), inst->GetCustomDataString().c_str(), (unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1], (unsigned long)augslot[2], - (unsigned long)augslot[3],(unsigned long)augslot[4], (unsigned long)inst->GetOrnamentationIcon(), + (unsigned long)augslot[3], (unsigned long)augslot[4], (unsigned long)augslot[5], (unsigned long)inst->GetOrnamentationIcon(), (unsigned long)inst->GetOrnamentationIDFile(), (unsigned long)inst->GetOrnamentHeroModel()); auto results = QueryDatabase(query); @@ -227,7 +227,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, int16 slot_id) { - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { ItemInst *auginst=inst->GetItem(i); @@ -244,12 +244,13 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, std::string query = StringFormat("REPLACE INTO sharedbank " "(acctid, slotid, itemid, charges, custom_data, " - "augslot1, augslot2, augslot3, augslot4, augslot5) " + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6) " "VALUES( %lu, %lu, %lu, %lu, '%s', " - "%lu, %lu, %lu, %lu, %lu)", + "%lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)account_id, (unsigned long)slot_id, (unsigned long)inst->GetItem()->ID, (unsigned long)charges, inst->GetCustomDataString().c_str(), (unsigned long)augslot[0], - (unsigned long)augslot[1],(unsigned long)augslot[2],(unsigned long)augslot[3],(unsigned long)augslot[4]); + (unsigned long)augslot[1], (unsigned long)augslot[2], (unsigned long)augslot[3], (unsigned long)augslot[4], + (unsigned long)augslot[5]); auto results = QueryDatabase(query); // Save bag contents, if slot supports bag contents @@ -395,13 +396,13 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (is_charid) query = StringFormat("SELECT sb.slotid, sb.itemid, sb.charges, " "sb.augslot1, sb.augslot2, sb.augslot3, " - "sb.augslot4, sb.augslot5, sb.custom_data " + "sb.augslot4, sb.augslot5, sb.augslot6, sb.custom_data " "FROM sharedbank sb INNER JOIN character_data ch " "ON ch.account_id=sb.acctid WHERE ch.id = %i", id); else query = StringFormat("SELECT slotid, itemid, charges, " "augslot1, augslot2, augslot3, " - "augslot4, augslot5, custom_data " + "augslot4, augslot5, augslot6, custom_data " "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { @@ -415,11 +416,12 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { int8 charges = (int8)atoi(row[2]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[3]); - aug[1] = (uint32)atoi(row[4]); - aug[2] = (uint32)atoi(row[5]); - aug[3] = (uint32)atoi(row[6]); - aug[4] = (uint32)atoi(row[7]); + aug[0] = (uint32)atoi(row[3]); + aug[1] = (uint32)atoi(row[4]); + aug[2] = (uint32)atoi(row[5]); + aug[3] = (uint32)atoi(row[6]); + aug[4] = (uint32)atoi(row[7]); + aug[5] = (uint32)atoi(row[8]); const Item_Struct* item = GetItem(item_id); @@ -441,10 +443,10 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { } } - if(!row[8]) + if(!row[9]) continue; - std::string data_str(row[8]); + std::string data_str(row[9]); std::string idAsString; std::string value; bool use_id = true; @@ -489,7 +491,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " + "augslot2, augslot3, augslot4, augslot5, augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { @@ -506,17 +508,18 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoul(row[4]); - aug[1] = (uint32)atoul(row[5]); - aug[2] = (uint32)atoul(row[6]); - aug[3] = (uint32)atoul(row[7]); - aug[4] = (uint32)atoul(row[8]); + aug[0] = (uint32)atoul(row[4]); + aug[1] = (uint32)atoul(row[5]); + aug[2] = (uint32)atoul(row[6]); + aug[3] = (uint32)atoul(row[7]); + aug[4] = (uint32)atoul(row[8]); + aug[5] = (uint32)atoul(row[9]); - bool instnodrop = (row[9] && (uint16)atoi(row[9]))? true: false; + bool instnodrop = (row[10] && (uint16)atoi(row[10]))? true: false; - uint32 ornament_icon = (uint32)atoul(row[11]); - uint32 ornament_idfile = (uint32)atoul(row[12]); - uint32 ornament_hero_model = (uint32)atoul(row[13]); + uint32 ornament_icon = (uint32)atoul(row[12]); + uint32 ornament_idfile = (uint32)atoul(row[13]); + uint32 ornament_hero_model = (uint32)atoul(row[14]); const Item_Struct* item = GetItem(item_id); @@ -529,8 +532,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { ItemInst* inst = CreateBaseItem(item, charges); - if(row[10]) { - std::string data_str(row[10]); + if(row[11]) { + std::string data_str(row[11]); std::string idAsString; std::string value; bool use_id = true; @@ -560,7 +563,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { inst->SetOrnamentHeroModel(ornament_hero_model); if (instnodrop || (((slot_id >= EmuConstants::EQUIPMENT_BEGIN && slot_id <= EmuConstants::EQUIPMENT_END) || slot_id == MainPowerSource) && inst->GetItem()->Attuneable)) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); if (color > 0) inst->SetColor(color); @@ -600,7 +603,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) { // Retrieve character inventory std::string query = StringFormat("SELECT slotid, itemid, charges, color, augslot1, " - "augslot2, augslot3, augslot4, augslot5, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " + "augslot2, augslot3, augslot4, augslot5, augslot6, instnodrop, custom_data, ornamenticon, ornamentidfile, ornament_hero_model " "FROM inventory INNER JOIN character_data ch " "ON ch.id = charid WHERE ch.name = '%s' AND ch.account_id = %i ORDER BY slotid", name, account_id); @@ -619,16 +622,17 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) uint32 color = atoul(row[3]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[4]); - aug[1] = (uint32)atoi(row[5]); - aug[2] = (uint32)atoi(row[6]); - aug[3] = (uint32)atoi(row[7]); - aug[4] = (uint32)atoi(row[8]); + aug[0] = (uint32)atoi(row[4]); + aug[1] = (uint32)atoi(row[5]); + aug[2] = (uint32)atoi(row[6]); + aug[3] = (uint32)atoi(row[7]); + aug[4] = (uint32)atoi(row[8]); + aug[5] = (uint32)atoi(row[9]); - bool instnodrop = (row[9] && (uint16)atoi(row[9])) ? true : false; - uint32 ornament_icon = (uint32)atoul(row[11]); - uint32 ornament_idfile = (uint32)atoul(row[12]); - uint32 ornament_hero_model = (uint32)atoul(row[13]); + bool instnodrop = (row[10] && (uint16)atoi(row[10])) ? true : false; + uint32 ornament_icon = (uint32)atoul(row[12]); + uint32 ornament_idfile = (uint32)atoul(row[13]); + uint32 ornament_hero_model = (uint32)atoul(row[14]); const Item_Struct* item = GetItem(item_id); int16 put_slot_id = INVALID_INDEX; @@ -636,10 +640,10 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) continue; ItemInst* inst = CreateBaseItem(item, charges); - inst->SetInstNoDrop(instnodrop); + inst->SetAttuned(instnodrop); - if(row[10]) { - std::string data_str(row[10]); + if(row[11]) { + std::string data_str(row[11]); std::string idAsString; std::string value; bool use_id = true; @@ -895,6 +899,9 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.AugSlotType[4] = (uint8)atoi(row[ItemField::augslot5type]); item.AugSlotVisible[4] = (uint8)atoi(row[ItemField::augslot5visible]); item.AugSlotUnk2[4] = 0; + item.AugSlotType[5] = (uint8)atoi(row[ItemField::augslot6type]); + item.AugSlotVisible[5] = (uint8)atoi(row[ItemField::augslot6visible]); + item.AugSlotUnk2[5] = 0; item.LDoNTheme = (uint32)atoul(row[ItemField::ldontheme]); item.LDoNPrice = (uint32)atoul(row[ItemField::ldonprice]); @@ -1187,7 +1194,7 @@ bool SharedDatabase::LoadNPCFactionLists() { } // Create appropriate ItemInst class -ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) +ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { const Item_Struct* item = nullptr; ItemInst* inst = nullptr; @@ -1199,6 +1206,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst->PutAugment(this, 2, aug3); inst->PutAugment(this, 3, aug4); inst->PutAugment(this, 4, aug5); + inst->PutAugment(this, 5, aug6); + inst->SetAttuned(attuned); } return inst; @@ -1206,7 +1215,7 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, // Create appropriate ItemInst class -ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) +ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { ItemInst* inst = nullptr; if (item) { @@ -1216,6 +1225,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst->PutAugment(this, 2, aug3); inst->PutAugment(this, 3, aug4); inst->PutAugment(this, 4, aug5); + inst->PutAugment(this, 5, aug6); + inst->SetAttuned(attuned); } return inst; diff --git a/common/shareddb.h b/common/shareddb.h index 0b0dcf839..5f0707054 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -71,8 +71,8 @@ public: /* * Item Methods */ - ItemInst* CreateItem(uint32 item_id, int16 charges=0, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0); - ItemInst* CreateItem(const Item_Struct* item, int16 charges=0, uint32 aug1=0, uint32 aug2=0, uint32 aug3=0, uint32 aug4=0, uint32 aug5=0); + ItemInst* CreateItem(uint32 item_id, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); + ItemInst* CreateItem(const Item_Struct* item, int16 charges = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); ItemInst* CreateBaseItem(const Item_Struct* item, int16 charges=0); /* diff --git a/common/version.h b/common/version.h index e223fe606..461c26e23 100644 --- a/common/version.h +++ b/common/version.h @@ -30,7 +30,7 @@ Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9061 +#define CURRENT_BINARY_DATABASE_VERSION 9062 #define COMPILE_DATE __DATE__ #define COMPILE_TIME __TIME__ #ifndef WIN32 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 61806f625..19246c290 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -315,6 +315,7 @@ 9059|2014_12_01_mercs_table_update.sql|SHOW COLUMNS FROM `mercs` LIKE 'MercSize'|empty| 9060|2014_12_09_items_table_update.sql|SHOW COLUMNS FROM `items` LIKE 'herosforgemodel'|empty| 9061|2014_12_11_inventory_table_update.sql|SHOW COLUMNS FROM `inventory` LIKE 'ornament_hero_model'|empty| +9062|2014_12_15_multiple_table_updates.sql|SHOW COLUMNS FROM `inventory` LIKE 'augslot6type'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/optional/2014_12_15_heromodelCommand.sql b/utils/sql/git/optional/2014_12_15_heromodelCommand.sql new file mode 100644 index 000000000..4ded6664d --- /dev/null +++ b/utils/sql/git/optional/2014_12_15_heromodelCommand.sql @@ -0,0 +1,2 @@ +INSERT INTO `commands` (`command`, `access`) VALUES ('heromodel', 80); +INSERT INTO `commands` (`command`, `access`) VALUES ('hm', 80); \ No newline at end of file diff --git a/utils/sql/git/required/2014_12_15_multiple_table_updates.sql b/utils/sql/git/required/2014_12_15_multiple_table_updates.sql new file mode 100644 index 000000000..de652e570 --- /dev/null +++ b/utils/sql/git/required/2014_12_15_multiple_table_updates.sql @@ -0,0 +1,16 @@ +/* Add the new Aug Slot 6 Fields to the items table */ +ALTER TABLE `items` ADD `augslot6type` tinyint( 3 ) NOT NULL DEFAULT '0' AFTER `augslot5visible`; +ALTER TABLE `items` ADD `augslot6visible` tinyint( 3 ) NOT NULL DEFAULT '0' AFTER `augslot6type`; +ALTER TABLE `items` ADD `augslot6unk2` int( 11 ) NOT NULL DEFAULT '0' AFTER `augslot5unk2`; + +/* Add the new Aug Slot 6 Field to the inventory table */ +ALTER TABLE `inventory` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the sharedbank table */ +ALTER TABLE `sharedbank` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the object_contents table */ +ALTER TABLE `object_contents` ADD `augslot6` mediumint( 7 ) NOT NULL DEFAULT '0' AFTER `augslot5`; + +/* Add the new Aug Slot 6 Field to the sharedbank table */ +ALTER TABLE `character_corpse_items` ADD `aug_6` int( 11 ) NOT NULL DEFAULT '0' AFTER `aug_5`; \ No newline at end of file diff --git a/zone/bot.cpp b/zone/bot.cpp index 266c8565e..33d36d284 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -4173,7 +4173,7 @@ void Bot::SetBotItemInSlot(uint32 slotID, uint32 itemID, const ItemInst* inst, s "augslot1, augslot2, augslot3, augslot4, augslot5) " "VALUES(%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)", (unsigned long)this->GetBotID(), (unsigned long)slotID, (unsigned long)itemID, - (unsigned long)inst->GetCharges(), (unsigned long)(inst->IsInstNoDrop()? 1: 0), + (unsigned long)inst->GetCharges(), (unsigned long)(inst->IsAttuned()? 1: 0), (unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1], (unsigned long)augslot[2], (unsigned long)augslot[3], (unsigned long)augslot[4]); auto results = database.QueryDatabase(query); @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { int16 put_slot_id = INVALID_INDEX; if (instnodrop || ((slot_id >= EmuConstants::EQUIPMENT_BEGIN) && (slot_id <= EmuConstants::EQUIPMENT_END) && inst->GetItem()->Attuneable)) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); if (color > 0) inst->SetColor(color); diff --git a/zone/client.h b/zone/client.h index 737d354cc..be503fccc 100644 --- a/zone/client.h +++ b/zone/client.h @@ -810,7 +810,7 @@ public: void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false); void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0); bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0); - bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); + bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); void DropItem(int16 slot_id); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index db209317b..f0528501a 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -2742,7 +2742,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, false, MainCursor); + SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, MainCursor); AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count)); } /* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */ @@ -6968,7 +6968,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) const Item_Struct* CursorItem = CursorItemInst->GetItem(); - if (!CursorItem->NoDrop || CursorItemInst->IsInstNoDrop()) + if (!CursorItem->NoDrop || CursorItemInst->IsAttuned()) { Message_StringID(13, GUILD_BANK_CANNOT_DEPOSIT); @@ -8213,7 +8213,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) } - ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4]); + ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4], ivrs->augments[5]); if (inst) { SendItemPacket(0, inst, ItemPacketViewLink); safe_delete(inst); @@ -8369,7 +8369,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app) } outapp->WriteUInt32(0xFFFFFFFF); //Unknown but always seen as FF FF FF FF outapp->WriteUInt32(0); //Unknown - for (spacer = 0; spacer < 5; spacer++) { //Augment stuff + for (spacer = 0; spacer < 6; spacer++) { //Augment stuff outapp->WriteUInt32(item->AugSlotType[spacer]); outapp->WriteUInt8(item->AugSlotVisible[spacer]); outapp->WriteUInt8(item->AugSlotUnk2[spacer]); diff --git a/zone/command.cpp b/zone/command.cpp index 3876d90de..d5d781e02 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -5556,18 +5556,20 @@ void command_summonitem(Client *c, const Seperator *sep) if (item_status > c->Admin()) c->Message(13, "Error: Insufficient status to summon this item."); - else if (sep->argnum==2 && sep->IsNumber(2)) { - c->SummonItem(itemid, atoi(sep->arg[2]) ); - } else if (sep->argnum==3) { - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) ); - } else if (sep->argnum==4) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) ); + else if (sep->argnum==2 && sep->IsNumber(2)) + c->SummonItem(itemid, atoi(sep->arg[2])); + else if (sep->argnum==3) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3])); + else if (sep->argnum==4) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); else if (sep->argnum==5) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5])); else if (sep->argnum==6) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6])); else if (sep->argnum==7) - c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) ); + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7])); + else if (sep->argnum==8) + c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8])); else { c->SummonItem(itemid); } @@ -5593,18 +5595,20 @@ void command_giveitem(Client *c, const Seperator *sep) if (item_status > c->Admin()) c->Message(13, "Error: Insufficient status to summon this item."); - else if (sep->argnum==2 && sep->IsNumber(2)) { - t->SummonItem(itemid, atoi(sep->arg[2]) ); - } else if (sep->argnum==3) { - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) ); - } else if (sep->argnum==4) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) ); + else if (sep->argnum==2 && sep->IsNumber(2)) + t->SummonItem(itemid, atoi(sep->arg[2])); + else if (sep->argnum==3) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3])); + else if (sep->argnum==4) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4])); else if (sep->argnum==5) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5])); else if (sep->argnum==6) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6])); else if (sep->argnum==7) - t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) ); + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7])); + else if (sep->argnum == 7) + t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8])); else { t->SummonItem(itemid); } diff --git a/zone/corpse.cpp b/zone/corpse.cpp index b6504c88f..1e3bdcafb 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -452,7 +452,7 @@ std::list Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16 ItemInst *interior_item; std::list returnlist; - AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4)); + AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4), item->GetAugmentItemID(5), item->IsAttuned()); returnlist.push_back(equipslot); // Qualified bag slot iterations. processing bag slots that don't exist is probably not a good idea. @@ -463,7 +463,7 @@ std::list Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16 interior_item = client->GetInv().GetItem(interior_slot); if (interior_item) { - AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4)); + AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4), interior_item->GetAugmentItemID(5), item->IsAttuned()); returnlist.push_back(Inventory::CalcSlotId(equipslot, bagindex)); client->DeleteItemInInventory(interior_slot, 0, true, false); } @@ -688,7 +688,7 @@ uint32 Corpse::CountItems() { return itemlist.size(); } -void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { +void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) { if (!database.GetItem(itemnum)) return; @@ -705,6 +705,8 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui item->aug_3=aug3; item->aug_4=aug4; item->aug_5=aug5; + item->aug_6=aug6; + item->attuned=attuned; itemlist.push_back(item); } @@ -1048,7 +1050,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a if(i < corpselootlimit) { item = database.GetItem(item_data->item_id); if(client && item) { - ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5); + ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned); if(inst) { // MainGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = MainGeneral1 + MainCursor client->SendItemPacket(i + EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot); @@ -1163,7 +1165,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { if (item != 0) { if (item_data){ - inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5); + inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned); } else { inst = database.CreateItem(item); diff --git a/zone/corpse.h b/zone/corpse.h index 7488a572e..9c898976c 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -86,7 +86,7 @@ class Corpse : public Mob { int32 GetPlayerKillItem() { return player_kill_item; } void RemoveItem(uint16 lootslot); void RemoveItem(ServerLootItem_Struct* item_data); - void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0); + void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0); /* Corpse: Coin */ void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum); diff --git a/zone/embparser.cpp b/zone/embparser.cpp index c7a67c388..3a27fc42f 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1146,7 +1146,7 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID temp_var_name = var_name; temp_var_name += "_attuned"; - ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsInstNoDrop()); + ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsAttuned()); } else { ExportVar(package_name.c_str(), var_name.c_str(), 0); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 08a7ceb29..343f6e337 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -189,7 +189,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) { return (m_inv.HasItemByLoreGroup(item->LoreGroup, ~invWhereSharedBank) != INVALID_INDEX); } -bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) { +bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) { this->EVENT_ITEM_ScriptStopReturn(); // TODO: update calling methods and script apis to handle a failure return @@ -199,8 +199,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -212,10 +212,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, return false; } // check to make sure we are augmenting an augmentable item - else if(((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5)) { + else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -228,14 +228,14 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", - GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; } */ - uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5 }; + uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 }; uint32 classes = item->Classes; uint32 races = item->Races; @@ -251,8 +251,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -268,8 +268,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", - GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus); + GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; } @@ -291,16 +291,16 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -476,8 +476,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -487,8 +487,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -496,8 +496,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -505,8 +505,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -532,8 +532,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5); + LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; } @@ -546,7 +546,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // attune item if(attuned && inst->GetItem()->Attuneable) - inst->SetInstNoDrop(true); + inst->SetAttuned(true); inst->SetOrnamentIcon(ornament_icon); inst->SetOrnamentationIDFile(ornament_idfile); @@ -558,8 +558,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n", - GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5); + mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; } @@ -858,7 +858,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI { if(bag_item_data[i] == nullptr) continue; - const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5); + const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); mlog(INVENTORY__SLOTS, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); @@ -1622,13 +1622,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Not dealing with charges - just do direct swap if(src_inst && (dst_slot_id <= EmuConstants::EQUIPMENT_END || dst_slot_id == MainPowerSource) && dst_slot_id >= EmuConstants::EQUIPMENT_BEGIN) { if (src_inst->GetItem()->Attuneable) { - src_inst->SetInstNoDrop(true); + src_inst->SetAttuned(true); } if (src_inst->IsAugmented()) { for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { if (src_inst->GetAugment(i)) { if (src_inst->GetAugment(i)->GetItem()->Attuneable) { - src_inst->GetAugment(i)->SetInstNoDrop(true); + src_inst->GetAugment(i)->SetAttuned(true); } } } diff --git a/zone/loottables.cpp b/zone/loottables.cpp index c5fda890e..ec2960579 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -201,6 +201,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge item->aug_3 = 0; item->aug_4 = 0; item->aug_5 = 0; + item->aug_6 = 0; + item->attuned = 0; item->min_level = minlevel; item->max_level = maxlevel; if (equipit) { diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 22e38b21d..0f560d1bd 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -703,13 +703,13 @@ void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned) { Lua_Safe_Call_Void(); - self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned); + self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned); } void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, int to_slot) { Lua_Safe_Call_Void(); - self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned, to_slot); + self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned, to_slot); } void Lua_Client::SetStats(int type, int value) { diff --git a/zone/lua_iteminst.cpp b/zone/lua_iteminst.cpp index c774c332e..4ebc6908f 100644 --- a/zone/lua_iteminst.cpp +++ b/zone/lua_iteminst.cpp @@ -166,12 +166,12 @@ uint32 Lua_ItemInst::GetColor() { bool Lua_ItemInst::IsInstNoDrop() { Lua_Safe_Call_Bool(); - return self->IsInstNoDrop(); + return self->IsAttuned(); } void Lua_ItemInst::SetInstNoDrop(bool flag) { Lua_Safe_Call_Void(); - return self->SetInstNoDrop(flag); + return self->SetAttuned(flag); } std::string Lua_ItemInst::GetCustomDataString() { diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 2a0c055af..e2dae6f35 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -3134,7 +3134,7 @@ XS(XS_Client_SummonItem) slot_id = (uint16)SvUV(ST(9)); } - THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attune, slot_id); + THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attune, slot_id); } XSRETURN_EMPTY; } diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 7738b12fb..4c93d8839 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -160,7 +160,7 @@ XS(XS_QuestItem_IsAttuned) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->IsInstNoDrop(); + RETVAL = THIS->IsAttuned(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 58774f4b1..522de616a 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -287,7 +287,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); - user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2)); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); if (RuleB(Inventory, DeleteTransformationMold)) user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -307,7 +307,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob const Item_Struct* new_weapon = inst->GetItem(); user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true); container->Clear(); - user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, 0, 0); + user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0); user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name); } else if (inst) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 738e763ed..240aa23b1 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -878,14 +878,14 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const Item_Struct* item = inst->GetItem(); if(item && quest_npc == false) { // if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it - if(GetGM() || (item->NoDrop != 0 && inst->IsInstNoDrop() == false)) { + if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) { // pets need to look inside bags and try to equip items found there if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) { for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) { const ItemInst* baginst = inst->GetItem(bslot); if (baginst) { const Item_Struct* bagitem = baginst->GetItem(); - if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsInstNoDrop() == false))) { + if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) { tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist, baginst->GetCharges(), 1, 127, true, true); } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 17b5ff508..b56bd9a1b 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -427,7 +427,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) return; } - std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5 " + std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5, augslot6 " "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { @@ -440,11 +440,12 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) uint32 item_id = (uint32)atoi(row[1]); int8 charges = (int8)atoi(row[2]); uint32 aug[EmuConstants::ITEM_COMMON_SIZE]; - aug[0] = (uint32)atoi(row[3]); - aug[1] = (uint32)atoi(row[4]); - aug[2] = (uint32)atoi(row[5]); - aug[3] = (uint32)atoi(row[6]); - aug[4] = (uint32)atoi(row[7]); + aug[0] = (uint32)atoi(row[3]); + aug[1] = (uint32)atoi(row[4]); + aug[2] = (uint32)atoi(row[5]); + aug[3] = (uint32)atoi(row[6]); + aug[4] = (uint32)atoi(row[7]); + aug[5] = (uint32)atoi(row[8]); ItemInst* inst = database.CreateItem(item_id, charges); if (inst && inst->GetItem()->ItemClass == ItemClassCommon) { @@ -478,7 +479,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It continue; uint32 item_id = inst->GetItem()->ID; - uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; + uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM }; if (inst->IsType(ItemClassCommon)) { for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) { @@ -489,10 +490,10 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It std::string query = StringFormat("REPLACE INTO object_contents " "(zoneid, parentid, bagidx, itemid, charges, " - "augslot1, augslot2, augslot3, augslot4, augslot5, droptime) " - "VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())", + "augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, droptime) " + "VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())", zone_id, parent_id, index, item_id, inst->GetCharges(), - augslot[0], augslot[1], augslot[2], augslot[3], augslot[4]); + augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) LogFile->write(EQEMuLog::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); @@ -3568,8 +3569,8 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui for (unsigned int i = 0; i < dbpc->itemcount; i++) { if (first_entry != 1){ query = StringFormat("REPLACE INTO `character_corpse_items` \n" - " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n" - " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + " (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n" + " VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", last_insert_id, dbpc->items[i].equip_slot, dbpc->items[i].item_id, @@ -3578,12 +3579,14 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui dbpc->items[i].aug_2, dbpc->items[i].aug_3, dbpc->items[i].aug_4, - dbpc->items[i].aug_5 + dbpc->items[i].aug_5, + dbpc->items[i].aug_6, + dbpc->items[i].attuned ); first_entry = 1; } else{ - query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n", + query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n", last_insert_id, dbpc->items[i].equip_slot, dbpc->items[i].item_id, @@ -3592,7 +3595,9 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui dbpc->items[i].aug_2, dbpc->items[i].aug_3, dbpc->items[i].aug_4, - dbpc->items[i].aug_5 + dbpc->items[i].aug_5, + dbpc->items[i].aug_6, + dbpc->items[i].attuned ); } } @@ -3743,6 +3748,7 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct "aug_3, \n" "aug_4, \n" "aug_5, \n" + "aug_6, \n" "attuned \n" "FROM \n" "character_corpse_items \n" @@ -3765,6 +3771,8 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct pcs->items[i].aug_3 = atoi(row[r++]); // aug_3, pcs->items[i].aug_4 = atoi(row[r++]); // aug_4, pcs->items[i].aug_5 = atoi(row[r++]); // aug_5, + pcs->items[i].aug_6 = atoi(row[r++]); // aug_6, + pcs->items[i].attuned = atoi(row[r++]); // attuned, r = 0; i++; } diff --git a/zone/zonedump.h b/zone/zonedump.h index 6d7e67b04..deebf9b19 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -139,6 +139,8 @@ namespace player_lootitem { uint32 aug_3; uint32 aug_4; uint32 aug_5; + uint32 aug_6; + int8 attuned; uint8 min_level; // uint8 max_level; // };