diff options
| author | QAston <none@none> | 2009-06-06 08:27:36 +0200 |
|---|---|---|
| committer | QAston <none@none> | 2009-06-06 08:27:36 +0200 |
| commit | 39548d6822ce2a8cea49e4467f8329335aa0d85d (patch) | |
| tree | ca1055ea31b1b8b994c693ab713626a3d00c405c /src/game/SpellAuras.cpp | |
| parent | 00582cf9d4bebbf812f2cccb14be8dce288c2f07 (diff) | |
*Update spellmod system
*Implement SPELL_ATTR_EX6_IGNORE_CASTER_AURAS
*Fix some bugs with traps proc flags
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
| -rw-r--r-- | src/game/SpellAuras.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 0d4606e6e84..dae7436e599 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -623,6 +623,8 @@ Unit* AuraEffect::GetSource() const void Aura::Update(uint32 diff) { + // TODO: store pointer to caster in aura class for update/mod handling code + if (m_duration > 0) { m_duration -= diff; @@ -666,9 +668,23 @@ void Aura::Update(uint32 diff) } } + // Apply charged spellmods for channeled auras + // used for example when triggered spell of spell:10 is modded + Spell * modSpell = NULL; + Unit* caster = NULL; + if (IS_PLAYER_GUID(GetCasterGUID()) + { + caster = GetCaster(); + modSpell = ((Player*)caster)->FindCurrentSpellBySpellId(GetId()); + if (caster) + ((Player*)caster)->SetSpellModTakingSpell(modSpell, true); + } for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_partAuras[i]) m_partAuras[i]->Update(diff); + + if (caster) + ((Player*)caster)->SetSpellModTakingSpell(modSpell, false); } void AuraEffect::Update(uint32 diff) @@ -1295,15 +1311,19 @@ void Aura::SetAuraCharges(uint8 charges) SendAuraUpdate(); } -void Aura::DropAuraCharge() +bool Aura::DropAuraCharge() { if(m_procCharges) //auras without charges always have charge = 0 { if(--m_procCharges) // Send charge change SendAuraUpdate(); else // Last charge dropped + { m_target->RemoveAura(this, AURA_REMOVE_BY_EXPIRE); + return true; + } } + return false; } bool Aura::IsPersistent() const @@ -1533,7 +1553,7 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount) if (apply) { - SpellModifier *mod = new SpellModifier; + SpellModifier *mod = new SpellModifier(GetParentAura()); mod->op = SpellModOp(modOp); mod->value = m_amount; mod->type = SpellModType(m_auraName); // SpellModType value == spell aura types |
