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

@@ -4892,6 +4892,11 @@ SpellCastResult Spell::CheckRuneCost(uint32 RuneCostID)
return SPELL_CAST_OK;
Player* player = m_caster->ToPlayer();
//If we are in .cheat power mode we dont need to check the cost as we are expected to be able to use it anyways (infinite power)
if (player->GetCommandStatus(CHEAT_POWER))
{
return SPELL_CAST_OK;
}
if (player->getClass() != CLASS_DEATH_KNIGHT)
return SPELL_CAST_OK;
@@ -6471,6 +6476,16 @@ SpellCastResult Spell::CheckPower()
if (m_CastItem)
return SPELL_CAST_OK;
//While .cheat power is enabled dont check if we need power to cast the spell
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_POWER))
{
return SPELL_CAST_OK;
}
}
// health as power used - need check health amount
if (m_spellInfo->PowerType == POWER_HEALTH)
{