Updated Commands to use heal packet instead of hearts, enabling godmode. needs permission.
This commit is contained in:
parent
efa6b8fbac
commit
2621774e85
5 changed files with 21 additions and 8 deletions
|
|
@ -3749,12 +3749,7 @@ namespace TShockAPI
|
||||||
playerToHeal = args.Player;
|
playerToHeal = args.Player;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item heart = TShock.Utils.GetItemById(58);
|
playerToHeal.Heal();
|
||||||
Item star = TShock.Utils.GetItemById(184);
|
|
||||||
for (int i = 0; i < 20; i++)
|
|
||||||
playerToHeal.GiveItem(heart.type, heart.name, heart.width, heart.height, heart.maxStack);
|
|
||||||
for (int i = 0; i < 10; i++)
|
|
||||||
playerToHeal.GiveItem(star.type, star.name, star.width, star.height, star.maxStack);
|
|
||||||
if (playerToHeal == args.Player)
|
if (playerToHeal == args.Player)
|
||||||
{
|
{
|
||||||
args.Player.SendSuccessMessage("You just got healed!");
|
args.Player.SendSuccessMessage("You just got healed!");
|
||||||
|
|
|
||||||
|
|
@ -1322,6 +1322,11 @@ namespace TShockAPI
|
||||||
args.Player.PlayerData.maxHealth = max;
|
args.Player.PlayerData.maxHealth = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.Player.Group.HasPermission(Permissions.godmode) && (cur < max))
|
||||||
|
{
|
||||||
|
args.Player.Heal(args.TPlayer.statLifeMax);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1449,7 +1454,7 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args.Player.LoginFailsBySsi = false;
|
args.Player.LoginFailsBySsi = false;
|
||||||
|
|
||||||
if (group.HasPermission(Permissions.ignorestackhackdetection))
|
if (group.HasPermission(Permissions.ignorestackhackdetection))
|
||||||
args.Player.IgnoreActionsForCheating = "none";
|
args.Player.IgnoreActionsForCheating = "none";
|
||||||
|
|
@ -2937,6 +2942,11 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.Player.Group.HasPermission(Permissions.godmode))
|
||||||
|
{
|
||||||
|
args.Player.Heal(args.TPlayer.statLifeMax);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -283,6 +283,9 @@ namespace TShockAPI
|
||||||
[Description("User can get the server info.")]
|
[Description("User can get the server info.")]
|
||||||
public static readonly string serverinfo = "tshock.info";
|
public static readonly string serverinfo = "tshock.info";
|
||||||
|
|
||||||
|
[Description("Player recovers health as damage is taken. Can be one shotted.")]
|
||||||
|
public static readonly string godmode = "tshock.godmode";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lists all commands associated with a given permission
|
/// Lists all commands associated with a given permission
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -530,10 +530,15 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
TPlayer.Teleport(new Vector2(x, y), style);
|
TPlayer.Teleport(new Vector2(x, y), style);
|
||||||
NetMessage.SendData(65, -1, -1, "", 0, TPlayer.whoAmi, x, y, style);
|
NetMessage.SendData((int)PacketTypes.Teleport, -1, -1, "", 0, TPlayer.whoAmi, x, y, style);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Heal(int damage = 400)
|
||||||
|
{
|
||||||
|
NetMessage.SendData((int)PacketTypes.PlayerHealOther, -1, -1, "", this.TPlayer.whoAmi, damage);
|
||||||
|
}
|
||||||
|
|
||||||
public void Spawn()
|
public void Spawn()
|
||||||
{
|
{
|
||||||
Spawn(TPlayer.SpawnX, TPlayer.SpawnY);
|
Spawn(TPlayer.SpawnX, TPlayer.SpawnY);
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue