diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 037c00fcff2..b3e113ff6fb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1821,7 +1821,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellEnt // Apply Player CR_ARMOR_PENETRATION rating if (GetTypeId()==TYPEID_PLAYER) - armor *= 1.0f - ((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f; + armor *= 1.0f - (((Player*)this)->GetRatingBonusValue(CR_ARMOR_PENETRATION) / 100.0f); if (armor < 0.0f) armor=0.0f; @@ -8685,6 +8685,22 @@ void Unit::SetMinion(Minion *minion, bool apply) if(GetTypeId() == TYPEID_PLAYER && minion->HasSummonMask(SUMMON_MASK_PET)) for(int i = 0; i < MAX_MOVE_TYPE; ++i) minion->SetSpeed(UnitMoveType(i), m_speed_rate[i], true); + + // Ghoul pets have energy instead of mana (is anywhere better place for this code?) + if (minion->IsPetGhoul()) + { + minion->setPowerType(POWER_ENERGY); + } + + if (GetTypeId() == TYPEID_PLAYER) + { + // Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again + SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL)); + if (spellInfo && (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)) + { + ((Player*)this)->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL ,true); + } + } } else { @@ -8702,6 +8718,16 @@ void Unit::SetMinion(Minion *minion, bool apply) SetPetGUID(0); } + if (GetTypeId() == TYPEID_PLAYER) + { + SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL)); + // Remove infinity cooldown + if (spellInfo && (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)) + { + ((Player*)this)->SendCooldownEvent(spellInfo); + } + } + //if(minion->HasSummonMask(SUMMON_MASK_GUARDIAN)) { if(RemoveUInt64Value(UNIT_FIELD_SUMMON, minion->GetGUID())) |