diff options
| author | azazel <none@none> | 2010-08-26 01:20:57 +0600 |
|---|---|---|
| committer | azazel <none@none> | 2010-08-26 01:20:57 +0600 |
| commit | 341e6303effccfdbfb6b67ae0d8fe6933f56ed3b (patch) | |
| tree | eff917fec707c7097a7b408ce15842ff24d8ddb4 /src/server/scripts/EasternKingdoms/ScarletEnclave | |
| parent | bb5f7b64927713911331f81f9c0a5abc33e0c3ab (diff) | |
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
Diffstat (limited to 'src/server/scripts/EasternKingdoms/ScarletEnclave')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 5eaa74a5211..d42923cd901 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -393,9 +393,9 @@ public: bool OnGossipHello(Player* pPlayer, Creature* pCreature) { - if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->GetHealth() == pCreature->GetMaxHealth()) + if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->IsFullHealth()) { - if (pPlayer->GetHealth() * 10 < pPlayer->GetMaxHealth()) + if (pPlayer->HealthBelowPct(10)) return true; if (pPlayer->isInCombat() || pCreature->isInCombat()) @@ -496,8 +496,7 @@ public: EnterEvadeMode(); return; } - else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER - && me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) + else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER && me->getVictim()->HealthBelowPct(10)) { me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); |
