45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
public class ConsoleCmdSetProgression : ConsoleCmdAbstract
|
|
{
|
|
public override bool IsExecuteOnClient => true;
|
|
public override bool AllowedInMainMenu => false;
|
|
public override int DefaultPermissionLevel => 1000;
|
|
|
|
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
|
{
|
|
if (GameManager.Instance.adminTools == null)
|
|
return;
|
|
|
|
if (_params.Count == 2)
|
|
{
|
|
string progression = _params[0];
|
|
int level = int.Parse(_params[1]);
|
|
|
|
if (level >= 0)
|
|
{
|
|
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
|
|
|
if (primaryPlayer != null)
|
|
{
|
|
ProgressionValue progressionValue = primaryPlayer.Progression.GetProgressionValue(progression);
|
|
if (progressionValue != null)
|
|
{
|
|
progressionValue.level = level;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override string[] getCommands()
|
|
{
|
|
return new string[1] { "setprogression" };
|
|
}
|
|
|
|
public override string getDescription()
|
|
{
|
|
return "Lets the player set progression";
|
|
}
|
|
}
|