[7188] Drop now unneeded hack code.

This commit is contained in:
VladimirMangos 2009-01-26 20:01:19 +03:00
parent de277ad917
commit d4ce99dfa2
2 changed files with 46 additions and 77 deletions

View file

@ -3535,50 +3535,56 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
for(int j = 0; j < 3; ++j) for(int j = 0; j < 3; ++j)
if (i_spellProto->EffectTriggerSpell[j] == spellProto->Id) if (i_spellProto->EffectTriggerSpell[j] == spellProto->Id)
is_triggered_by_spell = true; is_triggered_by_spell = true;
if (is_triggered_by_spell) continue;
for(int j = 0; j < 3; ++j) if (is_triggered_by_spell)
continue;
SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);
bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
{ {
// prevent remove dummy triggered spells at next effect aura add // cannot remove higher rank
switch(spellProto->Effect[j]) // main spell auras added added after triggered spell if (spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId))
{ if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
case SPELL_EFFECT_DUMMY: return false;
switch(spellId)
{
case 5420: if(i_spellId==34123) is_triggered_by_spell = true; break;
}
break;
}
if(is_triggered_by_spell) // Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
{
sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue;
}
RemoveAurasDueToSpell(i_spellId);
if( m_Auras.empty() )
break; break;
else
// prevent remove form main spell by triggered passive spells next = m_Auras.begin();
switch(i_spellProto->EffectApplyAuraName[j]) // main aura added before triggered spell
{
case SPELL_AURA_MOD_SHAPESHIFT:
switch(i_spellId)
{
case 24858: if(spellId==24905) is_triggered_by_spell = true; break;
case 33891: if(spellId==5420 || spellId==34123) is_triggered_by_spell = true; break;
case 34551: if(spellId==22688) is_triggered_by_spell = true; break;
}
break;
}
} }
else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
if(!is_triggered_by_spell)
{ {
SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId); // Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
{ {
// cannot remove higher rank sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
if (spellmgr.IsRankSpellDueToSpell(spellProto, i_spellId)) continue;
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0) }
return false; RemoveAurasDueToSpell(i_spellId);
if( m_Auras.empty() )
break;
else
next = m_Auras.begin();
}
// Potions stack aura by aura (elixirs/flask already checked)
else if( spellProto->SpellFamilyName == SPELLFAMILY_POTION && i_spellProto->SpellFamilyName == SPELLFAMILY_POTION )
{
if (IsNoStackAuraDueToAura(spellId, effIndex, i_spellId, i_effIndex))
{
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
return false; // cannot remove higher rank
// Its a parent aura (create this aura in ApplyModifier) // Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse()) if ((*i).second->IsInUse())
@ -3586,45 +3592,8 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex()); sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue; continue;
} }
RemoveAurasDueToSpell(i_spellId); RemoveAura(i);
next = i;
if( m_Auras.empty() )
break;
else
next = m_Auras.begin();
}
else if( !is_sspc && spellmgr.IsNoStackSpellDueToSpell(spellId, i_spellId) )
{
// Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
{
sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue;
}
RemoveAurasDueToSpell(i_spellId);
if( m_Auras.empty() )
break;
else
next = m_Auras.begin();
}
// Potions stack aura by aura (elixirs/flask already checked)
else if( spellProto->SpellFamilyName == SPELLFAMILY_POTION && i_spellProto->SpellFamilyName == SPELLFAMILY_POTION )
{
if (IsNoStackAuraDueToAura(spellId, effIndex, i_spellId, i_effIndex))
{
if(CompareAuraRanks(spellId, effIndex, i_spellId, i_effIndex) < 0)
return false; // cannot remove higher rank
// Its a parent aura (create this aura in ApplyModifier)
if ((*i).second->IsInUse())
{
sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for Unit::RemoveNoStackAurasDueToAura", i->second->GetId(), i->second->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue;
}
RemoveAura(i);
next = i;
}
} }
} }
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7187" #define REVISION_NR "7188"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__