From c78b5644c7f1db51788b4bcf2c995433427db655 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sat, 6 Dec 2008 01:24:55 +0300 Subject: [PATCH] [6874] * Not remove spell mods for not finished spells * Ignore self miss in drop combopoints (problems vs 5171 and ranks still exist) * Allow cast spell on immune if spell can removeit by dispell --- src/game/Spell.cpp | 13 +++++++------ src/game/Unit.cpp | 3 ++- src/shared/revision_nr.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 895c585f3..7be354825 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2507,14 +2507,14 @@ void Spell::finish(bool ok) m_spellState = SPELL_STATE_FINISHED; - //remove spell mods - if (m_caster->GetTypeId() == TYPEID_PLAYER) - ((Player*)m_caster)->RemoveSpellMods(this); - // other code related only to successfully finished spells if(!ok) return; + //remove spell mods + if (m_caster->GetTypeId() == TYPEID_PLAYER) + ((Player*)m_caster)->RemoveSpellMods(this); + //handle SPELL_AURA_ADD_TARGET_TRIGGER auras Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER); for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) @@ -2553,10 +2553,11 @@ void Spell::finish(bool ok) // Clear combo at finish state if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo)) { - // Not drop combopoints if any miss exist + // Not drop combopoints if negative spell and if any miss on enemy exist bool needDrop = true; + if (!IsPositiveSpell(m_spellInfo->Id)) for(std::list::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit) - if (ihit->missCondition != SPELL_MISS_NONE) + if (ihit->missCondition != SPELL_MISS_NONE && ihit->targetGUID!=m_caster->GetGUID()) { needDrop = false; break; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f03c2469c..82e1c33ec 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8062,7 +8062,8 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges) if(itr->type == spellInfo->Dispel) return true; - if( !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE)) // unaffected by school immunity + if( !(spellInfo->AttributesEx & SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE) && // unaffected by school immunity + !(spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)) // can remove immune (by dispell or immune it) { // not have spells with charges currently SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 169735a48..1b521491b 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 "6873" + #define REVISION_NR "6874" #endif // __REVISION_NR_H__