mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[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
This commit is contained in:
parent
d00a453863
commit
d3b4b341a0
3 changed files with 10 additions and 8 deletions
|
|
@ -2483,14 +2483,14 @@ void Spell::finish(bool ok)
|
||||||
|
|
||||||
m_spellState = SPELL_STATE_FINISHED;
|
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
|
// other code related only to successfully finished spells
|
||||||
if(!ok)
|
if(!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//remove spell mods
|
||||||
|
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
((Player*)m_caster)->RemoveSpellMods(this);
|
||||||
|
|
||||||
//handle SPELL_AURA_ADD_TARGET_TRIGGER auras
|
//handle SPELL_AURA_ADD_TARGET_TRIGGER auras
|
||||||
Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
|
Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
|
||||||
for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
|
for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
|
||||||
|
|
@ -2529,10 +2529,11 @@ void Spell::finish(bool ok)
|
||||||
// Clear combo at finish state
|
// Clear combo at finish state
|
||||||
if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo))
|
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;
|
bool needDrop = true;
|
||||||
|
if (!IsPositiveSpell(m_spellInfo->Id))
|
||||||
for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit)
|
for(std::list<TargetInfo>::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;
|
needDrop = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -8017,7 +8017,8 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo, bool useCharges)
|
||||||
if(itr->type == spellInfo->Dispel)
|
if(itr->type == spellInfo->Dispel)
|
||||||
return true;
|
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
|
// not have spells with charges currently
|
||||||
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6873"
|
#define REVISION_NR "6874"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue