mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Merge pull request #14969 from chaodhib/taunt_threat_fixes
[Spell] Fix bugged amount of threat given by Taunt
(cherry picked from commit aacd8feb61)
Conflicts:
src/server/game/Spells/SpellEffects.cpp
This commit is contained in:
@@ -2907,19 +2907,18 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
}
|
||||
|
||||
// Also use this effect to set the taunter's threat to the taunted creature's highest value
|
||||
if (unitTarget->getThreatManager().getCurrentVictim())
|
||||
{
|
||||
float myThreat = unitTarget->getThreatManager().getThreat(m_caster);
|
||||
float itsThreat = unitTarget->getThreatManager().getCurrentVictim()->getThreat();
|
||||
if (itsThreat > myThreat)
|
||||
unitTarget->getThreatManager().addThreat(m_caster, itsThreat - myThreat);
|
||||
}
|
||||
|
||||
//Set aggro victim to caster
|
||||
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 topThreat = unitTarget->getThreatManager().getOnlineContainer().getMostHated()->getThreat();
|
||||
if (topThreat > myThreat)
|
||||
unitTarget->getThreatManager().doAddThreat(m_caster, topThreat - myThreat);
|
||||
|
||||
//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);
|
||||
|
||||
Reference in New Issue
Block a user