@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user