mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
(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.
This commit is contained in:
+21
-12
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,6 +426,8 @@ namespace Convert {
|
||||
uint32 aug3;
|
||||
uint32 aug4;
|
||||
uint32 aug5;
|
||||
uint32 aug6;
|
||||
uint8 attuned;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
+4
-4
@@ -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;
|
||||
|
||||
@@ -101,6 +101,8 @@ F(augslot4type)
|
||||
F(augslot4visible)
|
||||
F(augslot5type)
|
||||
F(augslot5visible)
|
||||
F(augslot6type)
|
||||
F(augslot6visible)
|
||||
F(ldontheme)
|
||||
F(ldonprice)
|
||||
F(ldonsold)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
+57
-46
@@ -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;
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user