diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 465634e0347..be6b9e6bec6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1418,7 +1418,10 @@ void Aura::HandleAddModifier(bool apply, bool Real) mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32; mod->mask2= (uint64)ptr[2]; - mod->charges = m_procCharges; + + // prevent expire spell mods with (charges > 0 && m_stackAmount > 1) + // all this spell expected expire not at use but at spell proc event check + mod->charges = m_spellProto->StackAmount > 1 ? 0 : m_procCharges; m_spellmod = mod; } @@ -2236,50 +2239,51 @@ void Aura::HandleAuraDummy(bool apply, bool Real) // AT APPLY if(apply) { - switch(GetId()) + switch(m_spellProto->SpellFamilyName) { - case 1515: // Tame beast - // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness - if (m_target->CanHaveThreatList()) - if (Unit* caster = GetCaster()) - m_target->AddThreat(caster, 10.0f, false, GetSpellSchoolMask(GetSpellProto()), GetSpellProto()); - return; - case 13139: // net-o-matic - // root to self part of (root_target->charge->root_self sequence - if (Unit* caster = GetCaster()) - caster->CastSpell(caster, 13138, true, NULL, this); - return; - case 39850: // Rocket Blast - if(roll_chance_i(20)) // backfire stun - m_target->CastSpell(m_target, 51581, true, NULL, this); - return; - case 43873: // Headless Horseman Laugh - m_target->PlayDistanceSound(11965); - return; - case 46354: // Blood Elf Illusion - if (Unit* caster = GetCaster()) + case SPELLFAMILY_GENERIC: + switch(GetId()) { - switch(caster->getGender()) - { - case GENDER_FEMALE: - caster->CastSpell(m_target, 46356, true, NULL, this); - break; - case GENDER_MALE: - caster->CastSpell(m_target, 46355, true, NULL, this); - break; - default: - break; - } + case 1515: // Tame beast + // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness + if (m_target->CanHaveThreatList()) + if (Unit* caster = GetCaster()) + m_target->AddThreat(caster, 10.0f, false, GetSpellSchoolMask(GetSpellProto()), GetSpellProto()); + return; + case 13139: // net-o-matic + // root to self part of (root_target->charge->root_self sequence + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, 13138, true, NULL, this); + return; + case 39850: // Rocket Blast + if(roll_chance_i(20)) // backfire stun + m_target->CastSpell(m_target, 51581, true, NULL, this); + return; + case 43873: // Headless Horseman Laugh + m_target->PlayDistanceSound(11965); + return; + case 46354: // Blood Elf Illusion + if (Unit* caster = GetCaster()) + { + switch(caster->getGender()) + { + case GENDER_FEMALE: + caster->CastSpell(m_target, 46356, true, NULL, this); + break; + case GENDER_MALE: + caster->CastSpell(m_target, 46355, true, NULL, this); + break; + default: + break; + } + } + return; + case 46699: // Requires No Ammo + if(m_target->GetTypeId() == TYPEID_PLAYER) + ((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use + return; } - return; - case 46699: // Requires No Ammo - if(m_target->GetTypeId() == TYPEID_PLAYER) - ((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use - return; - } - - switch(m_spellProto->SpellFamilyName) - { + break; case SPELLFAMILY_WARRIOR: // Overpower if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) @@ -2317,7 +2321,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) break; case SPELLFAMILY_SHAMAN: // Earth Shield - if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000))) + else if ((GetSpellProto()->SpellFamilyFlags & UI64LIT(0x40000000000))) { // prevent double apply bonuses if(m_target->GetTypeId() != TYPEID_PLAYER || !((Player*)m_target)->GetSession()->PlayerLoading()) diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 0695271e7fc..8e573d4988a 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -268,6 +268,13 @@ class MANGOS_DLL_SPEC Aura { if (m_procCharges == 0) return false; + + // exist spells that have maxStack > 1 and m_procCharges > 0 (==1 in fact) + // all like stacks have 1 value in one from this fields + // so return true for allow remove one aura from stacks as expired + if (GetStackAmount() > 1) + return true; + m_procCharges--; SendAuraUpdate(false); return m_procCharges == 0; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2000aa1f66f..c734dfa02a2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6471,7 +6471,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu uint32 spell = (*itr)->GetSpellProto()->EffectTriggerSpell[(*itr)->GetEffIndex()]; CastSpell(this, spell, true, castItem, triggeredByAura); if ((*itr)->DropAuraCharge()) - RemoveAurasDueToSpell((*itr)->GetId()); + RemoveSingleSpellAurasFromStack((*itr)->GetId()); return true; } } @@ -6573,7 +6573,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu } CastSpell(target, spell, true, castItem, triggeredByAura); if ((*itr)->DropAuraCharge()) - RemoveAurasDueToSpell((*itr)->GetId()); + RemoveSingleSpellAurasFromStack((*itr)->GetId()); return true; } } @@ -12039,7 +12039,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag removedSpells.unique(); // Remove auras from removedAuras for(RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end();++i) - RemoveAurasDueToSpell(*i); + RemoveSingleSpellAurasFromStack(*i); } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d028d4d8eca..14633a1661b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8948" + #define REVISION_NR "8949" #endif // __REVISION_NR_H__