mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7500] Not allow stacking some auras at target from different casters.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
ebd292a226
commit
610a040240
4 changed files with 37 additions and 3 deletions
|
|
@ -222,7 +222,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
|
||||||
return SPELL_NORMAL;
|
return SPELL_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2)
|
bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific spellSpec2)
|
||||||
{
|
{
|
||||||
switch(spellSpec1)
|
switch(spellSpec1)
|
||||||
{
|
{
|
||||||
|
|
@ -255,6 +255,19 @@ bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsSingleFromSpellSpecificRanksPerTarget(SpellSpecific spellId_spec, SpellSpecific i_spellId_spec)
|
||||||
|
{
|
||||||
|
switch(spellId_spec)
|
||||||
|
{
|
||||||
|
case SPELL_BLESSING:
|
||||||
|
case SPELL_AURA:
|
||||||
|
case SPELL_CURSE:
|
||||||
|
return spellId_spec==i_spellId_spec;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
bool IsPositiveTarget(uint32 targetA, uint32 targetB)
|
||||||
{
|
{
|
||||||
// non-positive targets
|
// non-positive targets
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,8 @@ inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
|
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
|
||||||
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2);
|
bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific spellSpec2);
|
||||||
|
bool IsSingleFromSpellSpecificRanksPerTarget(SpellSpecific spellId_spec, SpellSpecific i_spellId_spec);
|
||||||
bool IsPassiveSpell(uint32 spellId);
|
bool IsPassiveSpell(uint32 spellId);
|
||||||
|
|
||||||
inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
|
inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
|
||||||
|
|
|
||||||
|
|
@ -3561,6 +3561,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||||
SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);
|
SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);
|
||||||
|
|
||||||
bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
|
bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
|
||||||
|
bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellId_spec,i_spellId_spec);
|
||||||
|
|
||||||
if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
|
if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
|
||||||
{
|
{
|
||||||
|
|
@ -3582,6 +3583,25 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||||
else
|
else
|
||||||
next = m_Auras.begin();
|
next = m_Auras.begin();
|
||||||
}
|
}
|
||||||
|
else if( is_sspt && Aur->GetCasterGUID() != (*i).second->GetCasterGUID() && spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId) )
|
||||||
|
{
|
||||||
|
// cannot remove higher rank
|
||||||
|
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Its a parent aura (create this aura in ApplyModifier)
|
||||||
|
if ((*i).second->IsInUse())
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
RemoveAurasDueToSpell(i_spellId);
|
||||||
|
|
||||||
|
if( m_Auras.empty() )
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
next = m_Auras.begin();
|
||||||
|
}
|
||||||
else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
|
else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
|
||||||
{
|
{
|
||||||
// Its a parent aura (create this aura in ApplyModifier)
|
// Its a parent aura (create this aura in ApplyModifier)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7499"
|
#define REVISION_NR "7500"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue