diff --git a/sql/mangos.sql b/sql/mangos.sql index 8e27d9d60..43de214e5 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_11489_01_mangos_creature_template` bit(1) default NULL + `required_11501_02_mangos_spell_bonus_data` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -14657,6 +14657,7 @@ INSERT INTO `spell_bonus_data` VALUES (30294, 0, 0, 0, 0, 'Warlock - Soul Leech'), (31117, 1.8, 0, 0, 0, 'Warlock - Unstable Affliction Dispell'), /* Item */ +(64569, 0, 0, 0, 0, 'Item - Blood Reserve'), (56131, 0, 0, 0, 0, 'Item - Glyph of Dispel Magic'), (56160, 0, 0, 0, 0, 'Item - Glyph of Power Word: Shield'), (46567, 0, 0, 0, 0, 'Item - Goblin Rocket Launcher'), @@ -17551,6 +17552,7 @@ INSERT INTO `spell_proc_event` VALUES (63625, 0x00, 6, 0x02000000, 0x02000000, 0x02000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), (63730, 0x00, 6, 0x00000800, 0x00000800, 0x00000800, 0x00000004, 0x00000004, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (64440, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000020, 0.000000, 0.000000, 0), +(64571, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10), (64860, 0x00, 9, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (64952, 0x00, 7, 0x00000000, 0x00000000, 0x00000000, 0x00000440, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (64964, 0x00, 15, 0x00000000, 0x00000000, 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), diff --git a/sql/updates/11501_01_mangos_spell_proc_event.sql b/sql/updates/11501_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..37e088c55 --- /dev/null +++ b/sql/updates/11501_01_mangos_spell_proc_event.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_11489_01_mangos_creature_template required_11501_01_mangos_spell_proc_event bit; + +DELETE FROM spell_proc_event WHERE entry = 64571; +INSERT INTO spell_proc_event VALUES +(64571, 0x7F, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 10); diff --git a/sql/updates/11501_02_mangos_spell_bonus_data.sql b/sql/updates/11501_02_mangos_spell_bonus_data.sql new file mode 100644 index 000000000..0f8ea5163 --- /dev/null +++ b/sql/updates/11501_02_mangos_spell_bonus_data.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_11501_01_mangos_spell_proc_event required_11501_02_mangos_spell_bonus_data bit; + +DELETE FROM spell_bonus_data WHERE entry IN (64569); +INSERT INTO spell_bonus_data VALUES +(64569, 0, 0, 0, 0, 'Item - Blood Reserve'); diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index dc1fcb1d9..8f8402d6e 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -2910,6 +2910,21 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d break; } + case 64568: // Blood Reserve + { + // When your health drops below 35% .... + uint32 health35 = uint32(GetMaxHealth() * 0.35); + if (GetHealth() - damage > health35 || GetHealth() < health35) + return SPELL_AURA_PROC_FAILED; + + trigger_spell_id = 64569; + + // need scale damage base at stack size + if (SpellEntry const* trigEntry = sSpellStore.LookupEntry(trigger_spell_id)) + basepoints[EFFECT_INDEX_0] = trigEntry->CalculateSimpleValue(EFFECT_INDEX_0) * triggeredByAura->GetStackAmount(); + + break; + } case 67702: // Death's Choice, Item - Coliseum 25 Normal Melee Trinket { float stat = 0.0f; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 59a98a564..bb75227ed 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 "11500" + #define REVISION_NR "11501" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index d8694ced9..bdbb1f6cd 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_11436_01_characters_character_queststatus" - #define REVISION_DB_MANGOS "required_11489_01_mangos_creature_template" + #define REVISION_DB_MANGOS "required_11501_02_mangos_spell_bonus_data" #define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version" #endif // __REVISION_SQL_H__