aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Pet.cpp2
-rw-r--r--src/game/SpellAuras.cpp8
-rw-r--r--src/game/StatSystem.cpp15
-rw-r--r--src/game/Unit.cpp12
4 files changed, 31 insertions, 6 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 8920647968c..6275bd8a75b 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -1352,7 +1352,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel
m_spells[spell_id] = newspell;
- if (IsPassiveSpell(spell_id))
+ if (IsPassiveSpell(spell_id) && (!spellInfo->CasterAuraState || HasAuraState(AuraState(spellInfo->CasterAuraState))))
CastSpell(this, spell_id, true);
else
m_charmInfo->AddSpellToActionBar(spell_id);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 876526b555e..a7e1725216b 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5227,10 +5227,8 @@ void AuraEffect::HandleModCombatSpeedPct(bool apply, bool Real, bool /*changeAmo
void AuraEffect::HandleModAttackSpeed(bool apply, bool Real, bool /*changeAmount*/)
{
- if(!m_target->isAlive() )
- return;
-
m_target->ApplyAttackTimePercentMod(BASE_ATTACK,m_amount,apply);
+ m_target->UpdateDamagePhysical(BASE_ATTACK);
}
void AuraEffect::HandleHaste(bool apply, bool Real, bool /*changeAmount*/)
@@ -6626,12 +6624,12 @@ void AuraEffect::PeriodicDummyTick()
{
// Feeding Frenzy Rank 1
case 53511:
- if ( m_target->GetHealth() * 100 < m_target->GetMaxHealth() * 35 )
+ if ( m_target->getVictim() && m_target->getVictim()->GetHealth() * 100 < m_target->getVictim()->GetMaxHealth() * 35 )
m_target->CastSpell(m_target, 60096, true, 0, this);
return;
// Feeding Frenzy Rank 2
case 53512:
- if ( m_target->GetHealth() * 100 < m_target->GetMaxHealth() * 35 )
+ if ( m_target->getVictim() && m_target->getVictim()->GetHealth() * 100 < m_target->getVictim()->GetMaxHealth() * 35 )
m_target->CastSpell(m_target, 60097, true, 0, this);
return;
default:
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index afda92829a3..7a57f62d416 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -1174,6 +1174,21 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType)
}
}
+ Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_MOD_ATTACKSPEED);
+ for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
+ {
+ switch ((*itr)->GetSpellProto()->Id)
+ {
+ case 61682:
+ case 61683:
+ mindamage = mindamage * (100.0f-float((*itr)->GetAmount()))/100.0f;
+ maxdamage = maxdamage * (100.0f-float((*itr)->GetAmount()))/100.0f;
+ break;
+ default:
+ break;
+ }
+ }
+
SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage);
SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage);
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 1bf919b133f..e63a0c5cf6d 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8446,6 +8446,18 @@ void Unit::ModifyAuraState(AuraState flag, bool apply)
CastSpell(this, itr->first, true, NULL);
}
}
+ else if (((Creature*)this)->isPet())
+ {
+ Pet *pet = ((Pet*)this);
+ for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
+ {
+ if(itr->second.state == PLAYERSPELL_REMOVED) continue;
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first);
+ if (!spellInfo || !IsPassiveSpell(itr->first)) continue;
+ if (spellInfo->CasterAuraState == flag)
+ CastSpell(this, itr->first, true, NULL);
+ }
+ }
}
}
else