Core:
* add helping methods for manipulating unit's health and use it where applicable * fix some conversion warnings and cleanup code (formatting, CRLF, tabs to spaces) --HG-- branch : trunk
This commit is contained in:
@@ -116,7 +116,7 @@ public:
|
||||
{
|
||||
if (Unit* Archimonde = Unit::GetUnit((*me), ArchimondeGUID))
|
||||
{
|
||||
if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
|
||||
if (Archimonde->HealthBelowPct(2) || !Archimonde->isAlive())
|
||||
DoCast(me, SPELL_DENOUEMENT_WISP);
|
||||
else
|
||||
DoCast(Archimonde, SPELL_ANCIENT_SPARK);
|
||||
@@ -504,14 +504,14 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
|
||||
if (me->HealthBelowPct(10) && !BelowTenPercent && !Enraged)
|
||||
BelowTenPercent = true;
|
||||
|
||||
if (!Enraged)
|
||||
{
|
||||
if (EnrageTimer <= diff)
|
||||
{
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) > 10)
|
||||
if (HealthAbovePct(10))
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
@@ -551,7 +551,7 @@ public:
|
||||
return;
|
||||
|
||||
//TODO: add his abilities'n-crap here
|
||||
if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
|
||||
if (!LowHp && HealthBelowPct(20))
|
||||
{
|
||||
DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), me);
|
||||
LowHp = true;
|
||||
|
||||
Reference in New Issue
Block a user