aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellAuras.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r--src/game/SpellAuras.cpp46
1 files changed, 17 insertions, 29 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 8ae85c89ff0..0e59d854d6f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -431,15 +431,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));
@@ -877,17 +871,16 @@ void Aura::_AddAura()
SetAuraSlot( slot );
// Not update fields for not first spell's aura, all data already in fields
- if(slot < MAX_AURAS) // slot found
- {
- 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
- m_target->UpdateAuraForGroup(slot);
- }
+ if(slot < MAX_AURAS) // slot found
+ {
+ 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));
+ SendAuraUpdate(false);
+
+ // update for out of range group members
+ m_target->UpdateAuraForGroup(slot);
+ }
}
else // use found slot
{
@@ -1027,7 +1020,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))
{
@@ -1097,7 +1090,7 @@ void Aura::HandleAddModifier(bool apply, bool Real)
case 34754: // Clearcasting
case 34936: // Backlash
case 48108: // Hot Streak
- m_procCharges = 1;
+ SetAuraCharges(1);
break;
}
@@ -1125,11 +1118,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;
}
@@ -3859,8 +3848,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;
}