* 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
@@ -275,7 +275,7 @@ public:
} else Enrage_Timer -= diff;
//Blessing of Tides Trigger
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides)
if (!HealthAbovePct(75) && !BlessingOfTides)
{
BlessingOfTides = true;
bool continueTriggering = false;
@@ -396,7 +396,7 @@ public:
if (Phase == 1)
{
//Start phase 2
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70)
if (HealthBelowPct(70))
{
//Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
Phase = 2;
@@ -556,7 +556,7 @@ public:
if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3))
{
//set life 50%
me->SetHealth(me->GetMaxHealth()/2);
me->SetHealth(me->CountPctFromMaxHealth(50));
me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
@@ -561,7 +561,7 @@ public:
} else SwitchToHuman_Timer -= diff;
}
if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15)
if (!IsFinalForm && HealthBelowPct(15))
{
//at this point he divides himself in two parts
CastConsumingMadness();
@@ -154,7 +154,7 @@ public:
if (!Summon75)
{
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75)
if (HealthBelowPct(75))
{
SummonMechanichs();
Summon75 = true;
@@ -163,7 +163,7 @@ public:
if (!Summon50)
{
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
if (HealthBelowPct(50))
{
SummonMechanichs();
Summon50 = true;
@@ -172,7 +172,7 @@ public:
if (!Summon25)
{
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)
if (HealthBelowPct(25))
{
SummonMechanichs();
Summon25 = true;
@@ -64,7 +64,7 @@ public:
if (!UpdateVictim())
return;
if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
if (!HealthAbovePct(20))
{
if (!Root)
{