diff options
author | Trazom62 <none@none> | 2010-05-27 21:11:38 +0200 |
---|---|---|
committer | Trazom62 <none@none> | 2010-05-27 21:11:38 +0200 |
commit | 452675e500bddc0446a05c1bbb0b61aa366d361d (patch) | |
tree | a62189e5a1e27332055e43b805d260b04e57f9f9 | |
parent | 73c627829f55743053c653a39378d3a833ed7622 (diff) |
Fix Vigilance.
Implements Glyph of Vigilance.
Fixes issue #1134. Thanks Bodompelle for the idea, even thought the fix is rather different.
--HG--
branch : trunk
-rw-r--r-- | sql/updates/8319_world_spell_linked_spell.sql | 1 | ||||
-rw-r--r-- | sql/world.sql | 1 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 11 | ||||
-rw-r--r-- | src/game/ThreatManager.cpp | 11 |
4 files changed, 21 insertions, 3 deletions
diff --git a/sql/updates/8319_world_spell_linked_spell.sql b/sql/updates/8319_world_spell_linked_spell.sql new file mode 100644 index 00000000000..5c8db788868 --- /dev/null +++ b/sql/updates/8319_world_spell_linked_spell.sql @@ -0,0 +1 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=50720; diff --git a/sql/world.sql b/sql/world.sql index ee5620c3b4e..b790a7a0814 100644 --- a/sql/world.sql +++ b/sql/world.sql @@ -6006,7 +6006,6 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 32390, 60467, 2, 'Shadow Embrace Rank4'), ( 32391, 60468, 2, 'Shadow Embrace Rank5'), ( 33206, 44416, 2, 'Pain Suppression (threat)'), -( 50720, 59665, 0, 'Vigilance (redirect threat)'), ( 52610, 62071, 0, 'Savage Roar'), (-52610,-62071, 0, 'Savage Roar'), ( 51209, 55095, 1, 'Hungering cold - frost fever'), diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 1b2e0f5b6fd..1b75ab75473 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1320,6 +1320,17 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, // mods at aura apply or remove switch (GetSpellProto()->SpellFamilyName) { + case SPELLFAMILY_GENERIC: + switch(GetId()) + { + case 50720: // Vigilance + if (apply) + target->CastSpell(caster, 59665, true, 0, 0, caster->GetGUID()); + else + target->SetReducedThreatPercent(0,0); + break; + } + break; case SPELLFAMILY_ROGUE: // Stealth if (GetSpellProto()->SpellFamilyFlags[0] & 0x00400000) diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 3cf9f5d435d..d64cb96f510 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -384,9 +384,16 @@ void ThreatManager::addThreat(Unit* pVictim, float fThreat, SpellSchoolMask scho // must check > 0.0f, otherwise dead loop if (threat > 0.0f && pVictim->GetReducedThreatPercent()) { - float reducedThreat = threat * pVictim->GetReducedThreatPercent() / 100; + uint32 reducedThreadPercent = pVictim->GetReducedThreatPercent(); + + Unit *unit = pVictim->GetMisdirectionTarget(); + if (unit) + if (Aura* pAura = unit->GetAura(63326)) // Glyph of Vigilance + reducedThreadPercent += pAura->GetSpellProto()->EffectBasePoints[0]; + + float reducedThreat = threat * reducedThreadPercent / 100; threat -= reducedThreat; - if (Unit *unit = pVictim->GetMisdirectionTarget()) + if (unit) _addThreat(unit, reducedThreat); } |