mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10075] Attempt use more expected by result buffs downranking algo.
* In small rate more fast * Not affect non-buff ranked spells like 10909
This commit is contained in:
parent
07a931e141
commit
81851074ad
6 changed files with 45 additions and 31 deletions
|
|
@ -4253,21 +4253,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
|
||||
// auto selection spell rank implemented in WorldSession::HandleCastSpellOpcode
|
||||
// this case can be triggered if rank not found (too low-level target for first rank)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !IsPassiveSpell(m_spellInfo) && !m_CastItem)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && !m_CastItem && !m_IsTriggeredSpell)
|
||||
{
|
||||
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
// check only spell that apply positive auras
|
||||
if (m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA &&
|
||||
IsPositiveEffect(m_spellInfo->Id, SpellEffectIndex(i)) &&
|
||||
// at not self target
|
||||
!IsCasterSourceTarget(m_spellInfo->EffectImplicitTargetA[i]) &&
|
||||
// and target low level
|
||||
target->getLevel() + 10 < m_spellInfo->spellLevel)
|
||||
{
|
||||
return SPELL_FAILED_LOWLEVEL;
|
||||
}
|
||||
}
|
||||
// spell expected to be auto-downranking in cast handle, so must be same
|
||||
if (m_spellInfo != sSpellMgr.SelectAuraRankForLevel(m_spellInfo, target->getLevel()))
|
||||
return SPELL_FAILED_LOWLEVEL;
|
||||
}
|
||||
}
|
||||
else if (m_caster == target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue