mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +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
|
|
@ -3008,6 +3008,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled)
|
||||||
|
|
||||||
for(SpellLearnSpellMap::const_iterator itr2 = spell_begin; itr2 != spell_end; ++itr2)
|
for(SpellLearnSpellMap::const_iterator itr2 = spell_begin; itr2 != spell_end; ++itr2)
|
||||||
removeSpell(itr2->second.spell, disabled);
|
removeSpell(itr2->second.spell, disabled);
|
||||||
|
|
||||||
|
// TODO: recast if need lesser ranks spell for passive with IsPassiveSpellStackableWithRanks
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::RemoveArenaSpellCooldowns()
|
void Player::RemoveArenaSpellCooldowns()
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,15 @@ int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, ui
|
||||||
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2);
|
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2);
|
||||||
bool IsPassiveSpell(uint32 spellId);
|
bool IsPassiveSpell(uint32 spellId);
|
||||||
|
|
||||||
|
inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
|
||||||
|
{
|
||||||
|
if(!IsPassiveSpell(spellProto->Id))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return !IsSpellHaveEffect(spellProto,SPELL_EFFECT_APPLY_AURA);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
|
inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo)
|
||||||
{
|
{
|
||||||
switch(spellInfo->Id)
|
switch(spellInfo->Id)
|
||||||
|
|
|
||||||
|
|
@ -68,20 +68,6 @@ static bool isNonTriggerAura[TOTAL_AURAS];
|
||||||
// Prepare lists
|
// Prepare lists
|
||||||
static bool procPrepared = InitTriggerAuraData();
|
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()
|
Unit::Unit()
|
||||||
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
|
: 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)
|
// passive auras not stacable with other ranks
|
||||||
if ((!Aur->IsPassive() || !IsPassiveStackableSpell(Aur->GetId())) &&
|
if (!IsPassiveSpellStackableWithRanks(aurSpellInfo))
|
||||||
!(Aur->GetId() == 20584 || Aur->GetId() == 8326))
|
|
||||||
{
|
{
|
||||||
if (!RemoveNoStackAurasDueToAura(Aur))
|
if (!RemoveNoStackAurasDueToAura(Aur))
|
||||||
{
|
{
|
||||||
|
|
@ -3353,6 +3338,14 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 spellId = Aur->GetId();
|
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();
|
uint32 effIndex = Aur->GetEffIndex();
|
||||||
|
|
||||||
SpellSpecific spellId_spec = GetSpellSpecific(spellId);
|
SpellSpecific spellId_spec = GetSpellSpecific(spellId);
|
||||||
|
|
@ -3371,9 +3364,11 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
|
||||||
|
|
||||||
uint32 i_spellId = i_spellProto->Id;
|
uint32 i_spellId = i_spellProto->Id;
|
||||||
|
|
||||||
|
// early checks that spellId is passive non stackable spell
|
||||||
if(IsPassiveSpell(i_spellId))
|
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;
|
continue;
|
||||||
|
|
||||||
// passive non-stackable spells not stackable only with another rank of same spell
|
// passive non-stackable spells not stackable only with another rank of same spell
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6991"
|
#define REVISION_NR "6992"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue