diff options
author | azazel <none@none> | 2010-08-26 15:54:56 +0600 |
---|---|---|
committer | azazel <none@none> | 2010-08-26 15:54:56 +0600 |
commit | 5fa14f58dceb3be78a5964c09eb17dc358c10c7b (patch) | |
tree | 1c7b2c1d7f19ca7d56a602b023a1d3b724f2e72c /src/server/game/Spells/SpellEffects.cpp | |
parent | 6036166716d2d2cdfa0f5c27f8cfb7e1e65b0c8f (diff) |
Core/Cleanup:
* move repeating code into separate method for storing locale strings in ObjectMgr (copy/paste sucks, you know)
* fix 'signed/unsigned' warnings (at least in VS)
* fix some other warnings and cleanup relative code
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 29a51df0caf..7bd4924c8a6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -552,7 +552,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) if (AuraEffect * aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0)) back_damage -= aurEff->GetAmount() * back_damage / 100; - if (back_damage < unitTarget->GetHealth()) + if (back_damage < int32(unitTarget->GetHealth())) m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true); } // Mind Blast - applies Mind Trauma if: @@ -1615,7 +1615,7 @@ void Spell::EffectDummy(uint32 i) Unit::AttackerSet attackers = unitTarget->getAttackers(); // selected from list 3 - for (int i = 0; i < std::min(size_t(3),attackers.size()); ++i) + for (uint32 i = 0; i < std::min(size_t(3), attackers.size()); ++i) { Unit::AttackerSet::iterator aItr = attackers.begin(); std::advance(aItr, rand() % attackers.size()); @@ -1968,7 +1968,7 @@ void Spell::EffectTriggerSpell(uint32 effIndex) if (!spell) return; - for (int j=0; j < spell->StackAmount; ++j) + for (uint32 j = 0; j < spell->StackAmount; ++j) m_caster->CastSpell(unitTarget, spell->Id, true); return; } @@ -1980,7 +1980,7 @@ void Spell::EffectTriggerSpell(uint32 effIndex) if (!spell) return; - for (int j=0; j < spell->StackAmount; ++j) + for (uint32 j = 0; j < spell->StackAmount; ++j) m_caster->CastSpell(unitTarget, spell->Id, true); return; } @@ -2421,14 +2421,14 @@ void Spell::EffectPowerBurn(uint32 i) // burn x% of target's mana, up to maximum of 2x% of caster's mana (Mana Burn) if (m_spellInfo->ManaCostPercentage) { - uint32 maxdamage = m_caster->GetMaxPower(powertype) * damage * 2 / 100; + int32 maxdamage = m_caster->GetMaxPower(powertype) * damage * 2 / 100; damage = unitTarget->GetMaxPower(powertype) * damage / 100; if (damage > maxdamage) damage = maxdamage; } int32 curPower = int32(unitTarget->GetPower(powertype)); - uint32 power = damage; + int32 power = damage; // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) if (powertype == POWER_MANA) power -= unitTarget->GetSpellCritDamageReduction(power); @@ -2632,10 +2632,11 @@ void Spell::EffectHealthLeech(uint32 i) if (m_spellInfo->SpellFamilyFlags[0] & 0x80000) new_damage = damage; else - new_damage = int32(damage*multiplier); + new_damage = int32(damage * multiplier); + uint32 curHealth = unitTarget->GetHealth(); new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage); - if (curHealth < new_damage) + if (int32(curHealth) < new_damage) new_damage = curHealth; if (m_caster->isAlive()) @@ -3359,7 +3360,7 @@ void Spell::EffectSummonType(uint32 i) { float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); - int32 amount = damage > 0 ? damage : 1; + uint32 amount = damage > 0 ? damage : 1; if (m_spellInfo->Id == 18662) // Curse of Doom amount = 1; @@ -7093,7 +7094,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const * //float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); float radius = 5.0f; - int32 amount = damage > 0 ? damage : 1; + uint32 amount = damage > 0 ? damage : 1; int32 duration = GetSpellDuration(m_spellInfo); switch (m_spellInfo->Id) { |