Core/Battlegrounds: Implement power resets on arena-fight preparations (first 60 seconds before arena-fight kicks off) (Thanks to Kaelima)
Restores all player powers every 5 seconds untill arena starts (fixes possible exploit with entering arena battle with full rage or runic power) (The 5 second timer is not 100% confirmed, as official pages only states that the power is reset after prep-time - needs feedback) Closes issue 4805 --HG-- branch : trunk
This commit is contained in:
1 parent
2338eae0ff
commit
28c2e270db
5 files changed
+41
-9
No files matched your search
@@ -2360,6 +2360,26 @@ void Player::RegenerateHealth()
|
||||
ModifyHealth(int32(addvalue));
|
||||
}
|
||||
|
||||
void Player::ResetAllPowers()
|
||||
{
|
||||
SetHealth(GetMaxHealth());
|
||||
switch (getPowerType())
|
||||
{
|
||||
case POWER_MANA:
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
break;
|
||||
case POWER_RAGE:
|
||||
SetPower(POWER_RAGE, 0);
|
||||
break;
|
||||
case POWER_ENERGY:
|
||||
SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
|
||||
break;
|
||||
case POWER_RUNIC_POWER:
|
||||
SetPower(POWER_RUNIC_POWER, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::CanInteractWithNPCs(bool alive) const
|
||||
{
|
||||
if (alive && !isAlive())
|
||||
|
||||
Reference in new issue
Block a user