mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
*Use safer function to modify threat pct in script.
--HG-- branch : trunk
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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).
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user