public void execute(CommandSender sender, CommandParameters params) { CommandResult res = new CommandResult(); params.init(CommandType.TEXT); String text = params.paramString(); res.setFailText("[R][WHITE]You didn't enter anything!"); if (text == null) res.send(); Mobile mob = (Mobile) sender; mob.getBaseModel().setDescription(text); res.setText("[R][WHITE]Description changed to: " + text); res.setSuccessful(true); res.send(); }
public CommandResult execute(CommandSender sender, CommandParameters params) { // Make the CommandResult object. CommandResult res = new CommandResult(); res.setFailText("[B]FATAL ERROR IN SCORE METHOD.[R]"); Mobile mob = (Mobile) sender; String score = "\n[R][WHITE]Score and Statistics for [B][GREEN]" + mob.getBaseModel().getName() + "[R][WHITE]" + "\nAlignment: " + mob.getBaseModel().getAlignment().toString() + "\nHP: [B][RED]" + mob.getCombatModel().getCurrentHPString() + "/" + mob.getCombatModel().getMaxHPString() + " [R][WHITE]Class: " + mob.getBaseModel().getMobileClass().getDisplayName() + " [R][WHITE]Level: [B][MAGENTA]" + mob.getBaseModel().getLevel() + "\nCurrent XP Amount: [YELLOW]0% [WHITE]Guild: [B][GREEN]None[R][WHITE]"; res.setText(score); res.setSuccessful(true); return res; }