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/Spells | |
| 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/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 8d6f078355a..32a22260ed4 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -54,7 +54,7 @@ public: int32 bp = 0; // Living ghoul as a target if (unitTarget->isAlive()) - bp = unitTarget->GetMaxHealth() * 0.25f; + bp = int32(unitTarget->CountPctFromMaxHealth(25)); // Some corpse else bp = GetEffectValue(); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 931914ea03e..f54803c900e 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -85,7 +85,7 @@ public: if (NewPet->getDeathState() == DEAD) NewPet->setDeathState(ALIVE); - NewPet->SetHealth(NewPet->GetMaxHealth()); + NewPet->SetFullHealth(); NewPet->SetPower(NewPet->getPowerType(),NewPet->GetMaxPower(NewPet->getPowerType())); switch (NewPet->GetEntry()) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 106384c6320..ae54bfe297d 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -184,7 +184,7 @@ public: void HandleDummy(SpellEffIndex /*effIndex*/) { Unit *caster = GetCaster(); - int32 healthModSpellBasePoints0 = int32(caster->GetMaxHealth()*0.3); + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); caster->CastCustomSpell(caster, HUNTER_PET_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 448a468cdf2..64dc02425df 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -74,7 +74,7 @@ public: case CREATURE_FAMILY_VOIDWALKER: { SpellEntry const* spellInfo = sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); - int32 hp = targetCreature->GetMaxHealth() * GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0) / 100; + int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); //unitTarget->CastSpell(unitTarget, 54441, true); break; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 48a37395b81..85c7c57ad05 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -44,7 +44,7 @@ class spell_warr_last_stand : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - int32 healthModSpellBasePoints0 = int32(GetCaster()->GetMaxHealth() * 0.3); + int32 healthModSpellBasePoints0 = int32(GetCaster()->CountPctFromMaxHealth(30)); GetCaster()->CastCustomSpell(GetCaster(), WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } |
