fix(Core/Commands): .cheat god lowering hp to 1 and .cheat power not refilling power (#3299)

This commit is contained in:
Petric
2021-03-21 14:15:00 +00:00
committed by GitHub
parent 34a129e478
commit 5aed4dd193
3 changed files with 96 additions and 23 deletions

View File

@@ -2726,6 +2726,23 @@ void Player::Regenerate(Powers power)
if (!maxValue)
return;
//If .cheat power is on always have the max power
if (GetCommandStatus(CHEAT_POWER))
{
if (m_regenTimerCount >= 2000)
{
//Set the value to 0 first then set it to max to force resend of packet as for range clients keeps removing rage
if (power == POWER_RAGE || power == POWER_RUNIC_POWER)
{
UpdateUInt32Value(UNIT_FIELD_POWER1 + power, 0);
}
SetPower(power, maxValue);
return;
}
}
uint32 curValue = GetPower(power);
// TODO: possible use of miscvalueb instead of amount
@@ -25705,7 +25722,7 @@ void Player::HandleFall(MovementInfo const& movementInfo)
//Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored
// 14.57 can be calculated by resolving damageperc formula below to 0
if (z_diff >= 14.57f && !isDead() && !IsGameMaster() &&
if (z_diff >= 14.57f && !isDead() && !IsGameMaster() && !GetCommandStatus(CHEAT_GOD) &&
!HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) &&
!HasAuraType(SPELL_AURA_FLY))
{