*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

View File

@@ -498,11 +498,8 @@ struct TRINITY_DLL_DECL boss_malchezaarAI : public ScriptedAI
if (axe)
{
float threat = 1000000.0f;
if (axe->getVictim() && DoGetThreat(axe->getVictim()))
{
threat = axe->getThreatManager().getThreat(axe->getVictim());
axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100);
}
if (axe->getVictim())
DoModifyThreatPercent(axe->getVictim(), -100);
if (target)
axe->AddThreat(target, threat);
//axe->getThreatManager().tauntFadeOut(axe->getVictim());

View File

@@ -188,8 +188,7 @@ struct TRINITY_DLL_DECL boss_arlokkAI : public ScriptedAI
{
DoCast(m_creature->getVictim(), SPELL_GOUGE);
if (m_creature->getThreatManager().getThreat(m_creature->getVictim()))
m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80);
DoModifyThreatPercent(m_creature->getVictim(),-80);
m_uiGouge_Timer = 17000+rand()%10000;
}

View File

@@ -195,8 +195,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
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.
m_creature->getThreatManager().modifyThreatPercent(pUnit, -100);
DoModifyThreatPercent(pUnit, -100);
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).
}