Added GM commands for setting reward points (#408)
* Added ability to read and update rewardpoints from MapleCharacter * Add GM commands to give reward points
This commit is contained in:
@@ -280,6 +280,7 @@ public class CommandsExecutor {
|
|||||||
addCommand("givenx", 3, GiveNxCommand.class);
|
addCommand("givenx", 3, GiveNxCommand.class);
|
||||||
addCommand("givevp", 3, GiveVpCommand.class);
|
addCommand("givevp", 3, GiveVpCommand.class);
|
||||||
addCommand("givems", 3, GiveMesosCommand.class);
|
addCommand("givems", 3, GiveMesosCommand.class);
|
||||||
|
addCommand("giverp", 3, GiveRpCommand.class);
|
||||||
addCommand("id", 3, IdCommand.class);
|
addCommand("id", 3, IdCommand.class);
|
||||||
addCommand("expeds", 3, ExpedsCommand.class);
|
addCommand("expeds", 3, ExpedsCommand.class);
|
||||||
addCommand("kill", 3, KillCommand.class);
|
addCommand("kill", 3, KillCommand.class);
|
||||||
|
|||||||
29
src/client/command/commands/gm3/GiveRpCommand.java
Normal file
29
src/client/command/commands/gm3/GiveRpCommand.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
|
import client.MapleCharacter;
|
||||||
|
import client.MapleClient;
|
||||||
|
import client.command.Command;
|
||||||
|
|
||||||
|
public class GiveRpCommand extends Command {
|
||||||
|
{
|
||||||
|
setDescription("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(MapleClient client, String[] params) {
|
||||||
|
MapleCharacter player = client.getPlayer();
|
||||||
|
if (params.length < 2) {
|
||||||
|
player.yellowMessage("Syntax: !giverp <playername> <gainrewardpoint>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapleCharacter victim = client.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
|
if (victim != null) {
|
||||||
|
victim.setRewardPoints(victim.getRewardPoints() + Integer.parseInt(params[1]));
|
||||||
|
player.message("RP given. Player " + params[0] + " now has " + victim.getRewardPoints()
|
||||||
|
+ " reward points." );
|
||||||
|
} else {
|
||||||
|
player.message("Player '" + params[0] + "' could not be found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user