From 81aebe15158a13f523f3961bfc94acd89ac82a28 Mon Sep 17 00:00:00 2001 From: ShinDarth Date: Sat, 13 Aug 2016 14:43:14 +0200 Subject: [PATCH] Core/Player: added API for duel reset of health/mana --- src/game/Entities/Player/Player.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/game/Entities/Player/Player.h b/src/game/Entities/Player/Player.h index 97feda9fc..2c3017f79 100644 --- a/src/game/Entities/Player/Player.h +++ b/src/game/Entities/Player/Player.h @@ -2116,6 +2116,12 @@ class Player : public Unit, public GridObject void SetHonorPoints(uint32 value); void SetArenaPoints(uint32 value); + // duel health and mana reset methods + void SaveHealthBeforeDuel() { healthBeforeDuel = GetHealth(); } + void SaveManaBeforeDuel() { manaBeforeDuel = GetPower(POWER_MANA); } + void RestoreHealthAfterDuel() { SetHealth(healthBeforeDuel); } + void RestoreManaAfterDuel() { SetPower(POWER_MANA, manaBeforeDuel); } + //End of PvP System inline SpellCooldowns GetSpellCooldowns() const { return m_spellCooldowns; } @@ -2940,6 +2946,10 @@ class Player : public Unit, public GridObject InstanceTimeMap _instanceResetTimes; uint32 _pendingBindId; uint32 _pendingBindTimer; + + // duel health and mana reset attributes + uint32 healthBeforeDuel; + uint32 manaBeforeDuel; }; void AddItemsSetItem(Player*player, Item* item);