public static void Random(User user, int max = 100) { if (max < 1) { max = 1; } int x = RandomUtil.Range(1, max); ChatUtils.SendMessageToAll(user.Name + " rolled a random number from 1 to " + max + ": " + "<i>" + x + "</i>"); }
public static void SetMaxSuperSkills(User user, int maxallowed = int.MinValue) { if (maxallowed == -1) { maxallowed = int.MaxValue; } string currentallowedstr = (REYmodSettings.Obj.Config.Maxsuperskills != int.MaxValue) ? REYmodSettings.Obj.Config.Maxsuperskills.ToString() : "Infinite"; if (maxallowed == int.MinValue || maxallowed == REYmodSettings.Obj.Config.Maxsuperskills) { ChatUtils.SendMessage(user, "Max allowed Superskills: " + currentallowedstr); return; } else { string newallowedstr = (maxallowed != int.MaxValue) ? maxallowed.ToString() : "Infinite"; REYmodSettings.Obj.Config.Maxsuperskills = maxallowed; REYmodSettings.Obj.SaveConfig(); ChatUtils.SendMessage(user, "Changed the amount of allowed Superskills from " + currentallowedstr + " to " + newallowedstr); ChatUtils.SendMessageToAll(user.UILink() + "changed the amount of allowed Superskills from " + currentallowedstr + " to " + newallowedstr); // ConfigHandler.UpdateConfigFile(); } }