diff --git a/Maple2.Model/Enum/AttributePointSource.cs b/Maple2.Model/Enum/AttributePointSource.cs index 3caf44d46..55efedddc 100644 --- a/Maple2.Model/Enum/AttributePointSource.cs +++ b/Maple2.Model/Enum/AttributePointSource.cs @@ -5,4 +5,5 @@ public enum AttributePointSource { Quest = 2, Exploration = 3, Prestige = 4, + Command = 5, } diff --git a/Maple2.Server.Game/Commands/PlayerCommand.cs b/Maple2.Server.Game/Commands/PlayerCommand.cs index 6fe44f7eb..c1207348a 100644 --- a/Maple2.Server.Game/Commands/PlayerCommand.cs +++ b/Maple2.Server.Game/Commands/PlayerCommand.cs @@ -18,6 +18,7 @@ public PlayerCommand(GameSession session, AchievementMetadataStorage achievement AddCommand(new ExpCommand(session)); AddCommand(new JobCommand(session)); AddCommand(new InfoCommand(session)); + AddCommand(new AttributePointCommand(session)); AddCommand(new SkillPointCommand(session)); AddCommand(new CurrencyCommand(session)); AddCommand(new InventoryCommand(session)); @@ -362,6 +363,29 @@ private void Handle(InvocationContext ctx) { } } + private class AttributePointCommand : Command { + private readonly GameSession session; + + public AttributePointCommand(GameSession session) : base("statpoint", "Add attribute points to the player.") { + this.session = session; + + var points = new Argument("points", "Attribute points to add."); + + AddArgument(points); + this.SetHandler(Handle, points); + } + + private void Handle(InvocationContext ctx, int points) { + try { + session.Config.AddStatPoint(AttributePointSource.Command, points); + ctx.ExitCode = 0; + } catch (SystemException ex) { + ctx.Console.Error.WriteLine(ex.Message); + ctx.ExitCode = 1; + } + } + } + private class SkillPointCommand : Command { private readonly GameSession session;