From 0e6a0b5a7000a0e98d8e7c9e8dfd0069cedbe7f3 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sat, 9 May 2020 22:37:35 -0400 Subject: [PATCH] Add Item SubType to data structures and DB --- common/item_data.h | 1 + common/item_fieldlist.h | 1 + common/patches/rof.cpp | 1 + common/patches/rof2.cpp | 1 + common/patches/uf.cpp | 3 ++- common/shareddb.cpp | 1 + common/spdat.h | 2 +- common/version.h | 2 +- utils/sql/db_update_manifest.txt | 1 + utils/sql/git/required/2020_05_09_items_subtype.sql | 1 + 10 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 utils/sql/git/required/2020_05_09_items_subtype.sql diff --git a/common/item_data.h b/common/item_data.h index 58bc4c889..d5570f856 100644 --- a/common/item_data.h +++ b/common/item_data.h @@ -434,6 +434,7 @@ namespace EQEmu //uint32 Unk054; int16 MaxCharges; // Maximum charges items can hold: -1 if not a chargeable item uint8 ItemType; // Item Type/Skill (itemClass* from above) + int32 SubType; // Some items have sub types that can be used for other things (unbreakable fishing poles, SE_FFItemClass) uint8 Material; // Item material type uint32 HerosForgeModel;// Hero's Forge Armor Model Type (2-13?) float SellRate; // Sell rate diff --git a/common/item_fieldlist.h b/common/item_fieldlist.h index 665783498..3c00f1e44 100644 --- a/common/item_fieldlist.h +++ b/common/item_fieldlist.h @@ -203,3 +203,4 @@ F(procname) F(wornname) F(focusname) F(scrollname) +F(subtype) diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index fd75cb3db..fed2802df 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -5504,6 +5504,7 @@ namespace RoF iqbs.HealAmt = item->HealAmt; iqbs.SpellDmg = item->SpellDmg; iqbs.Clairvoyance = item->Clairvoyance; + iqbs.SubType = item->SubType; iqbs.unknown28 = 0; iqbs.unknown30 = 0; iqbs.unknown39 = 1; diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 36257771b..209324740 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -5759,6 +5759,7 @@ namespace RoF2 iqbs.HealAmt = item->HealAmt; iqbs.SpellDmg = item->SpellDmg; iqbs.Clairvoyance = item->Clairvoyance; + iqbs.SubType = item->SubType; //unknown18; //Power Source Capacity or evolve filename? //evolve_string; // Some String, but being evolution related is just a guess diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index ef28e8e33..4b97658d2 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -4106,7 +4106,8 @@ namespace UF iqbs.HealAmt = item->HealAmt; iqbs.SpellDmg = item->SpellDmg; iqbs.Clairvoyance = item->Clairvoyance; - + iqbs.SubType = item->SubType; + ob.write((const char*)&iqbs, sizeof(UF::structs::ItemQuaternaryBodyStruct)); EQEmu::OutBuffer::pos_type count_pos = ob.tellp(); diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 48cc1309d..6c327b188 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1029,6 +1029,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ item.MaxCharges = (int16)atoi(row[ItemField::maxcharges]); item.ItemType = (uint8)atoi(row[ItemField::itemtype]); + item.SubType = atoi(row[ItemField::subtype]); item.Material = (uint8)atoi(row[ItemField::material]); item.HerosForgeModel = (uint32)atoi(row[ItemField::herosforgemodel]); item.SellRate = (float)atof(row[ItemField::sellrate]); diff --git a/common/spdat.h b/common/spdat.h index c7c6027c6..9c9cf3f53 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -634,7 +634,7 @@ typedef enum { #define SE_LimitRace 412 // implemented - Limits to spells cast by a certain race (Note: not used in any known live spells) #define SE_FcBaseEffects 413 // implemented - Increases the power of bard songs, skill attacks, runes, bard allowed foci, damage/heal #define SE_LimitCastingSkill 414 // implemented - Limit a focus to include spells cast using a specific skill. -//#define SE_FFItemClass 415 // not used +//#define SE_FFItemClass 415 // not used - base1 matches ItemType, base2 matches SubType, -1 ignored, max is bitmask of valid slots #define SE_ACv2 416 // implemented - New AC spell effect #define SE_ManaRegen_v2 417 // implemented - New mana regen effect #define SE_SkillDamageAmount2 418 // implemented - adds skill damage directly to certain attacks diff --git a/common/version.h b/common/version.h index 7c378e763..c840ebdc5 100644 --- a/common/version.h +++ b/common/version.h @@ -34,7 +34,7 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9152 +#define CURRENT_BINARY_DATABASE_VERSION 9153 #ifdef BOTS #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9027 diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index 28b22028e..c6af34a98 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -406,6 +406,7 @@ 9150|2020_02_06_aa_reset_on_death.sql|SHOW COLUMNS FROM `aa_ability` LIKE 'reset_on_death'|empty| 9151|2020_03_05_npc_always_aggro.sql|SHOW COLUMNS FROM `npc_types` LIKE 'always_aggro'|empty| 9152|2020_03_09_convert_myisam_to_innodb.sql|SELECT * FROM db_version WHERE version >= 9152|empty| +9153|2020_05_09_items_subtype.sql|SHOW COLUMNS from `items` LIKE 'UNK219'|not_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/required/2020_05_09_items_subtype.sql b/utils/sql/git/required/2020_05_09_items_subtype.sql new file mode 100644 index 000000000..43b38d14f --- /dev/null +++ b/utils/sql/git/required/2020_05_09_items_subtype.sql @@ -0,0 +1 @@ +ALTER TABLE `items` CHANGE `UNK219` `subtype` int(11) not null default '0';