aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-18 14:17:11 +0200
committerQAston <none@none>2009-06-18 14:17:11 +0200
commit30d0b2ed5fd5eaf345f720bb1911946f5028be8a (patch)
tree4e9e5bd1ab5a3294ad0fccc2a2b238f033cfe29d /src/game/Unit.cpp
parent56620e0962c7f8bb42d9f9666e9ec6c33b4ab273 (diff)
*Fix raise dead spell - original patch by Astellar, thanks for some help in conversion for Azrael
*Correctly apply spell cooldown for spells with cooldown starting after pet unsummon. --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp28
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()))