*Do not proc anything for aura remove type = delete.

*Use delete type for duel complete.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-24 17:05:05 -06:00
parent 4d982bfca4
commit 40598d6647
5 changed files with 13 additions and 25 deletions
+2 -2
View File
@@ -6742,7 +6742,7 @@ void Player::DuelComplete(DuelCompleteType type)
} }
for(size_t i=0; i<auras2remove.size(); i++) for(size_t i=0; i<auras2remove.size(); i++)
duel->opponent->RemoveAurasDueToSpellByCancel(auras2remove[i]); duel->opponent->RemoveAurasByCasterSpell(auras2remove[i], GetGUID(), AURA_REMOVE_BY_DELETE);
auras2remove.clear(); auras2remove.clear();
AuraMap const& auras = GetAuras(); AuraMap const& auras = GetAuras();
@@ -6752,7 +6752,7 @@ void Player::DuelComplete(DuelCompleteType type)
auras2remove.push_back(i->second->GetId()); auras2remove.push_back(i->second->GetId());
} }
for(size_t i=0; i<auras2remove.size(); i++) for(size_t i=0; i<auras2remove.size(); i++)
RemoveAurasDueToSpellByCancel(auras2remove[i]); RemoveAurasByCasterSpell(auras2remove[i], duel->opponent->GetGUID(), AURA_REMOVE_BY_DELETE);
// cleanup combo points // cleanup combo points
if(GetComboTarget()==duel->opponent->GetGUID()) if(GetComboTarget()==duel->opponent->GetGUID())
+3 -3
View File
@@ -1022,10 +1022,10 @@ void Aura::_RemoveAura()
((Player*)caster)->SendCooldownEvent(GetSpellProto()); ((Player*)caster)->SendCooldownEvent(GetSpellProto());
} }
// overkill // not cancel, overkill
// do not proc anything if aura is cancelled // do not proc anything if aura is cancelled
//if(m_removeMode == AURA_REMOVE_BY_CANCEL) if(m_removeMode == AURA_REMOVE_BY_DELETE)
// return; return;
// Remove Linked Auras (on last aura remove) // Remove Linked Auras (on last aura remove)
uint32 id = GetId(); uint32 id = GetId();
+1 -1
View File
@@ -341,7 +341,7 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
} }
// non channeled case // non channeled case
_player->RemoveAurasDueToSpellByCancel(spellId); _player->RemoveAurasByCasterSpell(spellId, _player->GetGUID(), AURA_REMOVE_BY_CANCEL);
} }
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket) void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
+6 -17
View File
@@ -3843,7 +3843,7 @@ bool Unit::AddAura(Aura *Aur)
if(Aur->GetStackAmount() < aurSpellInfo->StackAmount) if(Aur->GetStackAmount() < aurSpellInfo->StackAmount)
Aur->InitStackAmount(Aur->GetStackAmount()+1); Aur->InitStackAmount(Aur->GetStackAmount()+1);
} }
RemoveAura(i2,AURA_REMOVE_BY_STACK); RemoveAura(i2,AURA_REMOVE_BY_DELETE);
i2=m_Auras.lower_bound(spair); i2=m_Auras.lower_bound(spair);
continue; continue;
} }
@@ -3863,7 +3863,7 @@ bool Unit::AddAura(Aura *Aur)
++i2; ++i2;
continue; continue;
} }
RemoveAura(i2,AURA_REMOVE_BY_STACK); RemoveAura(i2,AURA_REMOVE_BY_DELETE);
i2=m_Auras.lower_bound(spair); i2=m_Auras.lower_bound(spair);
continue; continue;
} }
@@ -3901,7 +3901,7 @@ bool Unit::AddAura(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 IsSingleTargetSpell", (*itr)->GetId(), (*itr)->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 IsSingleTargetSpell", (*itr)->GetId(), (*itr)->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex());
continue; continue;
} }
(*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_STACK); (*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_DELETE);
restart = true; restart = true;
break; break;
} }
@@ -3964,7 +3964,7 @@ void Unit::RemoveRankAurasDueToSpell(uint32 spellId)
{ {
if(iter->second->GetCasterGUID()==(*i).second->GetCasterGUID()) if(iter->second->GetCasterGUID()==(*i).second->GetCasterGUID())
{ {
RemoveAura(iter, AURA_REMOVE_BY_STACK); RemoveAura(iter, AURA_REMOVE_BY_DELETE);
iter = m_Auras.lower_bound(spair); iter = m_Auras.lower_bound(spair);
} }
else else
@@ -4090,7 +4090,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
{ {
if(iter->second->GetCasterGUID()==caster) if(iter->second->GetCasterGUID()==caster)
{ {
RemoveAura(iter, AURA_REMOVE_BY_STACK); RemoveAura(iter, AURA_REMOVE_BY_DELETE);
iter = m_Auras.lower_bound(spair); iter = m_Auras.lower_bound(spair);
} }
else else
@@ -4259,17 +4259,6 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
} }
} }
void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId)
{
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
{
if (iter->second->GetId() == spellId)
RemoveAura(iter, AURA_REMOVE_BY_CANCEL);
else
++iter;
}
}
void Unit::RemoveAurasWithDispelType( DispelType type ) void Unit::RemoveAurasWithDispelType( DispelType type )
{ {
// Create dispel mask by dispel type // Create dispel mask by dispel type
@@ -4336,7 +4325,7 @@ void Unit::RemoveNotOwnSingleTargetAuras()
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
{ {
if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto())) if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto()))
RemoveAura(iter, AURA_REMOVE_BY_STACK); RemoveAura(iter, AURA_REMOVE_BY_DELETE);
else else
++iter; ++iter;
} }
+1 -2
View File
@@ -328,7 +328,7 @@ enum DamageTypeToSchool
enum AuraRemoveMode enum AuraRemoveMode
{ {
AURA_REMOVE_BY_DEFAULT, AURA_REMOVE_BY_DEFAULT,
AURA_REMOVE_BY_STACK, // at replace by semillar aura (or single target aura remove) AURA_REMOVE_BY_DELETE, // change stack, single aura remove, duel complete
AURA_REMOVE_BY_CANCEL, AURA_REMOVE_BY_CANCEL,
AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
AURA_REMOVE_BY_DEATH AURA_REMOVE_BY_DEATH
@@ -1253,7 +1253,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler); void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer); void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasDueToSpellByCancel(uint32 spellId);
void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster); void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster);
void RemoveNotOwnSingleTargetAuras(); void RemoveNotOwnSingleTargetAuras();