diff options
author | megamage <none@none> | 2008-12-22 10:59:38 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-22 10:59:38 -0600 |
commit | 65ef38963ddc60e05491ca9d3e2685913c0038bb (patch) | |
tree | 740f287e537982028ac4b0974d4a88aeae9075d8 /src/game/Unit.cpp | |
parent | f7dd2df7955f5c5d17ee2ad27fb6c9a0f89d7196 (diff) |
*The last merge from Mangos TBC. Update to Mangos v0.12.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6541a098922..50691592983 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10274,8 +10274,12 @@ bool Unit::CanHaveThreatList() const if( !isAlive() ) return false; - // pets and totems can not have threat list - if( ((Creature*)this)->isPet() || ((Creature*)this)->isTotem() ) + // totems can not have threat list + if( ((Creature*)this)->isTotem() ) + return false; + + // pets can not have a threat list, unless they are controlled by a creature + if( ((Creature*)this)->isPet() && IS_PLAYER_GUID(((Pet*)this)->GetOwnerGUID()) ) return false; return true; @@ -10454,9 +10458,12 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde uint8 comboPoints = unitPlayer ? unitPlayer->GetComboPoints() : 0; - int32 level = int32(getLevel()) - int32(spellProto->spellLevel); - if (level > spellProto->maxLevel && spellProto->maxLevel > 0) - level = spellProto->maxLevel; + int32 level = int32(getLevel()); + if (level > (int32)spellProto->maxLevel && spellProto->maxLevel > 0) + level = (int32)spellProto->maxLevel; + else if (level < (int32)spellProto->baseLevel) + level = (int32)spellProto->baseLevel; + level-= (int32)spellProto->spellLevel; float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index]; float randomPointsPerLevel = spellProto->EffectDicePerLevel[effect_index]; |