From 8b96182b1cb8d79c63fc0a30377cea9a480b418c Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 15 Mar 2009 02:06:59 +0100 Subject: [PATCH] *Fix Shattered Barrier --HG-- branch : trunk --- sql/updates/1857_world.sql | 7 ------- sql/updates/1910_world.sql | 11 +++++++++++ sql/updates/CMakeLists.txt | 2 +- src/game/SpellAuras.cpp | 13 ++++++++++--- src/game/SpellMgr.h | 5 ++--- src/game/Unit.cpp | 13 ++++++++++++- 6 files changed, 36 insertions(+), 15 deletions(-) delete mode 100644 sql/updates/1857_world.sql create mode 100644 sql/updates/1910_world.sql diff --git a/sql/updates/1857_world.sql b/sql/updates/1857_world.sql deleted file mode 100644 index e17b077459..0000000000 --- a/sql/updates/1857_world.sql +++ /dev/null @@ -1,7 +0,0 @@ -DELETE FROM `spell_proc_event` WHERE `entry` IN (47571, 47572, 53754, 53759); --- Psychic Horror -INSERT INTO `spell_proc_event` VALUES (47571, 0x00, 6, 65536, 0x00000000, 0x00000000, 0x00000000, 0x0002000, 0.000000, 0.000000, 0); -INSERT INTO `spell_proc_event` VALUES (47572, 0x00, 6, 59981, 0x00000000, 0x00000000, 0x00000000, 0x0002000, 0.000000, 0.000000, 0); --- Improved Fear -INSERT INTO `spell_proc_event` VALUES (53754, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0002000, 0.000000, 0.000000, 0); -INSERT INTO `spell_proc_event` VALUES (53759, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0002000, 0.000000, 0.000000, 0); \ No newline at end of file diff --git a/sql/updates/1910_world.sql b/sql/updates/1910_world.sql new file mode 100644 index 0000000000..940c152bdd --- /dev/null +++ b/sql/updates/1910_world.sql @@ -0,0 +1,11 @@ +-- Shattered Barrier +-- Psychic Horror +-- Improved Fear +DELETE FROM `spell_proc_event` WHERE `entry` IN (44745, 54787, 47571, 47572, 53754, 53759); +INSERT INTO `spell_proc_event` VALUES +(44745, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00008000, 0x0006000, 0.000000, 0.000000, 0), +(54787, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00008000, 0x0006000, 0.000000, 0.000000, 0), +(47571, 0x00, 6, 65536, 0x00000000, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0), +(47572, 0x00, 6, 59981, 0x00000000, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0), +(53754, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0), +(53759, 0x00, 5, 0x00000000, 1024, 0x00000000, 0x00000000, 0x0006000, 0.000000, 0.000000, 0); \ No newline at end of file diff --git a/sql/updates/CMakeLists.txt b/sql/updates/CMakeLists.txt index a7f648271f..cabb11663c 100644 --- a/sql/updates/CMakeLists.txt +++ b/sql/updates/CMakeLists.txt @@ -78,7 +78,6 @@ INSTALL(FILES 1814_world.sql 1825_world.sql 1828_world.sql -1857_world.sql 1877_mangos_7439_01_world_trinity_string.sql 1881_world.sql 1884_world.sql @@ -86,4 +85,5 @@ INSTALL(FILES 1895_world.sql 1905_world.sql 1906_world.sql +1910_world.sql DESTINATION share/trinity/sql/updates) \ No newline at end of file diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 767cc51256..b4bedebbfe 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1043,7 +1043,13 @@ void Aura::_RemoveAura() ProcCaster = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT; ProcVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT; } - caster->ProcDamageAndSpell(m_target,ProcCaster, ProcVictim, PROC_EX_AURA_REMOVE, 0, BASE_ATTACK, m_spellProto); + uint32 procEx=0; + if (m_removeMode == AURA_REMOVE_BY_DISPEL) + procEx = PROC_EX_AURA_REMOVE_DISPEL; + else if (m_removeMode == AURA_REMOVE_BY_DEFAULT) + procEx = PROC_EX_AURA_REMOVE_EXPIRE; + + caster->ProcDamageAndSpell(m_target,ProcCaster, ProcVictim, procEx, m_modifier.m_amount, BASE_ATTACK, m_spellProto); } } } @@ -2051,9 +2057,10 @@ void Aura::HandleAuraDummy(bool apply, bool Real) // Living Bomb if (m_spellProto->SpellFamilyFlags[1] & 0x20000) { - if(!m_target || !caster || !(m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_DEFAULT)) + if(!m_target || !(m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_DEFAULT)) return; - caster->CastSpell(m_target, GetModifier()->m_amount, true, NULL, NULL, GetCasterGUID()); + Unit* target=NULL; + m_target->CastSpell(m_target, GetModifier()->m_amount, true, NULL, NULL, GetCasterGUID()); return; } break; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 45e88abe4d..f0bebd5718 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -603,9 +603,8 @@ enum ProcFlagsEx PROC_EX_ABSORB = 0x0000400, PROC_EX_REFLECT = 0x0000800, PROC_EX_INTERRUPT = 0x0001000, // Melee hit result can be Interrupt (not used) - PROC_EX_AURA_REMOVE = 0x0002000, - PROC_EX_RESERVED2 = 0x0004000, - PROC_EX_RESERVED3 = 0x0008000, + PROC_EX_AURA_REMOVE_DISPEL = 0x0002000, + PROC_EX_AURA_REMOVE_EXPIRE = 0x0004000, PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000 // If set trigger always but only one time (not used) }; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index aa4ff05828..d1cf3a1402 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2181,7 +2181,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe { if ((*i)->GetModifier()->m_amount<=0) { - pVictim->RemoveAurasDueToSpell((*i)->GetId()); + pVictim->RemoveAurasByCasterSpell((*i)->GetId(), (*i)->GetCasterGUID()); i = vSchoolAbsorb.begin(); } else @@ -5376,6 +5376,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu triggered_spell_id = 29077; break; } + // Shattered Barrier + if (dummySpell->SpellIconID == 2945) + { + // only on dispel/remove aura by sestroy + if (procEx & PROC_EX_AURA_REMOVE_EXPIRE && damage) + return false; + target = NULL; + triggered_spell_id = 55080; + CastSpell(target, triggered_spell_id, true); + return true; + } // Hot Streak if (dummySpell->SpellIconID == 2999) {