diff --git a/common/version.h b/common/version.h index 9bdfa1984..56b4f3b0c 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 9160 +#define CURRENT_BINARY_DATABASE_VERSION 9161 #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 d02536a2b..df613531c 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -414,6 +414,7 @@ 9158|2020_12_09_underworld.sql|SHOW COLUMNS from `zone` LIKE 'underworld_teleport_index'|empty| 9159|2020_12_22_expedition_system.sql|SELECT * FROM db_version WHERE version >= 9159|empty| 9160|2021_02_14_npc_exp_mod.sql|SHOW COLUMNS from `npc_types` LIKE 'exp_mod'|empty| +9161|2021_02_15_npc_spell_entries_unsigned.sql|SELECT * FROM db_version WHERE version >= 9161|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/2021_02_15_npc_spell_entries_unsigned.sql b/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql new file mode 100644 index 000000000..1022c8708 --- /dev/null +++ b/utils/sql/git/required/2021_02_15_npc_spell_entries_unsigned.sql @@ -0,0 +1 @@ +ALTER TABLE `npc_spell_entries` MODIFY `spellid` UNSIGNED SMALLINT(5) NOT NULL DEFAULT 0; \ No newline at end of file diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 6f2fbba61..306c6dd64 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2489,7 +2489,7 @@ create table npc_spells_entries ( ); */ -bool IsSpellInList(DBnpcspells_Struct* spell_list, int16 iSpellID); +bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID); bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base, int32 limit, int32 max); bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) { @@ -2761,14 +2761,14 @@ bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSp return false; } -bool IsSpellInList(DBnpcspells_Struct* spell_list, int16 iSpellID) { +bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID) { auto it = std::find_if(spell_list->entries.begin(), spell_list->entries.end(), [iSpellID](const DBnpcspells_entries_Struct &a) { return a.spellid == iSpellID; }); return it != spell_list->entries.end(); } // adds a spell to the list, taking into account priority and resorting list as needed. -void NPC::AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint32 iType, +void NPC::AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp) { @@ -2795,7 +2795,7 @@ void NPC::AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint32 iType, AIautocastspell_timer->Start(RandomTimer(0, 300), false); } -void NPC::RemoveSpellFromNPCList(int16 spell_id) +void NPC::RemoveSpellFromNPCList(uint16 spell_id) { auto iter = AIspells.begin(); while(iter != AIspells.end()) diff --git a/zone/npc.h b/zone/npc.h index 92e6b6775..de64e6b59 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -437,9 +437,9 @@ public: void NPCSlotTexture(uint8 slot, uint16 texture); // Sets new material values for slots uint32 GetAdventureTemplate() const { return adventure_template_id; } - void AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp); + void AddSpellToNPCList(int16 iPriority, uint16 iSpellID, uint32 iType, int16 iManaCost, int32 iRecastDelay, int16 iResistAdjust, int8 min_hp, int8 max_hp); void AddSpellEffectToNPCList(uint16 iSpellEffectID, int32 base, int32 limit, int32 max); - void RemoveSpellFromNPCList(int16 spell_id); + void RemoveSpellFromNPCList(uint16 spell_id); Timer *GetRefaceTimer() const { return reface_timer; } const uint32 GetAltCurrencyType() const { return NPCTypedata->alt_currency_type; } diff --git a/zone/zonedb.h b/zone/zonedb.h index 569819100..c32a92f77 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -52,7 +52,7 @@ struct wplist { #pragma pack(1) struct DBnpcspells_entries_Struct { - int16 spellid; + uint16 spellid; uint8 minlevel; uint8 maxlevel; uint32 type;