Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Maple2.Model/Enum/AttributePointSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ public enum AttributePointSource {
Quest = 2,
Exploration = 3,
Prestige = 4,
Command = 5,
}
24 changes: 24 additions & 0 deletions Maple2.Server.Game/Commands/PlayerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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<int>("points", "Attribute points to add.");

AddArgument(points);
this.SetHandler<InvocationContext, int>(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;

Expand Down
Loading