Fix Vigilance.

Implements Glyph of Vigilance.
Fixes issue #1134. Thanks Bodompelle for the idea, even thought the fix is rather different.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-05-27 21:11:38 +02:00
parent 73c627829f
commit 452675e500
4 changed files with 21 additions and 3 deletions
+9 -2
View File
@@ -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);
}