* 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
@@ -334,7 +334,7 @@ public:
} else FlameStrikeTimer -= diff;
// Below 50%
if (me->GetMaxHealth() * 0.5f > me->GetHealth())
if (HealthBelowPct(50))
{
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
me->StopMoving();
@@ -461,7 +461,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (!UsedPotion && (me->GetHealth()*100 / me->GetMaxHealth()) < 25)
if (!UsedPotion && HealthBelowPct(25))
{
DoCast(me, SPELL_HEALING_POTION);
UsedPotion = true;
@@ -803,7 +803,7 @@ public:
}
} else Polymorph_Timer -= diff;
if (((me->GetHealth()*100 / me->GetMaxHealth()) < 35) && !HasIceBlocked)
if (HealthBelowPct(35) && !HasIceBlocked)
{
DoCast(me, SPELL_ICE_BLOCK);
HasIceBlocked = true;
@@ -132,7 +132,7 @@ public:
if (!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
if (!HealthAbovePct(100 - INTERVAL_MODIFIER * IntervalHealthAmount))
{
//increase amount, unless we're at 10%, then we switch and return
if (IntervalHealthAmount == INTERVAL_SWITCH)