[7029] Some work vs aura charges

Move to protected: need use SetAuraCharges, GetAuraCharges, DropAuraCharge
Now m_procCharges == 0 if infinite charges, and > 0 for limit
Remove not need UpdateAuraCharges()

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-05 04:08:40 +03:00
parent 791c54dd0b
commit daf24ce90c
6 changed files with 43 additions and 49 deletions

View file

@ -415,15 +415,9 @@ m_periodicTimer(0), m_PeriodicEventId(0), m_AuraDRGroup(DIMINISHING_NONE)
m_isDeathPersist = IsDeathPersistentSpell(m_spellProto);
if(m_spellProto->procCharges)
{
m_procCharges = m_spellProto->procCharges;
if(modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
}
else
m_procCharges = -1;
m_procCharges = m_spellProto->procCharges;
if(modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, m_procCharges);
m_isRemovedOnShapeLost = (m_caster_guid==m_target->GetGUID() && m_spellProto->Stances &&
!(m_spellProto->AttributesEx2 & 0x80000) && !(m_spellProto->Attributes & 0x10000));
@ -971,7 +965,6 @@ void Aura::_AddAura()
SetAura(false);
SetAuraFlags((1 << GetEffIndex()) | AFLAG_NOT_CASTER | ((GetAuraMaxDuration() > 0) ? AFLAG_DURATION : AFLAG_NONE) | (IsPositive() ? AFLAG_POSITIVE : AFLAG_NEGATIVE));
SetAuraLevel(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
UpdateAuraCharges();
SendAuraUpdate(false);
// update for out of range group members
@ -1124,7 +1117,7 @@ void Aura::SendAuraUpdate(bool remove)
uint8 auraFlags = GetAuraFlags();
data << uint8(auraFlags);
data << uint8(GetAuraLevel());
data << uint8(m_procCharges >= 0 ? m_procCharges : 0);
data << uint8(GetAuraCharges());
if(!(auraFlags & AFLAG_NOT_CASTER))
{
@ -1208,7 +1201,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
case 34754: // Clearcasting
case 34936: // Backlash
case 48108: // Hot Streak
m_procCharges = 1;
SetAuraCharges(1);
break;
}
@ -1236,11 +1229,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
mod->mask = (uint64)ptr[0] | (uint64)ptr[1]<<32;
mod->mask2= (uint64)ptr[2];
if (m_procCharges > 0)
mod->charges = m_procCharges;
else
mod->charges = 0;
mod->charges = m_procCharges;
m_spellmod = mod;
}
@ -4005,8 +3994,7 @@ void Aura::HandleAuraProcTriggerSpell(bool apply, bool Real)
switch (GetId())
{
case 28200: // Ascendance (Talisman of Ascendance trinket)
m_procCharges = 6;
UpdateAuraCharges();
SetAuraCharges(6);
break;
default: break;
}