diff options
author | chaodhib <chaodhib@gmail.com> | 2015-06-28 17:21:14 +0200 |
---|---|---|
committer | chaodhib <chaodhib@gmail.com> | 2015-06-29 17:39:55 +0200 |
commit | 00788c6f0111f237c82706a5a3c21985dc66efdb (patch) | |
tree | be056255fd4eb1c325535218d0ba5ba3ab7c520c /src | |
parent | accab5451d3e62739e4aa376d25bc6623f0d3c52 (diff) |
[SpellEffect] Fix bugged amount of threat given by Taunt
1) doAddThreat call instead of AddThreat. ThreatCalcHelper shouldnt be called. Otherwise, the value of the threat that will be added to the caster will be multiplied by a threatModifier (about 1.6)
2) Taunt should give the caster the same threat as the one in the top of the list. If player A has aggro with 1000 threat, player B has 1050 threat and if player C taunts, player C should have 1050 threat after the taunt and not 1000 (the difference can be much bigger with ranged players).
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 3829e12b790..965b2463139 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3100,19 +3100,18 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/) if (m_spellInfo->Id == 62124) m_caster->CastSpell(unitTarget, 67485, true); - // Also use this effect to set the taunter's threat to the taunted creature's highest value - if (unitTarget->getThreatManager().getCurrentVictim()) + if (!unitTarget->getThreatManager().getOnlineContainer().empty()) { + // Also use this effect to set the taunter's threat to the taunted creature's highest value float myThreat = unitTarget->getThreatManager().getThreat(m_caster); - float itsThreat = unitTarget->getThreatManager().getCurrentVictim()->getThreat(); - if (itsThreat > myThreat) - unitTarget->getThreatManager().addThreat(m_caster, itsThreat - myThreat); - } + float topThreat = unitTarget->getThreatManager().getOnlineContainer().getMostHated()->getThreat(); + if (topThreat > myThreat) + unitTarget->getThreatManager().doAddThreat(m_caster, topThreat - myThreat); - //Set aggro victim to caster - if (!unitTarget->getThreatManager().getOnlineContainer().empty()) + //Set aggro victim to caster if (HostileReference* forcedVictim = unitTarget->getThreatManager().getOnlineContainer().getReferenceByTarget(m_caster)) unitTarget->getThreatManager().setCurrentVictim(forcedVictim); + } if (unitTarget->ToCreature()->IsAIEnabled && !unitTarget->ToCreature()->HasReactState(REACT_PASSIVE)) unitTarget->ToCreature()->AI()->AttackStart(m_caster); |