From 6400d98a837ff37f5eb3db3e72399173dc3060ae Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 1 Jun 2010 04:45:05 +0400 Subject: [PATCH] [10015] More redundant data check in `spell_proc_event` --- sql/mangos.sql | 8 ++--- sql/updates/10015_01_mangos_spell_proc_event.sql | 7 +++++ sql/updates/Makefile.am | 2 ++ src/game/SpellMgr.cpp | 40 ++++++++++++++++++------ src/shared/revision_nr.h | 2 +- src/shared/revision_sql.h | 2 +- 6 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 sql/updates/10015_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 5e7733223..1ddbf87e2 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_10012_01_mangos_spell_proc_event` bit(1) default NULL + `required_10015_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17935,7 +17935,6 @@ LOCK TABLES `spell_proc_event` WRITE; INSERT INTO `spell_proc_event` VALUES ( 324, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3), ( 974, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3), -( 1463, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0.000000, 0.000000, 0), ( 3232, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), ( 5952, 0x00000000, 8, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), ( 6346, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000100, 0.000000, 0.000000, 0), @@ -18001,7 +18000,6 @@ INSERT INTO `spell_proc_event` VALUES (13046, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (13047, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (13048, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(13163, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (13165, 0x00000000, 9, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (13754, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (13867, 0x00000000, 8, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), @@ -18229,7 +18227,6 @@ INSERT INTO `spell_proc_event` VALUES (31878, 0x00000000, 10, 0x00800000, 0x00000000, 0x00000008, 0x00004110, 0x00000000, 0.000000, 0.000000, 0), (31904, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0), (32385, 0x00000000, 5, 0x00000001, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(32409, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (32587, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0), (32642, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0.000000, 0.000000, 0), (32734, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 3), @@ -18301,7 +18298,6 @@ INSERT INTO `spell_proc_event` VALUES (35100, 0x00000000, 9, 0x00001000, 0x00000000, 0x00000001, 0x00000100, 0x00000000, 0.000000, 0.000000, 0), (35121, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (36096, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0), -(36111, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (36541, 0x00000004, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (37165, 0x00000000, 8, 0x00200400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (37168, 0x00000000, 8, 0x003E0000, 0x00000009, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), @@ -18731,7 +18727,7 @@ INSERT INTO `spell_proc_event` VALUES (67672, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 50), (67702, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), (67771, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 45), -(70664, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 2.000000, 0), +(70664, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0), (70748, 0x00000000, 3, 0x00000000, 0x00200000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0); /*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; diff --git a/sql/updates/10015_01_mangos_spell_proc_event.sql b/sql/updates/10015_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..7d4fb7967 --- /dev/null +++ b/sql/updates/10015_01_mangos_spell_proc_event.sql @@ -0,0 +1,7 @@ +ALTER TABLE db_version CHANGE COLUMN required_10012_01_mangos_spell_proc_event required_10015_01_mangos_spell_proc_event bit; + +DELETE FROM `spell_proc_event` WHERE `entry` IN (1463, 13163, 32409, 36111, 70664); + +INSERT INTO `spell_proc_event` VALUES +(70664, 0x00000000, 7, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000, 0.000000, 0); + diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 15554b96a..6828d4515 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -80,6 +80,7 @@ pkgdata_DATA = \ 10008_01_realmd_realmd_db_version.sql \ 10011_01_mangos_spell_proc_event.sql \ 10012_01_mangos_spell_proc_event.sql \ + 10015_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -140,4 +141,5 @@ EXTRA_DIST = \ 10008_01_realmd_realmd_db_version.sql \ 10011_01_mangos_spell_proc_event.sql \ 10012_01_mangos_spell_proc_event.sql \ + 10015_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8635fa1e6..3d7133f7f 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1070,6 +1070,8 @@ void SpellMgr::LoadSpellProcEvents() mSpellProcEventMap[entry] = spe; + bool isCustom = false; + // also add to high ranks DoSpellProcEvent worker(spe); doForHighRanks(entry,worker); @@ -1077,22 +1079,42 @@ void SpellMgr::LoadSpellProcEvents() if (spe.procFlags == 0) { if (spell->procFlags==0) - { - sLog.outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell", entry); - continue; - } - customProc++; + sLog.outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell (no proc flags)", entry); } else { if (spell->procFlags==spe.procFlags) - { sLog.outErrorDb("Spell %u listed in `spell_proc_event` have exactly same proc flags as in spell.dbc, field value redundent", entry); - continue; - } + else + isCustom = true; } - ++count; + if (spe.customChance == 0) + { + /* enable for re-check cases, 0 chance ok for some cases because in some cases it set by another spell/talent spellmod) + if (spell->procChance==0 && !spe.ppmRate) + sLog.outErrorDb("Spell %u listed in `spell_proc_event` probally not triggered spell (no chance or ppm)", entry); + */ + } + else + { + if (spell->procChance==spe.customChance) + sLog.outErrorDb("Spell %u listed in `spell_proc_event` have exactly same custom chance as in spell.dbc, field value redundent", entry); + else + isCustom = true; + } + + // totally redundant record + if (!spe.schoolMask && !spe.spellFamilyMask && !spe.spellFamilyMask2 && !spe.procFlags && + !spe.procEx && !spe.ppmRate && !spe.customChance && !spe.cooldown) + { + sLog.outErrorDb("Spell %u listed in `spell_proc_event` not have any useful data", entry); + } + + if (isCustom) + ++customProc; + else + ++count; } while( result->NextRow() ); delete result; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4d5d0b7d1..3eb7cf511 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10014" + #define REVISION_NR "10015" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 1dfe683fe..6c809c056 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_10007_01_characters_pet_aura" - #define REVISION_DB_MANGOS "required_10012_01_mangos_spell_proc_event" + #define REVISION_DB_MANGOS "required_10015_01_mangos_spell_proc_event" #define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version" #endif // __REVISION_SQL_H__ -- 2.11.4.GIT