[11894] Implement spell 21056

This commit is contained in:
Schmoozerd 2012-01-31 17:43:07 +01:00
parent c9ead52e68
commit 9dbd54ea19
2 changed files with 23 additions and 11 deletions

View file

@ -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:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11893"
#define REVISION_NR "11894"
#endif // __REVISION_NR_H__