mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[6992] More strong checking to prevent stacking passive auras. This fix unexpected statking 16252 and ranks.
Also this checking will prevent staking talent ranks if it will casted at character by some reason in any cases. TODO: non-talent passive spells like 16252 or 31785 with ranks still as before not reapplied in lesser rank form if higher rank unlearned. But this possible only at .unlearn command use and required re-loginning for activation lesser rank spell.
This commit is contained in:
parent
321ea2d9b6
commit
695a630cf3
4 changed files with 25 additions and 19 deletions
|
|
@ -68,20 +68,6 @@ static bool isNonTriggerAura[TOTAL_AURAS];
|
|||
// Prepare lists
|
||||
static bool procPrepared = InitTriggerAuraData();
|
||||
|
||||
bool IsPassiveStackableSpell( uint32 spellId )
|
||||
{
|
||||
if(!IsPassiveSpell(spellId))
|
||||
return false;
|
||||
|
||||
SpellEntry const* spellProto = sSpellStore.LookupEntry(spellId);
|
||||
if(!spellProto)
|
||||
return false;
|
||||
if (spellProto->procFlags)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Unit::Unit()
|
||||
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
|
||||
{
|
||||
|
|
@ -3256,9 +3242,8 @@ bool Unit::AddAura(Aura *Aur)
|
|||
}
|
||||
}
|
||||
|
||||
// passive auras stack with all (except passive spell proc auras)
|
||||
if ((!Aur->IsPassive() || !IsPassiveStackableSpell(Aur->GetId())) &&
|
||||
!(Aur->GetId() == 20584 || Aur->GetId() == 8326))
|
||||
// passive auras not stacable with other ranks
|
||||
if (!IsPassiveSpellStackableWithRanks(aurSpellInfo))
|
||||
{
|
||||
if (!RemoveNoStackAurasDueToAura(Aur))
|
||||
{
|
||||
|
|
@ -3353,6 +3338,14 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
|||
return false;
|
||||
|
||||
uint32 spellId = Aur->GetId();
|
||||
|
||||
// passive spell special case (only non stackable with ranks)
|
||||
if(IsPassiveSpell(spellId))
|
||||
{
|
||||
if(IsPassiveSpellStackableWithRanks(spellProto))
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 effIndex = Aur->GetEffIndex();
|
||||
|
||||
SpellSpecific spellId_spec = GetSpellSpecific(spellId);
|
||||
|
|
@ -3371,9 +3364,11 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
|||
|
||||
uint32 i_spellId = i_spellProto->Id;
|
||||
|
||||
// early checks that spellId is passive non stackable spell
|
||||
if(IsPassiveSpell(i_spellId))
|
||||
{
|
||||
if(IsPassiveStackableSpell(i_spellId))
|
||||
// passive non-stackable spells not stackable only for same caster
|
||||
if(Aur->GetCasterGUID()!=i->second->GetCasterGUID())
|
||||
continue;
|
||||
|
||||
// passive non-stackable spells not stackable only with another rank of same spell
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue