diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Player/Player.h | 1 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/StatSystem.cpp | 21 | ||||
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 | ||||
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 10 |
4 files changed, 27 insertions, 7 deletions
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c7bdf1ab445..6ba3af8e97d 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1874,6 +1874,7 @@ class Player : public Unit, public GridObject<Player> void ApplyManaRegenBonus(int32 amount, bool apply); void ApplyHealthRegenBonus(int32 amount, bool apply); void UpdateManaRegen(); + void UpdateRuneRegen(RuneType rune); const uint64& GetLootGUID() const { return m_lootGuid; } void SetLootGUID(const uint64 &guid) { m_lootGuid = guid; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 5989b191005..537840163a0 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -781,6 +781,27 @@ void Player::UpdateManaRegen() SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen); } +void Player::UpdateRuneRegen(RuneType rune) +{ + if (rune >= NUM_RUNE_TYPES) + return; + + uint32 cooldown = 0; + + for (uint32 i = 0; i < MAX_RUNES; ++i) + if (GetBaseRune(i) == rune) + { + cooldown = GetRuneBaseCooldown(i); + break; + } + + if (cooldown <= 0) + return; + + float regen = float(1 * IN_MILLISECONDS) / float(cooldown); + SetFloatValue(PLAYER_RUNE_REGEN_1 + uint8(rune), regen); +} + void Player::_ApplyAllStatBonuses() { SetCanModifyStats(false); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 17940a3b16a..7afbdebd034 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3897,6 +3897,8 @@ void AuraEffect::HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, // Update manaregen value if (GetMiscValue() == POWER_MANA) target->ToPlayer()->UpdateManaRegen(); + else if (GetMiscValue() == POWER_RUNE) + target->ToPlayer()->UpdateRuneRegen(RuneType(GetMiscValueB())); // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index ac6a54c11a7..73384dd7f6b 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1645,7 +1645,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } } - uint32 presence=GetId(); + uint32 presence = GetId(); if (apply) { // Blood Presence bonus @@ -1653,7 +1653,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b target->CastSpell(target, 63611, true); else if (bloodPresenceAura) { - int32 basePoints1=bloodPresenceAura->GetAmount(); + int32 basePoints1 = bloodPresenceAura->GetAmount(); target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, bloodPresenceAura); } // Frost Presence bonus @@ -1672,13 +1672,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // Not listed as any effect, only base points set int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(unholyPresenceAura->GetSpellProto(), 1); target->CastCustomSpell(target, 63622, &basePoints0 , &basePoints0, &basePoints0, true, 0, unholyPresenceAura); - target->CastCustomSpell(target, 65095, &basePoints0 , NULL, NULL, true, 0, unholyPresenceAura); } target->CastSpell(target, 49772, true); } else if (unholyPresenceAura) { - int32 basePoints0=unholyPresenceAura->GetAmount(); + int32 basePoints0 = unholyPresenceAura->GetAmount(); target->CastCustomSpell(target, 49772, &basePoints0, NULL, NULL, true, 0, unholyPresenceAura); } } @@ -1692,10 +1691,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (presence == 48265 || unholyPresenceAura) { if (presence == 48265 && unholyPresenceAura) - { target->RemoveAurasDueToSpell(63622); - target->RemoveAurasDueToSpell(65095); - } target->RemoveAurasDueToSpell(49772); } } |