*Fix blood frenzy remove (and possibly some other SPELL_AURA_ADD_TARGET_TRIGGER auras too).

*Fix some problems with Cut to the Chase.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2009-03-22 16:24:53 +01:00
1 parent f4d3a583bd
commit a0530658ff
5 files changed
+60 -15

No files matched your search

+32 -2
View File
@@ -4151,6 +4151,37 @@ void Unit::RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID)
}
}
void Unit::SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration)
{
for(uint8 i = 0; i < 3; ++i)
{
spellEffectPair spair = spellEffectPair(spellId, i);
for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
{
if(itr->second->GetCasterGUID()==casterGUID)
{
itr->second->SetAuraDuration(duration);
break;
}
}
}
}
Aura* Unit::GetAuraByCasterSpell(uint32 spellId, uint64 casterGUID)
{
// Returns first found aura from spell-use only in cases where effindex of spell doesn't matter!
for(uint8 i = 0; i < 3; ++i)
{
spellEffectPair spair = spellEffectPair(spellId, i);
for(AuraMap::const_iterator itr = GetAuras().lower_bound(spair); itr != GetAuras().upper_bound(spair); ++itr)
{
if(itr->second->GetCasterGUID()==casterGUID)
return itr->second;
}
}
return NULL;
}
void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler)
{
for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); )
@@ -5996,8 +6027,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if( spellProto->SpellFamilyName == SPELLFAMILY_ROGUE &&
spellProto->SpellFamilyFlags[0] & 0x40000)
{
(*itr)->SetAuraMaxDuration(GetSpellMaxDuration(spellProto));
(*itr)->RefreshAura();
RefreshAurasByCasterSpell(spellProto->Id, GetGUID());
return true;
}
}