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
@@ -818,7 +818,7 @@ public:
|
||||
|
||||
if (Player *pPlayer = Unit::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
|
||||
{
|
||||
if (!Weak && me->GetHealth() < (me->GetMaxHealth() / 100 * WeakPercent)
|
||||
if (!Weak && HealthBelowPct(WeakPercent)
|
||||
&& pPlayer->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
DoScriptText(EMOTE_WEAK, me);
|
||||
@@ -827,11 +827,11 @@ public:
|
||||
if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
|
||||
{
|
||||
Drained = true;
|
||||
HpPercent = float(me->GetHealth()) / float(me->GetMaxHealth());
|
||||
HpPercent = me->GetHealthPct();
|
||||
|
||||
me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
|
||||
|
||||
me->SetHealth(me->GetMaxHealth() * HpPercent);
|
||||
me->SetHealth(me->CountPctFromMaxHealth(HpPercent));
|
||||
me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
|
||||
me->SetInCombatWith(pPlayer);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user