mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
*Fix incorrect threat calculation of taunt spells.
--HG-- branch : trunk
This commit is contained in:
@@ -4042,18 +4042,24 @@ void Spell::EffectTaunt(uint32 /*i*/)
|
||||
{
|
||||
// this effect use before aura Taunt apply for prevent taunt already attacking target
|
||||
// for spell as marked "non effective at already attacking target"
|
||||
if(unitTarget && unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
if(!unitTarget || !unitTarget->CanHaveThreatList()
|
||||
|| unitTarget->getVictim() == m_caster)
|
||||
{
|
||||
if(unitTarget->getVictim()==m_caster)
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_DONT_REPORT);
|
||||
return;
|
||||
}
|
||||
SendCastResult(SPELL_FAILED_DONT_REPORT);
|
||||
return;
|
||||
}
|
||||
|
||||
// Also use this effect to set the taunter's threat to the taunted creature's highest value
|
||||
if(unitTarget->CanHaveThreatList() && unitTarget->getThreatManager().getCurrentVictim())
|
||||
unitTarget->getThreatManager().addThreat(m_caster,unitTarget->getThreatManager().getCurrentVictim()->getThreat());
|
||||
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);
|
||||
}
|
||||
|
||||
if(((Creature*)unitTarget)->IsAIEnabled)
|
||||
((Creature*)unitTarget)->AI()->AttackStart(m_caster);
|
||||
}
|
||||
|
||||
void Spell::EffectWeaponDmg(uint32 i)
|
||||
|
||||
@@ -10120,7 +10120,7 @@ void Unit::TauntApply(Unit* taunter)
|
||||
if (((Creature*)this)->IsAIEnabled)
|
||||
((Creature*)this)->AI()->AttackStart(taunter);
|
||||
|
||||
m_ThreatManager.tauntApply(taunter);
|
||||
//m_ThreatManager.tauntApply(taunter);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -10146,7 +10146,7 @@ void Unit::TauntFadeOut(Unit *taunter)
|
||||
return;
|
||||
}
|
||||
|
||||
m_ThreatManager.tauntFadeOut(taunter);
|
||||
//m_ThreatManager.tauntFadeOut(taunter);
|
||||
target = m_ThreatManager.getHostilTarget();
|
||||
|
||||
if (target && target != taunter)
|
||||
|
||||
Reference in New Issue
Block a user