*Use safer function to modify threat pct in script.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-21 11:10:13 -05:00
parent 6d3fd6b189
commit 614d31ddb2
3 changed files with 4 additions and 9 deletions
@@ -498,11 +498,8 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if (axe) if (axe)
{ {
float threat = 1000000.0f; float threat = 1000000.0f;
if (axe->getVictim() && DoGetThreat(axe->getVictim())) if (axe->getVictim())
{ DoModifyThreatPercent(axe->getVictim(), -100);
threat = axe->getThreatManager().getThreat(axe->getVictim());
axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100);
}
if (target) if (target)
axe->AddThreat(target, threat); axe->AddThreat(target, threat);
//axe->getThreatManager().tauntFadeOut(axe->getVictim()); //axe->getThreatManager().tauntFadeOut(axe->getVictim());
@@ -188,8 +188,7 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
{ {
DoCast(m_creature->getVictim(), SPELL_GOUGE); DoCast(m_creature->getVictim(), SPELL_GOUGE);
if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) DoModifyThreatPercent(m_creature->getVictim(),-80);
m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
m_uiGouge_Timer = 17000+rand()%10000; m_uiGouge_Timer = 17000+rand()%10000;
} }
@@ -195,8 +195,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
if (pUnit) if (pUnit)
{ {
m_creature->AddThreat(pUnit, 1.0f); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. DoModifyThreatPercent(pUnit, -100);
m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
float threat = target->getThreatManager().getThreat(pUnit); float threat = target->getThreatManager().getThreat(pUnit);
m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences).
} }