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
This commit is contained in:
Kudlaty
2009-10-31 01:50:52 +01:00
parent a5937d9d13
commit 98d53f6a9d
4 changed files with 31 additions and 6 deletions
+1 -1
View File
@@ -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);
+3 -5
View File
@@ -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:
+15
View File
@@ -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);
}
+12
View File
@@ -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