Merge commit '0024d8f791' into general-devel
This commit is contained in:
commit
690c8561cd
4 changed files with 57 additions and 3 deletions
|
|
@ -160,9 +160,10 @@ namespace TShockAPI
|
|||
{
|
||||
ChatCommands.Add(new Command("kill", Kill, "kill"));
|
||||
ChatCommands.Add(new Command("butcher", Butcher, "butcher"));
|
||||
ChatCommands.Add(new Command("cheat", Item, "item", "i"));
|
||||
ChatCommands.Add(new Command("cheat", Give, "give"));
|
||||
ChatCommands.Add(new Command("cheat", Heal, "heal"));
|
||||
ChatCommands.Add(new Command("item", Item, "item", "i"));
|
||||
ChatCommands.Add(new Command("item", Give, "give"));
|
||||
ChatCommands.Add(new Command("heal", Heal, "heal"));
|
||||
//ChatCommands.Add(new Command("buff", Buff, "buff"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1662,6 +1663,22 @@ namespace TShockAPI
|
|||
}
|
||||
}
|
||||
|
||||
private static void Buff(CommandArgs args)
|
||||
{
|
||||
if (!args.Player.RealPlayer)
|
||||
{
|
||||
args.Player.SendMessage("You cant buff yourself!");
|
||||
return;
|
||||
}
|
||||
if (args.Parameters.Count > 0)
|
||||
{
|
||||
args.Player.SendMessage("Invalid syntax! Proper syntax: /buff", Color.Red);
|
||||
return;
|
||||
}
|
||||
args.Player.Buff();
|
||||
args.Player.SendMessage("You have been buffed.", Color.Lime);
|
||||
}
|
||||
|
||||
#endregion Cheat Comamnds
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ namespace TShockAPI
|
|||
|
||||
public int MaximumLoginAttempts = 3;
|
||||
|
||||
public int[] Buffs = { 1, 2, 3, 5, 6, 9, 12, 14, 17, 18 };
|
||||
|
||||
public static ConfigFile Read(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
|
|
|||
|
|
@ -505,6 +505,34 @@ namespace TShockAPI
|
|||
Tools.ForceKick(args.Player, string.Format("Tile Kill abuse ({0})", Main.tile[tilex, tiley].type));
|
||||
return true;
|
||||
}
|
||||
if (!args.Player.Group.HasPermission("editspawn") && RegionManager.InProtectedArea(tilex, tiley, Tools.GetPlayerIP(args.Player.Name)))
|
||||
{
|
||||
args.Player.SendMessage("Region protected from changes.", Color.Red);
|
||||
args.Player.SendTileSquare(tilex, tiley);
|
||||
return true;
|
||||
}
|
||||
if (TShock.Config.DisableBuild)
|
||||
{
|
||||
if (!args.Player.Group.HasPermission("editspawn"))
|
||||
{
|
||||
args.Player.SendMessage("World protected from changes.", Color.Red);
|
||||
args.Player.SendTileSquare(tilex, tiley);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (TShock.Config.SpawnProtection)
|
||||
{
|
||||
if (!args.Player.Group.HasPermission("editspawn"))
|
||||
{
|
||||
var flag = TShock.CheckSpawn(tilex, tiley);
|
||||
if (flag)
|
||||
{
|
||||
args.Player.SendMessage("Spawn protected from changes.", Color.Red);
|
||||
args.Player.SendTileSquare(tilex, tiley);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -259,6 +259,13 @@ namespace TShockAPI
|
|||
return;
|
||||
NetMessage.SendData((int)msgType, Index, -1, text, number, number2, number3, number4, number5);
|
||||
}
|
||||
|
||||
public void Buff()
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
TPlayer.buffType[i] = TShock.Config.Buffs[i];
|
||||
NetMessage.SendData(50, -1, -1, "", Index);
|
||||
}
|
||||
}
|
||||
|
||||
public class TSServerPlayer : TSPlayer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue