Core/Cheats: Power - set max power on all powers initially + on regenerate

Port From (https://github.com/TrinityCore/TrinityCore/commit/079bc7800eeb1f5ae8201e59f91d92e980680bcb)
This commit is contained in:
hondacrx
2021-04-14 10:22:44 -04:00
parent 2e34fa7f67
commit 8631aebaf5
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -389,7 +389,7 @@ namespace Game.Chat
playerGuid = ObjectGuid.Empty; playerGuid = ObjectGuid.Empty;
playerName = ""; playerName = "";
if (!args.Empty()) if (args != null && !args.Empty())
{ {
string name = ExtractPlayerNameFromLink(args); string name = ExtractPlayerNameFromLink(args);
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
+6 -1
View File
@@ -123,7 +123,12 @@ namespace Game.Chat.Commands
} }
else if (argstr == "on") else if (argstr == "on")
{ {
handler.GetSession().GetPlayer().SetCommandStatusOn(PlayerCommandStates.Power); Player player = handler.GetSession().GetPlayer();
// Set max power to all powers
for (PowerType powerType = 0; powerType < PowerType.Max; ++powerType)
player.SetPower(powerType, player.GetMaxPower(powerType));
player.SetCommandStatusOn(PlayerCommandStates.Power);
handler.SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells."); handler.SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells.");
return true; return true;
} }
+3
View File
@@ -3812,6 +3812,9 @@ namespace Game.Entities
} }
} }
if (GetCommandStatus(PlayerCommandStates.Power))
curValue = maxPower;
if (m_regenTimerCount >= 2000) if (m_regenTimerCount >= 2000)
SetPower(power, curValue); SetPower(power, curValue);
else else