From d17a49f6dceefaeed3e8c63b6f5d0bf6c0495c9e Mon Sep 17 00:00:00 2001 From: ApoC Date: Sat, 4 Jul 2009 11:39:48 +0200 Subject: [PATCH] [8112] Fixed proc conditions for 63156 and ranks * Fixed proc spell flags. * Fixed proc only on victim's certain level of HP. signed-off-by: ApoC --- sql/mangos.sql | 6 ++++-- sql/updates/8112_01_mangos_spell_proc_event.sql | 6 ++++++ sql/updates/Makefile.am | 2 ++ src/game/Unit.cpp | 15 +++++++++++++++ src/shared/revision_nr.h | 2 +- 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 sql/updates/8112_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 6ea0523d6..83a6b36a1 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8098_02_mangos_playercreateinfo_action` bit(1) default NULL + `required_8112_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17609,7 +17609,9 @@ INSERT INTO `spell_proc_event` VALUES (61356, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (61846, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (61847, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), -(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); +(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); /*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/8112_01_mangos_spell_proc_event.sql b/sql/updates/8112_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..b882e66ee --- /dev/null +++ b/sql/updates/8112_01_mangos_spell_proc_event.sql @@ -0,0 +1,6 @@ +ALTER TABLE db_version CHANGE COLUMN required_8098_02_mangos_playercreateinfo_action required_8112_01_mangos_spell_proc_event bit; + +DELETE FROM spell_proc_event WHERE entry IN (63156, 63158); +INSERT INTO spell_proc_event VALUES +(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 5969c8cb1..d97914182 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -240,6 +240,7 @@ pkgdata_DATA = \ 8098_03_characters_character_pet.sql \ 8098_04_characters_pet_spell.sql \ 8104_01_characters.sql \ + 8112_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -460,4 +461,5 @@ EXTRA_DIST = \ 8098_03_characters_character_pet.sql \ 8098_04_characters_pet_spell.sql \ 8104_01_characters.sql \ + 8112_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 339f57130..f1b9909c8 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6704,6 +6704,21 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; break; } + // Decimation + case 63156: + case 63158: + { + // Looking for dummy effect + Aura *aur = GetAura(auraSpellInfo->Id, 1); + if (!aur) + return false; + + // If target's health is not below equal certain value (35%) not proc + if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount) + return false; + + break; + } } // Custom basepoints/target for exist spell diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index aca749e7e..c7244a3dc 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 "8111" + #define REVISION_NR "8112" #endif // __REVISION_NR_H__