* 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:
azazel
2010-08-26 01:20:57 +06:00
parent bb5f7b6492
commit 341e6303ef
166 changed files with 445 additions and 416 deletions
@@ -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;