From 9dbd54ea1925a4187cf31110ed46fb1a2385e163 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Tue, 31 Jan 2012 17:43:07 +0100 Subject: [PATCH] [11894] Implement spell 21056 --- src/game/SpellAuras.cpp | 32 ++++++++++++++++++++++---------- src/shared/revision_nr.h | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index d9b9dda72..2d03c7927 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -7381,28 +7381,28 @@ void Aura::PeriodicTick() if (!target->isAlive()) return; - if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS) + if (m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS) return; Powers power = Powers(m_modifier.m_miscvalue); // power type might have changed between aura applying and tick (druid's shapeshift) - if(target->getPowerType() != power) + if (target->getPowerType() != power) return; - Unit *pCaster = GetCaster(); - if(!pCaster) + Unit* pCaster = GetCaster(); + if (!pCaster) return; - if(!pCaster->isAlive()) + if (!pCaster->isAlive()) return; - if( GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && + if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && pCaster->SpellHitResult(target, spellProto, false) != SPELL_MISS_NONE) return; // Check for immune (not use charges) - if(target->IsImmunedToDamage(GetSpellSchoolMask(spellProto))) + if (target->IsImmunedToDamage(GetSpellSchoolMask(spellProto))) return; // ignore non positive values (can be result apply spellmods to aura damage @@ -7415,7 +7415,7 @@ void Aura::PeriodicTick() // max value uint32 maxmana = pCaster->GetMaxPower(power) * pdamage * 2 / 100; pdamage = target->GetMaxPower(power) * pdamage / 100; - if(pdamage > maxmana) + if (pdamage > maxmana) pdamage = maxmana; } @@ -7432,11 +7432,11 @@ void Aura::PeriodicTick() float gain_multiplier = 0; - if(pCaster->GetMaxPower(power) > 0) + if (pCaster->GetMaxPower(power) > 0) { gain_multiplier = spellProto->EffectMultipleValue[GetEffIndex()]; - if(Player *modOwner = pCaster->GetSpellModOwner()) + if (Player *modOwner = pCaster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_MULTIPLE_VALUE, gain_multiplier); } @@ -7454,6 +7454,18 @@ void Aura::PeriodicTick() target->AddThreat(pCaster, float(gain) * 0.5f, pInfo.critical, GetSpellSchoolMask(spellProto), spellProto); } + + // Some special cases + switch (GetId()) + { + case 21056: // Mark of Kazzak + if (target->GetTypeId() == TYPEID_PLAYER && target->GetPower(power) == 0) + { + target->CastSpell(target, 21058, true, NULL, this); + target->RemoveAurasDueToSpell(GetId()); + } + break; + } break; } case SPELL_AURA_PERIODIC_ENERGIZE: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a8b847819..d64bb662d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11893" + #define REVISION_NR "11894" #endif // __REVISION_NR_H__