Merge pull request #1234 from webmilio/general-devel

Added the SetDungeon command. Closes #1140
This commit is contained in:
White 2016-07-02 10:19:02 +09:30 committed by GitHub
commit a0078fbd6d
2 changed files with 18 additions and 2 deletions

View file

@ -512,6 +512,11 @@ namespace TShockAPI
AllowServer = false, AllowServer = false,
HelpText = "Sets the world's spawn point to your location." HelpText = "Sets the world's spawn point to your location."
}); });
add(new Command(Permissions.worldspawn, SetDungeon, "setdungeon")
{
AllowServer = false,
HelpText = "Sets the dungeon's position to your location."
});
add(new Command(Permissions.worldsettle, Settle, "settle") add(new Command(Permissions.worldsettle, Settle, "settle")
{ {
HelpText = "Forces all liquids to update immediately." HelpText = "Forces all liquids to update immediately."
@ -3612,6 +3617,14 @@ namespace TShockAPI
args.Player.SendSuccessMessage("Spawn has now been set at your location."); args.Player.SendSuccessMessage("Spawn has now been set at your location.");
} }
private static void SetDungeon(CommandArgs args)
{
Main.dungeonX = args.Player.TileX + 1;
Main.dungeonY = args.Player.TileY + 3;
SaveManager.Instance.SaveWorld(false);
args.Player.SendSuccessMessage("The dungeon's position has now been set at your location.");
}
private static void Reload(CommandArgs args) private static void Reload(CommandArgs args)
{ {
TShock.Utils.Reload(args.Player); TShock.Utils.Reload(args.Player);

View file

@ -305,6 +305,9 @@ namespace TShockAPI
[Description("User can set the world spawn.")] [Description("User can set the world spawn.")]
public static readonly string worldspawn = "tshock.world.setspawn"; public static readonly string worldspawn = "tshock.world.setspawn";
[Description( "User can set the dungeon's location." )]
public static readonly string dungeonposition = "tshock.world.setdungeon";
[Description("User can drop a meteor.")] [Description("User can drop a meteor.")]
public static readonly string dropmeteor = "tshock.world.time.dropmeteor"; public static readonly string dropmeteor = "tshock.world.time.dropmeteor";