3898 | | SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId); |
3899 | | |
3900 | | bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec); |
3901 | | |
3902 | | if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() ) |
3903 | | { |
3904 | | // cannot remove higher rank |
3905 | | if (spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) |
3906 | | if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0) |
3907 | | return false; |
| 3898 | bool sameCaster = Aur->GetCasterGUID() == (*i).second->GetCasterGUID(); |
| 3899 | if( spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId, sameCaster) ) |
| 3900 | { |
| 3901 | //some spells should be not removed by lower rank of them |
| 3902 | // what is this spell? |
| 3903 | if (!sameCaster |
| 3904 | &&(spellProto->Effect[effIndex]==SPELL_EFFECT_APPLY_AREA_AURA_PARTY) |
| 3905 | &&(spellProto->DurationIndex==21) |
| 3906 | &&(spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) |
| 3907 | &&(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)) |
| 3908 | return false; |
3921 | | } |
3922 | | else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) ) |
3923 | | { |
3924 | | // Its a parent aura (create this aura in ApplyModifier) |
3925 | | if ((*i).second->IsInUse()) |
3926 | | { |
3927 | | sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex()); |
3928 | | continue; |
3929 | | } |
3930 | | RemoveAurasDueToSpell(i_spellId); |
3931 | | |
3932 | | if( m_Auras.empty() ) |
3933 | | break; |
3934 | | else |
3935 | | next = m_Auras.begin(); |
3936 | | } |
3937 | | // Potions stack aura by aura (elixirs/flask already checked) |
3938 | | else if( spellProto->SpellFamilyName == SPELLFAMILY_POTION && i_spellProto->SpellFamilyName == SPELLFAMILY_POTION ) |
3939 | | { |
3940 | | if (IsNoStackAuraDueToAura(spellId, effIndex, i_spellId, i_effIndex)) |
3941 | | { |
3942 | | if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0) |
3943 | | return false; // cannot remove higher rank |
3944 | | |
3945 | | // Its a parent aura (create this aura in ApplyModifier) |
3946 | | if ((*i).second->IsInUse()) |
3947 | | { |
3948 | | sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex()); |
3949 | | continue; |
3950 | | } |
3951 | | RemoveAura(i); |
3952 | | next = i; |
3953 | | } |