[11552] Implement aura SPELL_AURA_STOP_NATURAL_MANA_REGEN (294)

Also partly implement using it spell 62692.

FIXME: Some spells expected to be working for target under spell 62692 effect
       not working. This need additional research and fixes.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
breakwater 2011-05-28 05:20:26 +04:00 committed by VladimirMangos
parent e204c246f4
commit ce14b28ba4
6 changed files with 25 additions and 4 deletions

View file

@ -1399,7 +1399,7 @@ void Player::Update( uint32 update_diff, uint32 p_time )
if (isAlive())
{
// if no longer casting, set regen power as soon as it is up.
if (!IsUnderLastManaUseEffect())
if (!IsUnderLastManaUseEffect() && !HasAuraType(SPELL_AURA_STOP_NATURAL_MANA_REGEN))
SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);
if (!m_regenTimer)
@ -2104,6 +2104,8 @@ void Player::Regenerate(Powers power, uint32 diff)
{
case POWER_MANA:
{
if (HasAuraType(SPELL_AURA_STOP_NATURAL_MANA_REGEN))
break;
bool recentCast = IsUnderLastManaUseEffect();
float ManaIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_POWER_MANA);
if (recentCast)

View file

@ -329,7 +329,7 @@ enum AuraType
SPELL_AURA_MOD_QUEST_XP_PCT = 291,
SPELL_AURA_OPEN_STABLE = 292,
SPELL_AURA_ADD_MECHANIC_ABILITIES = 293,
SPELL_AURA_294 = 294,
SPELL_AURA_STOP_NATURAL_MANA_REGEN = 294,
SPELL_AURA_295 = 295,
SPELL_AURA_296 = 296,
SPELL_AURA_297 = 297,

View file

@ -344,7 +344,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_QUEST_XP_PCT implemented in Player::GiveXP
&Aura::HandleAuraOpenStable, //292 call stabled pet
&Aura::HandleAuraAddMechanicAbilities, //293 SPELL_AURA_ADD_MECHANIC_ABILITIES replaces target's action bars with a predefined spellset
&Aura::HandleNULL, //294 2 spells, possible prevent mana regen
&Aura::HandleAuraStopNaturalManaRegen, //294 SPELL_AURA_STOP_NATURAL_MANA_REGEN implemented in Player:Regenerate
&Aura::HandleUnused, //295 unused (3.2.2a)
&Aura::HandleNULL, //296 2 spells
&Aura::HandleNULL, //297 1 spell (counter spell school?)
@ -8295,6 +8295,14 @@ void Aura::HandleAuraModAllCritChance(bool apply, bool Real)
((Player*)target)->UpdateAllSpellCritChances();
}
void Aura::HandleAuraStopNaturalManaRegen(bool apply, bool real)
{
if (!real)
return;
GetTarget()->ApplyModFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER, !apply && !GetTarget()->IsUnderLastManaUseEffect());
}
bool Aura::IsLastAuraOnHolder()
{
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
@ -8863,6 +8871,11 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply)
caster->RemoveAurasDueToSpell(34027);
return;
}
case 62692: // Aura of Despair
{
spellId1 = 64848;
break;
}
case 71905: // Soul Fragment
{
if (!apply)

View file

@ -370,6 +370,7 @@ class MANGOS_DLL_SPEC Aura
void HandleAuraModAllCritChance(bool Apply, bool Real);
void HandleAuraOpenStable(bool apply, bool Real);
void HandleAuraAddMechanicAbilities(bool apply, bool Real);
void HandleAuraStopNaturalManaRegen(bool apply, bool real);
virtual ~Aura();

View file

@ -1898,6 +1898,11 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
(spellInfo_2->Id == 8326 && spellInfo_1->Id == 20584))
return false;
// Aura of Despair auras
if ((spellInfo_1->Id == 64848 && spellInfo_2->Id == 62692) ||
(spellInfo_2->Id == 64848 && spellInfo_1->Id == 62692))
return false;
// Blood Fury and Rage of the Unraveller
if (spellInfo_1->SpellIconID == 1662 && spellInfo_2->SpellIconID == 1662)
return false;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11551"
#define REVISION_NR "11552"
#endif // __REVISION_NR_H__