* 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
@@ -288,7 +288,7 @@ public:
} else Frenzy_Timer -= diff;
//Enrage if not already enraged and below 20%
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
if (!Enraged && HealthBelowPct(20))
{
DoCast(me, SPELL_ENRAGE);
Enraged = true;
@@ -218,7 +218,7 @@ public:
} else ClassCall_Timer -= diff;
//Phase3 begins when we are below X health
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
if (!Phase3 && HealthBelowPct(20))
{
Phase3 = true;
DoScriptText(SAY_RAISE_SKELETONS, me);
@@ -141,7 +141,7 @@ public:
{
DoCast(me, SPELL_ESSENCEOFTHERED);
DoZoneInCombat();
me->SetHealth(int(me->GetMaxHealth()*.3));
me->SetHealth(me->CountPctFromMaxHealth(30));
}
void UpdateAI(const uint32 diff)
@@ -184,7 +184,7 @@ public:
return;
// Yell if hp lower than 15%
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
if (HealthBelowPct(15) && !HasYelled)
{
DoScriptText(SAY_HALFLIFE, me);
HasYelled = true;