Core:
* 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:
1 parent
bb5f7b6492
commit
341e6303ef
166 files changed
+445
-416
No files matched your search
@@ -96,12 +96,7 @@ public:
|
||||
if (!Victim || !Victim->HasAura(DUNGEON_MODE(SPELL_LEECH_POISON, H_SPELL_LEECH_POISON)) || !me->isAlive())
|
||||
return;
|
||||
|
||||
uint32 health = me->GetMaxHealth()/10;
|
||||
|
||||
if ((me->GetHealth()+health) >= me->GetMaxHealth())
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
else
|
||||
me->SetHealth(me->GetHealth()+health);
|
||||
me->ModifyHealth(int32(me->CountPctFromMaxHealth(10)));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
|
||||
+1
-1
@@ -293,7 +293,7 @@ public:
|
||||
} else uiRenewTimer -= uiDiff;
|
||||
|
||||
|
||||
if (!bHealth && me->GetHealth()*100 / me->GetMaxHealth() <= 25)
|
||||
if (!bHealth && !HealthAbovePct(25))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCastAOE(SPELL_HOLY_NOVA,false);
|
||||
|
||||
+2
-2
@@ -159,7 +159,7 @@ public:
|
||||
if (bEventInProgress)
|
||||
if (uiResurrectTimer <= uiDiff)
|
||||
{
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetFullHealth();
|
||||
DoCast(me,SPELL_BLACK_KNIGHT_RES,true);
|
||||
uiPhase++;
|
||||
uiResurrectTimer = 4000;
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (!me->hasUnitState(UNIT_STAT_ROOT) && !me->GetHealth()*100 / me->GetMaxHealth() <= 0)
|
||||
if (!me->hasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@ public:
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint8 uiMovementDone;
|
||||
uint8 uiGrandChampionsDeaths;
|
||||
uint16 uiMovementDone;
|
||||
uint16 uiGrandChampionsDeaths;
|
||||
uint8 uiArgentSoldierDeaths;
|
||||
|
||||
uint64 uiAnnouncerGUID;
|
||||
|
||||
+13
-6
@@ -107,7 +107,8 @@ enum SummonActions
|
||||
ACTION_SHADOW_STRIKE,
|
||||
ACTION_SCARAB_SUBMERGE,
|
||||
};
|
||||
␍const Position SphereSpawn[6] =
|
||||
|
||||
const Position SphereSpawn[6] =
|
||||
{
|
||||
{ 786.6439f, 108.2498f, 155.6701f, 0 },
|
||||
{ 806.8429f, 150.5902f, 155.6701f, 0 },
|
||||
@@ -115,7 +116,9 @@ enum SummonActions
|
||||
{ 744.3701f, 119.5211f, 155.6701f, 0 },
|
||||
{ 710.0211f, 120.8152f, 155.6701f, 0 },
|
||||
{ 706.6383f, 161.5266f, 155.6701f, 0 },
|
||||
};␍␍class boss_anubarak_trial : public CreatureScript
|
||||
};
|
||||
|
||||
class boss_anubarak_trial : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_anubarak_trial() : CreatureScript("boss_anubarak_trial") { }
|
||||
@@ -400,7 +403,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_swarm_scarab : public CreatureScript
|
||||
|
||||
class mob_swarm_scarab : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_swarm_scarab() : CreatureScript("mob_swarm_scarab") { }
|
||||
@@ -467,7 +471,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_nerubian_burrower : public CreatureScript
|
||||
|
||||
class mob_nerubian_burrower : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_nerubian_burrower() : CreatureScript("mob_nerubian_burrower") { }
|
||||
@@ -544,7 +549,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_frost_sphere : public CreatureScript
|
||||
|
||||
class mob_frost_sphere : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_frost_sphere() : CreatureScript("mob_frost_sphere") { }
|
||||
@@ -624,7 +630,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_anubarak_spike : public CreatureScript
|
||||
|
||||
class mob_anubarak_spike : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_anubarak_spike() : CreatureScript("mob_anubarak_spike") { }
|
||||
|
||||
+38
-16
@@ -47,7 +47,8 @@ enum eSpells
|
||||
SPELL_ANTI_AOE = 68595,
|
||||
SPELL_PVP_TRINKET = 65547,
|
||||
};
|
||||
␍class boss_toc_champion_controller : public CreatureScript
|
||||
|
||||
class boss_toc_champion_controller : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_toc_champion_controller() : CreatureScript("boss_toc_champion_controller") { }
|
||||
@@ -447,7 +448,8 @@ enum eDruidSpells
|
||||
SPELL_THORNS = 66068,
|
||||
SPELL_NATURE_GRASP = 66071, //1 min cd, self buff
|
||||
};
|
||||
␍class mob_toc_druid : public CreatureScript
|
||||
|
||||
class mob_toc_druid : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_druid() : CreatureScript("mob_toc_druid") { }
|
||||
@@ -542,7 +544,8 @@ enum eShamanSpells
|
||||
AURA_EXHAUSTION = 57723,
|
||||
AURA_SATED = 57724,
|
||||
};
|
||||
␍class mob_toc_shaman : public CreatureScript
|
||||
|
||||
class mob_toc_shaman : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_shaman() : CreatureScript("mob_toc_shaman") { }
|
||||
@@ -634,7 +637,8 @@ enum ePaladinSpells
|
||||
SPELL_HAND_OF_PROTECTION = 66009,
|
||||
SPELL_HAMMER_OF_JUSTICE = 66613,
|
||||
};
|
||||
␍class mob_toc_paladin : public CreatureScript
|
||||
|
||||
class mob_toc_paladin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_paladin() : CreatureScript("mob_toc_paladin") { }
|
||||
@@ -682,7 +686,7 @@ public:
|
||||
if (m_uiHandOfProtectionTimer <= uiDiff)
|
||||
{
|
||||
if (Unit *pTarget = DoSelectLowestHpFriendly(40.0f))
|
||||
if (pTarget->GetHealth() * 100 < pTarget->GetMaxHealth() * 15) // HealthBelowPct(15)
|
||||
if (pTarget->HealthBelowPct(15))
|
||||
DoCast(pTarget,SPELL_HAND_OF_PROTECTION);
|
||||
m_uiHandOfProtectionTimer = urand(0*IN_MILLISECONDS,360*IN_MILLISECONDS);
|
||||
} else m_uiHandOfProtectionTimer -= uiDiff;
|
||||
@@ -739,7 +743,9 @@ enum ePriestSpells
|
||||
SPELL_DISPEL = 65546,
|
||||
SPELL_PSYCHIC_SCREAM = 65543,
|
||||
SPELL_MANA_BURN = 66100,
|
||||
};␍␍class mob_toc_priest : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_priest : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_priest() : CreatureScript("mob_toc_priest") { }
|
||||
@@ -819,7 +825,8 @@ enum eShadowPriestSpells
|
||||
SPELL_DISPERSION = 65544,
|
||||
SPELL_SHADOWFORM = 16592,
|
||||
};
|
||||
␍class mob_toc_shadow_priest : public CreatureScript
|
||||
|
||||
class mob_toc_shadow_priest : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_shadow_priest() : CreatureScript("mob_toc_shadow_priest") { }
|
||||
@@ -930,7 +937,9 @@ enum eWarlockSpells
|
||||
SPELL_UNSTABLE_AFFLICTION = 65812,
|
||||
SPELL_SUMMON_FELHUNTER = 67514,
|
||||
H_SPELL_UNSTABLE_AFFLICTION = 68155, //15s
|
||||
};␍␍class mob_toc_warlock : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_warlock : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_warlock() : CreatureScript("mob_toc_warlock") { }
|
||||
@@ -1035,7 +1044,9 @@ enum eMageSpells
|
||||
SPELL_FROSTBOLT = 65807,
|
||||
SPELL_ICE_BLOCK = 65802, //5min
|
||||
SPELL_POLYMORPH = 65801, //15s
|
||||
};␍␍class mob_toc_mage : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_mage : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_mage() : CreatureScript("mob_toc_mage") { }
|
||||
@@ -1137,7 +1148,8 @@ enum eHunterSpells
|
||||
SPELL_WYVERN_STING = 65877, //60s
|
||||
SPELL_CALL_PET = 67777,
|
||||
};
|
||||
␍class mob_toc_hunter : public CreatureScript
|
||||
|
||||
class mob_toc_hunter : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_hunter() : CreatureScript("mob_toc_hunter") { }
|
||||
@@ -1251,7 +1263,9 @@ enum eBoomkinSpells
|
||||
SPELL_MOONFIRE = 65856, //5s
|
||||
SPELL_STARFIRE = 65854,
|
||||
SPELL_WRATH = 65862,
|
||||
};␍␍class mob_toc_boomkin : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_boomkin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_boomkin() : CreatureScript("mob_toc_boomkin") { }
|
||||
@@ -1353,7 +1367,9 @@ enum eWarriorSpells
|
||||
SPELL_SUNDER_ARMOR = 65936,
|
||||
SPELL_SHATTERING_THROW = 65940,
|
||||
SPELL_RETALIATION = 65932,
|
||||
};␍␍class mob_toc_warrior : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_warrior : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_warrior() : CreatureScript("mob_toc_warrior") { }
|
||||
@@ -1465,7 +1481,9 @@ enum eDeathKnightSpells
|
||||
SPELL_ICEBOUND_FORTITUDE = 66023, //1min
|
||||
SPELL_ICY_TOUCH = 66021, //8sec
|
||||
SPELL_STRANGULATE = 66018, //2min
|
||||
};␍␍class mob_toc_dk : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_dk : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_dk() : CreatureScript("mob_toc_dk") { }
|
||||
@@ -1565,7 +1583,9 @@ enum eRogueSpells
|
||||
SPELL_SHADOWSTEP = 66178, //30sec
|
||||
SPELL_HEMORRHAGE = 65954,
|
||||
SPELL_EVISCERATE = 65957,
|
||||
};␍␍class mob_toc_rogue : public CreatureScript
|
||||
};
|
||||
|
||||
class mob_toc_rogue : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_rogue() : CreatureScript("mob_toc_rogue") { }
|
||||
@@ -1663,7 +1683,8 @@ enum eEnhShamanSpells
|
||||
SPELL_LAVA_LASH = 65974,
|
||||
SPELL_STORMSTRIKE = 65970,
|
||||
};
|
||||
␍class mob_toc_enh_shaman : public CreatureScript
|
||||
|
||||
class mob_toc_enh_shaman : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_enh_shaman() : CreatureScript("mob_toc_enh_shaman") { }
|
||||
@@ -1796,7 +1817,8 @@ enum eRetroPaladinSpells
|
||||
SPELL_REPENTANCE = 66008, //60sec cd
|
||||
SPELL_SEAL_OF_COMMAND = 66004, //no cd
|
||||
};
|
||||
␍class mob_toc_retro_paladin : public CreatureScript
|
||||
|
||||
class mob_toc_retro_paladin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_toc_retro_paladin() : CreatureScript("mob_toc_retro_paladin") { }
|
||||
|
||||
+13
-8
@@ -261,7 +261,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
if (caster->ToCreature() == me)
|
||||
if (spell->Effect[0] == 136) //Effect Heal
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetHealth() + me->GetMaxHealth()*spell->EffectBasePoints[0]/100);
|
||||
m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetHealth() + me->CountPctFromMaxHealth(spell->EffectBasePoints[0]));
|
||||
}
|
||||
|
||||
void SummonColorballs(uint8 quantity)
|
||||
@@ -270,7 +270,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
float y = y0;
|
||||
for (uint8 i = 0; i < quantity; i++)
|
||||
{
|
||||
float x = urand(x0-r,x0+r);
|
||||
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
|
||||
if (urand(0,1))
|
||||
y = y0 + sqrt(pow(r,2) - pow((x-x0),2));
|
||||
else
|
||||
@@ -420,7 +420,8 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
/*######
|
||||
## boss_fjola
|
||||
######*/
|
||||
␍class boss_fjola : public CreatureScript
|
||||
|
||||
class boss_fjola : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_fjola() : CreatureScript("boss_fjola") { }
|
||||
@@ -479,7 +480,8 @@ public:
|
||||
/*######
|
||||
## boss_eydis
|
||||
######*/
|
||||
␍class boss_eydis : public CreatureScript
|
||||
|
||||
class boss_eydis : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_eydis() : CreatureScript("boss_eydis") { }
|
||||
@@ -520,7 +522,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_essence_of_twin : public CreatureScript
|
||||
|
||||
class mob_essence_of_twin : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_essence_of_twin() : CreatureScript("mob_essence_of_twin") { }
|
||||
@@ -560,7 +563,7 @@ struct mob_unleashed_ballAI : public ScriptedAI
|
||||
{
|
||||
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
|
||||
float y = y0;
|
||||
float x = urand(x0-r,x0+r);
|
||||
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
|
||||
if (urand(0,1))
|
||||
y = y0 + sqrt(pow(r,2) - pow((x-x0),2));
|
||||
else
|
||||
@@ -594,7 +597,8 @@ struct mob_unleashed_ballAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
};
|
||||
␍class mob_unleashed_dark : public CreatureScript
|
||||
|
||||
class mob_unleashed_dark : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_unleashed_dark() : CreatureScript("mob_unleashed_dark") { }
|
||||
@@ -627,7 +631,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
␍class mob_unleashed_light : public CreatureScript
|
||||
|
||||
class mob_unleashed_light : public CreatureScript
|
||||
{
|
||||
public:
|
||||
mob_unleashed_light() : CreatureScript("mob_unleashed_light") { }
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
uint64 uiNovosCrystal3;
|
||||
uint64 uiNovosCrystal4;
|
||||
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint16 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
std::string str_data;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
me->ExitVehicle();
|
||||
|
||||
// restore health if any damage done during intro
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetFullHealth();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_TYRANNUS_EVENT, IN_PROGRESS);
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!bHealth && HealthBelowPct(50) && !HealthBelowPct(5))
|
||||
if (!bHealth && HealthBelowPct(50) && !HealthBelowPct(5))
|
||||
{
|
||||
CreatureState(me, false);
|
||||
DoCast(me,SPELL_FREEZE_ANIM);
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
if (HealthBelowPct(5))
|
||||
pSummon->DealDamage(pSummon, pSummon->GetHealth() * 0.5 , NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
pSummon->DealDamage(pSummon, pSummon->GetHealth() * 0.5, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
pSummon->AI()->AttackStart(me->getVictim());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -498,8 +498,7 @@ class spell_marrowgar_bone_storm : public SpellScriptLoader
|
||||
return;
|
||||
|
||||
float distVar = distance >= 20.0f ? 4 : (10.0f/3.0f);
|
||||
dmg /= distance / distVar;
|
||||
SetHitDamage(dmg);
|
||||
SetHitDamage(int32(dmg * distVar / distance));
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
if (me->IsWithinMeleeRange(me->getVictim()))
|
||||
{
|
||||
me->Kill(me->getVictim());
|
||||
me->ModifyHealth(me->GetMaxHealth() * 0.05f);
|
||||
me->ModifyHealth(int32(me->CountPctFromMaxHealth(5)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
|
||||
if (!pTarget->HasAura(SPELL_MUTATING_INJECTION))
|
||||
DoCast(pTarget, SPELL_MUTATING_INJECTION);
|
||||
events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth()));
|
||||
events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
uiCrystalSpikesTimer2 = 200;
|
||||
} else uiCrystalSpikesTimer2 -= diff;
|
||||
|
||||
if (!bFrenzy && (me->GetHealth() < me->GetMaxHealth() * 0.25))
|
||||
if (!bFrenzy && HealthBelowPct(25))
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
bFrenzy = true;
|
||||
|
||||
@@ -569,7 +569,7 @@ public:
|
||||
Unit* pVesp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_VESPERON) : 0);
|
||||
|
||||
//spell will target dragons, if they are still alive at 35%
|
||||
if (!m_bIsBerserk && (me->GetHealth()*100 / me->GetMaxHealth()) <= 35
|
||||
if (!m_bIsBerserk && !HealthAbovePct(35)
|
||||
&& ((pTene && pTene->isAlive()) || (pShad && pShad->isAlive()) || (pVesp && pVesp->isAlive())))
|
||||
{
|
||||
DoScriptText(SAY_SARTHARION_BERSERK, me);
|
||||
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
m_uiLightningNova_Timer -= uiDiff;
|
||||
|
||||
// Health check
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier)))
|
||||
if (HealthBelowPct(100 - 25 * m_uiHealthAmountModifier))
|
||||
{
|
||||
switch(m_uiHealthAmountModifier)
|
||||
{
|
||||
|
||||
@@ -312,7 +312,7 @@ public:
|
||||
}
|
||||
|
||||
// Health check
|
||||
if (!m_bCanShatterGolem && (me->GetHealth()*100 / me->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier)))
|
||||
if (!m_bCanShatterGolem && me->HealthBelowPct(100 - 20 * m_uiHealthAmountModifier))
|
||||
{
|
||||
++m_uiHealthAmountModifier;
|
||||
|
||||
|
||||
@@ -190,11 +190,11 @@ public:
|
||||
{
|
||||
if (Creature* Brundir = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Brundir->isAlive())
|
||||
Brundir->SetHealth(Brundir->GetMaxHealth());
|
||||
Brundir->SetFullHealth();
|
||||
|
||||
if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Molgeim->isAlive())
|
||||
Molgeim->SetHealth(Molgeim->GetMaxHealth());
|
||||
Molgeim->SetFullHealth();
|
||||
|
||||
DoCast(SPELL_SUPERCHARGE);
|
||||
}
|
||||
@@ -315,11 +315,11 @@ public:
|
||||
{
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Steelbreaker->isAlive())
|
||||
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
|
||||
Steelbreaker->SetFullHealth();
|
||||
|
||||
if (Creature* Brundir = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_STORMCALLER_BRUNDIR) : 0))
|
||||
if (Brundir->isAlive())
|
||||
Brundir->SetHealth(Brundir->GetMaxHealth());
|
||||
Brundir->SetFullHealth();
|
||||
|
||||
DoCast(me, SPELL_SUPERCHARGE);
|
||||
}
|
||||
@@ -521,11 +521,11 @@ public:
|
||||
{
|
||||
if (Creature* Steelbreaker = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_STEELBREAKER) : 0))
|
||||
if (Steelbreaker->isAlive())
|
||||
Steelbreaker->SetHealth(Steelbreaker->GetMaxHealth());
|
||||
Steelbreaker->SetFullHealth();
|
||||
|
||||
if (Creature* Molgeim = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_RUNEMASTER_MOLGEIM) : 0))
|
||||
if (Molgeim->isAlive())
|
||||
Molgeim->SetHealth(Molgeim->GetMaxHealth());
|
||||
Molgeim->SetFullHealth();
|
||||
|
||||
DoCast(SPELL_SUPERCHARGE);
|
||||
}
|
||||
|
||||
@@ -131,13 +131,13 @@ public:
|
||||
if (me->getVictim() && !me->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
me->Kill(me->getVictim());
|
||||
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 99 && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
|
||||
if (HealthBelowPct(99) && Phase == 1) // TODO: Only land (exit Phase 1) if brought down with harpoon guns! This is important!
|
||||
{
|
||||
Phase = 2;
|
||||
DoScriptText(SAY_PHASE_2_TRANS, me); // Audio: "Move quickly! She won't remain grounded for long!"
|
||||
}
|
||||
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < 33 && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
|
||||
if (HealthBelowPct(33) && Phase == 2) // Health under 33%, Razorscale can't fly anymore.
|
||||
{
|
||||
Phase = 3;
|
||||
DoScriptText(SAY_PHASE_3_TRANS, me); // "Razorscale lands permanently!"
|
||||
|
||||
@@ -254,7 +254,7 @@ public:
|
||||
enterHardMode = true;
|
||||
|
||||
// set max health
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetFullHealth();
|
||||
|
||||
// Get his heartbreak buff
|
||||
me->CastSpell(me, RAID_MODE(SPELL_HEARTBREAK_10, SPELL_HEARTBREAK_25), true);
|
||||
@@ -611,7 +611,7 @@ public:
|
||||
// TODO Send raid message
|
||||
|
||||
// Increase health with 1 percent
|
||||
pXT002->ModifyHealth(pXT002->GetMaxHealth() * 0.01);
|
||||
pXT002->ModifyHealth(int32(pXT002->CountPctFromMaxHealth(1)));
|
||||
|
||||
// Despawns the scrapbot
|
||||
me->ForcedDespawn();
|
||||
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
} else m_uiAbility_TORGYN_Timer -= diff;
|
||||
|
||||
// Health check -----------------------------------------------------------------------------
|
||||
if ((me->GetHealth()*100 / me->GetMaxHealth()) < (100-(m_uiHealthAmountMultipler * m_uiHealthAmountModifier)))
|
||||
if (me->HealthBelowPct(100 - m_uiHealthAmountMultipler * m_uiHealthAmountModifier))
|
||||
{
|
||||
uint8 m_uiOrder = m_uiHealthAmountModifier - 1;
|
||||
++m_uiHealthAmountModifier;
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
if (minion && minion->isAlive())
|
||||
{
|
||||
minion->CastSpell(me, SPELL_OVERCHARGED, true);
|
||||
minion->SetHealth(minion->GetMaxHealth());
|
||||
minion->SetFullHealth();
|
||||
DoScriptText(EMOTE_OVERCHARGE, me);
|
||||
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
|
||||
}
|
||||
|
||||
@@ -238,11 +238,11 @@ public:
|
||||
return me->GetGUID();
|
||||
|
||||
Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
|
||||
if (pGuard1 && pGuard1->isAlive() && (pGuard1->GetHealth()*100 <= pGuard1->GetMaxHealth() * 75))
|
||||
if (pGuard1 && pGuard1->isAlive() && !pGuard1->HealthAbovePct(75))
|
||||
return pGuard1->GetGUID();
|
||||
|
||||
Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
|
||||
if (pGuard2 && pGuard2->isAlive() && (pGuard2->GetHealth()*100 <= pGuard2->GetMaxHealth() * 75))
|
||||
if (pGuard2 && pGuard2->isAlive() && !pGuard2->HealthAbovePct(75))
|
||||
return pGuard2->GetGUID();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
switch(param)
|
||||
{
|
||||
case ACTION_WATER_ELEMENT_HIT:
|
||||
me->SetHealth(me->GetHealth() + me->GetMaxHealth() * 0.01f);
|
||||
me->ModifyHealth(int32(me->CountPctFromMaxHealth(1)));
|
||||
|
||||
if (bIsExploded)
|
||||
DoExplodeCompleted();
|
||||
@@ -170,8 +170,8 @@ public:
|
||||
bAchievement = false;
|
||||
break;
|
||||
case ACTION_WATER_ELEMENT_KILLED:
|
||||
uint32 damage = (me->GetMaxHealth()*3)/100;
|
||||
me->SetHealth(me->GetHealth() - damage);
|
||||
uint32 damage = me->CountPctFromMaxHealth(3);
|
||||
me->ModifyHealth(-int32(damage));
|
||||
me->LowerPlayerDamageReq(damage);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1620,7 +1620,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
|
||||
{
|
||||
if (pSpell->Id == SPELL_ARCANE_CHAINS && pCaster->GetTypeId() == TYPEID_PLAYER && me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !bEnslaved)
|
||||
if (pSpell->Id == SPELL_ARCANE_CHAINS && pCaster->GetTypeId() == TYPEID_PLAYER && !HealthAbovePct(50) && !bEnslaved)
|
||||
{
|
||||
EnterEvadeMode(); //We make sure that the npc is not attacking the player!
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
@@ -646,7 +646,7 @@ public:
|
||||
uiFishyScentTimer = 20000;
|
||||
} else uiFishyScentTimer -= uiDiff;
|
||||
|
||||
if (!bSummoned && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
|
||||
if (!bSummoned && !HealthAbovePct(50))
|
||||
{
|
||||
DoScriptText(SAY_CALL_FOR_HELP ,me);
|
||||
//DoCast(me->getVictim(), SPELL_SUMMON_WHISKER); petai is not working correctly???
|
||||
@@ -771,7 +771,7 @@ public:
|
||||
uiChargeTimer = 15000;
|
||||
} else uiChargeTimer -= uiDiff;
|
||||
|
||||
if (!bEnrage && me->GetHealth()*100 / me->GetMaxHealth() <= 20)
|
||||
if (!bEnrage && !HealthAbovePct(20))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
bEnrage = true;
|
||||
@@ -968,7 +968,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (bThunderClap && me->GetHealth()*100 / me->GetMaxHealth() <= 10)
|
||||
if (bThunderClap && !HealthAbovePct(10))
|
||||
{
|
||||
DoCastAOE(SPELL_THUNDERCLAP);
|
||||
bThunderClap = true;
|
||||
@@ -994,7 +994,7 @@ public:
|
||||
uiStinkyBeardTimer = 15000;
|
||||
} else uiStinkyBeardTimer -= uiDiff;
|
||||
|
||||
if (!bEnrage && me->GetHealth()*100 / me->GetMaxHealth() <= 20)
|
||||
if (!bEnrage && !HealthAbovePct(20))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE_STINKBEARD);
|
||||
bEnrage = true;
|
||||
@@ -1119,7 +1119,7 @@ public:
|
||||
uiElementalSpellTimer = urand(5000,8000);
|
||||
} else uiElementalSpellTimer -= uiDiff;
|
||||
|
||||
if (!bAddAttack && me->GetHealth()*100 / me->GetMaxHealth() <= 20)
|
||||
if (!bAddAttack && !HealthAbovePct(20))
|
||||
{
|
||||
if (!SummonList.empty())
|
||||
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
|
||||
Reference in new issue
Block a user