mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8477] Implemented "on demand" regeneration of power in Spell::CheckPower (limited to 500ms frequency).
Correctly set UNIT_FLAG2_REGENERATE_POWER to notify client to stop/start regen in bar. thx. also for nos4r2zod From original patch was removed usage of getMSTime() and rewrited this part. Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
7a2df3c309
commit
dffa5d43bd
6 changed files with 63 additions and 32 deletions
|
|
@ -5039,6 +5039,15 @@ SpellCastResult Spell::CheckPower()
|
|||
if(m_CastItem)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
// Do precise power regen on spell cast
|
||||
if (m_powerCost > 0 && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player* playerCaster = (Player*)m_caster;
|
||||
uint32 diff = REGEN_TIME_FULL - m_caster->GetRegenTimer();
|
||||
if (diff >= REGEN_TIME_PRECISE)
|
||||
playerCaster->RegenerateAll(diff);
|
||||
}
|
||||
|
||||
// health as power used - need check health amount
|
||||
if(m_spellInfo->powerType == POWER_HEALTH)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue