mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 11:31:30 +00:00
[Bug Fix] Fix Bot Spell Entries IDs Capping at 32,767 (#4444)
* [Bug Fix] Fix Bot Spell Entries IDs Capping at 32,767 * Fix manifest
This commit is contained in:
parent
40738b29e3
commit
7dfda95d86
@ -150,6 +150,17 @@ ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five
|
|||||||
.sql = R"(
|
.sql = R"(
|
||||||
ALTER TABLE `bot_data`
|
ALTER TABLE `bot_data`
|
||||||
ADD COLUMN `extra_haste` mediumint(8) NOT NULL DEFAULT 0 AFTER `wis`;
|
ADD COLUMN `extra_haste` mediumint(8) NOT NULL DEFAULT 0 AFTER `wis`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9045,
|
||||||
|
.description = "2024_08_05_bot_spells_entries_unsigned_spell_id.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `bot_spells_entries` LIKE 'spell_id'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `bot_spells_entries`
|
||||||
|
CHANGE COLUMN `spellid` `spell_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0 AFTER `npc_spells_id`;
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public:
|
|||||||
struct BotSpellsEntries {
|
struct BotSpellsEntries {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
int32_t npc_spells_id;
|
int32_t npc_spells_id;
|
||||||
int16_t spellid;
|
uint16_t spell_id;
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint8_t minlevel;
|
uint8_t minlevel;
|
||||||
uint8_t maxlevel;
|
uint8_t maxlevel;
|
||||||
@ -46,7 +46,7 @@ public:
|
|||||||
return {
|
return {
|
||||||
"id",
|
"id",
|
||||||
"npc_spells_id",
|
"npc_spells_id",
|
||||||
"spellid",
|
"spell_id",
|
||||||
"type",
|
"type",
|
||||||
"minlevel",
|
"minlevel",
|
||||||
"maxlevel",
|
"maxlevel",
|
||||||
@ -67,7 +67,7 @@ public:
|
|||||||
return {
|
return {
|
||||||
"id",
|
"id",
|
||||||
"npc_spells_id",
|
"npc_spells_id",
|
||||||
"spellid",
|
"spell_id",
|
||||||
"type",
|
"type",
|
||||||
"minlevel",
|
"minlevel",
|
||||||
"maxlevel",
|
"maxlevel",
|
||||||
@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
e.id = 0;
|
e.id = 0;
|
||||||
e.npc_spells_id = 0;
|
e.npc_spells_id = 0;
|
||||||
e.spellid = 0;
|
e.spell_id = 0;
|
||||||
e.type = 0;
|
e.type = 0;
|
||||||
e.minlevel = 0;
|
e.minlevel = 0;
|
||||||
e.maxlevel = 255;
|
e.maxlevel = 255;
|
||||||
@ -173,7 +173,7 @@ public:
|
|||||||
|
|
||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||||
@ -220,7 +220,7 @@ public:
|
|||||||
auto columns = Columns();
|
auto columns = Columns();
|
||||||
|
|
||||||
v.push_back(columns[1] + " = " + std::to_string(e.npc_spells_id));
|
v.push_back(columns[1] + " = " + std::to_string(e.npc_spells_id));
|
||||||
v.push_back(columns[2] + " = " + std::to_string(e.spellid));
|
v.push_back(columns[2] + " = " + std::to_string(e.spell_id));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.type));
|
v.push_back(columns[3] + " = " + std::to_string(e.type));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.minlevel));
|
v.push_back(columns[4] + " = " + std::to_string(e.minlevel));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.maxlevel));
|
v.push_back(columns[5] + " = " + std::to_string(e.maxlevel));
|
||||||
@ -256,7 +256,7 @@ public:
|
|||||||
|
|
||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.npc_spells_id));
|
v.push_back(std::to_string(e.npc_spells_id));
|
||||||
v.push_back(std::to_string(e.spellid));
|
v.push_back(std::to_string(e.spell_id));
|
||||||
v.push_back(std::to_string(e.type));
|
v.push_back(std::to_string(e.type));
|
||||||
v.push_back(std::to_string(e.minlevel));
|
v.push_back(std::to_string(e.minlevel));
|
||||||
v.push_back(std::to_string(e.maxlevel));
|
v.push_back(std::to_string(e.maxlevel));
|
||||||
@ -300,7 +300,7 @@ public:
|
|||||||
|
|
||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.npc_spells_id));
|
v.push_back(std::to_string(e.npc_spells_id));
|
||||||
v.push_back(std::to_string(e.spellid));
|
v.push_back(std::to_string(e.spell_id));
|
||||||
v.push_back(std::to_string(e.type));
|
v.push_back(std::to_string(e.type));
|
||||||
v.push_back(std::to_string(e.minlevel));
|
v.push_back(std::to_string(e.minlevel));
|
||||||
v.push_back(std::to_string(e.maxlevel));
|
v.push_back(std::to_string(e.maxlevel));
|
||||||
@ -348,7 +348,7 @@ public:
|
|||||||
|
|
||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||||
@ -387,7 +387,7 @@ public:
|
|||||||
|
|
||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
e.npc_spells_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
e.spellid = row[2] ? static_cast<int16_t>(atoi(row[2])) : 0;
|
e.spell_id = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.type = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.minlevel = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
e.maxlevel = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 255;
|
||||||
@ -476,7 +476,7 @@ public:
|
|||||||
|
|
||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.npc_spells_id));
|
v.push_back(std::to_string(e.npc_spells_id));
|
||||||
v.push_back(std::to_string(e.spellid));
|
v.push_back(std::to_string(e.spell_id));
|
||||||
v.push_back(std::to_string(e.type));
|
v.push_back(std::to_string(e.type));
|
||||||
v.push_back(std::to_string(e.minlevel));
|
v.push_back(std::to_string(e.minlevel));
|
||||||
v.push_back(std::to_string(e.maxlevel));
|
v.push_back(std::to_string(e.maxlevel));
|
||||||
@ -513,7 +513,7 @@ public:
|
|||||||
|
|
||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.npc_spells_id));
|
v.push_back(std::to_string(e.npc_spells_id));
|
||||||
v.push_back(std::to_string(e.spellid));
|
v.push_back(std::to_string(e.spell_id));
|
||||||
v.push_back(std::to_string(e.type));
|
v.push_back(std::to_string(e.type));
|
||||||
v.push_back(std::to_string(e.minlevel));
|
v.push_back(std::to_string(e.minlevel));
|
||||||
v.push_back(std::to_string(e.maxlevel));
|
v.push_back(std::to_string(e.maxlevel));
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9282
|
#define CURRENT_BINARY_DATABASE_VERSION 9282
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9044
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9045
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -3324,18 +3324,19 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id)
|
|||||||
if (!bse.empty()) {
|
if (!bse.empty()) {
|
||||||
for (const auto& e : bse) {
|
for (const auto& e : bse) {
|
||||||
DBbotspells_entries_Struct entry;
|
DBbotspells_entries_Struct entry;
|
||||||
entry.spellid = e.spellid;
|
|
||||||
entry.type = e.type;
|
entry.spellid = e.spell_id;
|
||||||
entry.minlevel = e.minlevel;
|
entry.type = e.type;
|
||||||
entry.maxlevel = e.maxlevel;
|
entry.minlevel = e.minlevel;
|
||||||
entry.manacost = e.manacost;
|
entry.maxlevel = e.maxlevel;
|
||||||
entry.recast_delay = e.recast_delay;
|
entry.manacost = e.manacost;
|
||||||
entry.priority = e.priority;
|
entry.recast_delay = e.recast_delay;
|
||||||
entry.min_hp = e.min_hp;
|
entry.priority = e.priority;
|
||||||
entry.max_hp = e.max_hp;
|
entry.min_hp = e.min_hp;
|
||||||
entry.resist_adjust = e.resist_adjust;
|
entry.max_hp = e.max_hp;
|
||||||
entry.bucket_name = e.bucket_name;
|
entry.resist_adjust = e.resist_adjust;
|
||||||
entry.bucket_value = e.bucket_value;
|
entry.bucket_name = e.bucket_name;
|
||||||
|
entry.bucket_value = e.bucket_value;
|
||||||
entry.bucket_comparison = e.bucket_comparison;
|
entry.bucket_comparison = e.bucket_comparison;
|
||||||
|
|
||||||
// some spell types don't make much since to be priority 0, so fix that
|
// some spell types don't make much since to be priority 0, so fix that
|
||||||
@ -3345,8 +3346,8 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id)
|
|||||||
|
|
||||||
if (e.resist_adjust) {
|
if (e.resist_adjust) {
|
||||||
entry.resist_adjust = e.resist_adjust;
|
entry.resist_adjust = e.resist_adjust;
|
||||||
} else if (IsValidSpell(e.spellid)) {
|
} else if (IsValidSpell(e.spell_id)) {
|
||||||
entry.resist_adjust = spells[e.spellid].resist_difficulty;
|
entry.resist_adjust = spells[e.spell_id].resist_difficulty;
|
||||||
}
|
}
|
||||||
|
|
||||||
spell_set.entries.push_back(entry);
|
spell_set.entries.push_back(entry);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user