diff options
author | Kudlaty <none@none> | 2009-10-31 01:50:52 +0100 |
---|---|---|
committer | Kudlaty <none@none> | 2009-10-31 01:50:52 +0100 |
commit | 98d53f6a9d32462283cac9e43d31f8a0c132c53b (patch) | |
tree | 46e938328f91125b38dcbf6b49a553c18f93e35e /src | |
parent | a5937d9d13f5071c1b54dc1c3fa9530a2494e778 (diff) |
Fix Feeding Frenzy, Cobra Reflexes, Cornered. Now they are active only when victim hp is below certain percentage. Patch by thenecromancer, updated by krz
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Pet.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 8 | ||||
-rw-r--r-- | src/game/StatSystem.cpp | 15 | ||||
-rw-r--r-- | src/game/Unit.cpp | 12 |
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 |