diff options
author | QAston <none@none> | 2009-08-17 16:57:36 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-17 16:57:36 +0200 |
commit | 5047eb7a6265d2bf496ef22d7c9a6b30fa21d466 (patch) | |
tree | aacd8163b4f23f68f4204f7589048f77edecfb1e /src | |
parent | b8993423b5bad734c1ff7d30eb387686fb6c208d (diff) |
*Implement aura type SPELL_AURA_PREVENT_REGENERATE_POWER(294).
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 3 | ||||
-rw-r--r-- | src/game/SpellAuraDefines.h | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 10 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
5 files changed, 16 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e7630948d1d..45b9677347c 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2041,6 +2041,9 @@ void Player::RegenerateAll() void Player::Regenerate(Powers power) { + // TODO: possible use of miscvalueb instead of amount + if (HasAuraTypeWithValue(SPELL_AURA_PREVENT_REGENERATE_POWER, power)) + return; uint32 curValue = GetPower(power); uint32 maxValue = GetMaxPower(power); diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index d25ac1659b3..0c2fefa848a 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -339,7 +339,7 @@ enum AuraType SPELL_AURA_MOD_XP_QUEST_PCT, SPELL_AURA_292, SPELL_AURA_293, - SPELL_AURA_294, + SPELL_AURA_PREVENT_REGENERATE_POWER, TOTAL_AURAS = 295 }; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 738c011a489..82a907feb86 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -347,7 +347,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest &Aura::HandleNULL, //292 call stabled pet &Aura::HandleNULL, //293 2 test spells - &Aura::HandleNULL //294 2 spells, possible prevent mana regen + &Aura::HandleNoImmediateEffect //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power) }; #undef Aura diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 41076313567..25e077cc97c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4185,6 +4185,16 @@ bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const return false; } +bool Unit::HasAuraTypeWithValue(AuraType auratype, uint32 value) const +{ + AuraEffectList const& mTotalAuraList = GetAurasByType(auratype); + for(AuraEffectList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i) + if (value == (*i)->GetAmount()) + return true; + return false; +} + + bool Unit::HasAuraType(AuraType auraType) const { return (!m_modAuras[auraType].empty()); diff --git a/src/game/Unit.h b/src/game/Unit.h index 21b92bfb7ad..bb6b4262549 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1613,6 +1613,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool HasAura(Aura * aur) const; bool HasAuraType(AuraType auraType) const; bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const; + bool HasAuraTypeWithValue(AuraType auratype, uint32 value) const; inline AuraEffect* GetDummyAura(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);} AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove = false); |