* 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
@@ -177,7 +177,7 @@ class boss_omor_the_unscarred : public CreatureScript
else
OrbitalStrike_Timer -= diff;
if ((me->GetHealth()*100) / me->GetMaxHealth() < 20)
if (HealthBelowPct(20))
{
if (DemonicShield_Timer <= diff)
{
@@ -140,7 +140,7 @@ class boss_nazan : public CreatureScript
if (flight) // phase 1 - the flight
{
Creature *Vazruden = Unit::GetCreature(*me,VazrudenGUID);
if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth())))
if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && Vazruden->HealthAbovePct(20)))
{
flight = false;
BellowingRoar_Timer = 6000;
@@ -139,7 +139,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript
else
Surge_Timer -= diff;
if ((me->GetHealth()*100) / me->GetMaxHealth() < 20)
if (HealthBelowPct(20))
{
if (Retaliation_Timer <= diff)
{
@@ -152,7 +152,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript
if (!YelledForHeal)
{
if ((me->GetHealth()*100) / me->GetMaxHealth() < 40)
if (HealthBelowPct(40))
{
DoScriptText(SAY_HEAL, me);
YelledForHeal = true;
@@ -443,7 +443,7 @@ class boss_magtheridon : public CreatureScript
else
Blaze_Timer -= diff;
if (!Phase3 && me->GetHealth()*10 < me->GetMaxHealth()*3
if (!Phase3 && HealthBelowPct(30)
&& !me->IsNonMeleeSpellCasted(false) // blast nova
&& !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake
{
@@ -568,7 +568,7 @@ class mob_hellfire_channeler : public CreatureScript
if (DarkMending_Timer <= diff)
{
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50)
if (HealthBelowPct(50))
DoCast(me, SPELL_DARK_MENDING);
DarkMending_Timer = 10000 +(rand() % 10000);
}
@@ -293,7 +293,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript
else
DeathCoil_Timer -= diff;
if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20)
if (!HealthAbovePct(20))
Phase = true;
DoMeleeAttackIfReady();