From b37333c1d935abe05c854c41bdf7ac6aff7f2882 Mon Sep 17 00:00:00 2001 From: Смердокрыл Date: Fri, 10 Feb 2023 12:29:43 +0200 Subject: Core/Auras: Implemented SPELL_AURA_KEYBOUND_OVERRIDE (#28809) Co-authored-by: MaxtorCoder Co-authored-by: Shauren --- .../database/Database/Implementation/HotfixDatabase.cpp | 13 +++++++++---- .../database/Database/Implementation/HotfixDatabase.h | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/server/database/Database') diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index f6e3f0ec08f..2df820e6fb4 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -23,13 +23,13 @@ // Force max id statements to appear exactly right after normal data fetch statement #define PREPARE_MAX_ID_STMT(stmtBase, sql, con) \ - static_assert(stmtBase + HOTFIX_MAX_ID_STMT_OFFSET == stmtBase##_MAX_ID, "Invalid prepared statement index for " #stmtBase "_MAX_ID"); \ - PrepareStatement(stmtBase##_MAX_ID, sql, con); + static_assert((stmtBase) + HOTFIX_MAX_ID_STMT_OFFSET == stmtBase##_MAX_ID, "Invalid prepared statement index for " #stmtBase "_MAX_ID"); \ + PrepareStatement(stmtBase##_MAX_ID, sql, con) // Force locale statements to be right after max id fetch statement #define PREPARE_LOCALE_STMT(stmtBase, sql, con) \ - static_assert(stmtBase + HOTFIX_LOCALE_STMT_OFFSET == stmtBase##_LOCALE, "Invalid prepared statement index for " #stmtBase "_LOCALE"); \ - PrepareStatement(stmtBase##_LOCALE, sql, con); + static_assert((stmtBase) + HOTFIX_LOCALE_STMT_OFFSET == stmtBase##_LOCALE, "Invalid prepared statement index for " #stmtBase "_LOCALE"); \ + PrepareStatement(stmtBase##_LOCALE, sql, con) void HotfixDatabaseConnection::DoPrepareStatements() { @@ -1465,6 +1465,11 @@ void HotfixDatabaseConnection::DoPrepareStatements() "Logic1, Logic2, Logic3, Logic4, Logic5 FROM spell_item_enchantment_condition WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION, "SELECT MAX(ID) + 1 FROM spell_item_enchantment_condition", CONNECTION_SYNCH); + // SpellKeyboundOverride.db2 + PrepareStatement(HOTFIX_SEL_SPELL_KEYBOUND_OVERRIDE, "SELECT ID, `Function`, Type, Data, Flags FROM spell_keybound_override" + " WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); + PREPARE_MAX_ID_STMT(HOTFIX_SEL_SPELL_KEYBOUND_OVERRIDE, "SELECT MAX(ID) + 1 FROM spell_keybound_override", CONNECTION_SYNCH); + // SpellLabel.db2 PrepareStatement(HOTFIX_SEL_SPELL_LABEL, "SELECT ID, LabelID, SpellID FROM spell_label WHERE (`VerifiedBuild` > 0) = ?", CONNECTION_SYNCH); PREPARE_MAX_ID_STMT(HOTFIX_SEL_SPELL_LABEL, "SELECT MAX(ID) + 1 FROM spell_label", CONNECTION_SYNCH); diff --git a/src/server/database/Database/Implementation/HotfixDatabase.h b/src/server/database/Database/Implementation/HotfixDatabase.h index 46da89df7b0..a926f045989 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.h +++ b/src/server/database/Database/Implementation/HotfixDatabase.h @@ -844,6 +844,9 @@ enum HotfixDatabaseStatements : uint32 HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION, HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION_MAX_ID, + HOTFIX_SEL_SPELL_KEYBOUND_OVERRIDE, + HOTFIX_SEL_SPELL_KEYBOUND_OVERRIDE_MAX_ID, + HOTFIX_SEL_SPELL_LABEL, HOTFIX_SEL_SPELL_LABEL_MAX_ID, -- cgit v1.2.3