From eb3beb55b4deaf3b11d4876d05fc7d4ed3d33f26 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Thu, 16 Jul 2026 19:41:25 -0400 Subject: [PATCH] #W# Added BandSelf command. --- Scripts/Commands/Player/BandSelf.cs | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Scripts/Commands/Player/BandSelf.cs diff --git a/Scripts/Commands/Player/BandSelf.cs b/Scripts/Commands/Player/BandSelf.cs new file mode 100644 index 0000000..b3a2c79 --- /dev/null +++ b/Scripts/Commands/Player/BandSelf.cs @@ -0,0 +1,47 @@ +using System; +using Server; +using Server.Items; +using Server.Commands; +using Server.Mobiles; + +namespace Server.Commands +{ + public class BandSelf + { + public static void Initialize() + { + CommandSystem.Register("Bandself", AccessLevel.Player, new CommandEventHandler(Bandself_OnCommand)); + } + + [Usage("Bandself")] + [Description("Uses a bandage from the player's backpack on themselves.")] + public static void Bandself_OnCommand(CommandEventArgs e) + { + Mobile from = e.Mobile; + + // 1. Check if the player is already bandaging to avoid resetting the timer + if (BandageContext.GetContext(from) != null) + { + from.SendMessage("You are already applying a bandage."); + return; + } + + // 2. Search for a bandage in the backpack + Bandage bandage = from.Backpack.FindItemByType(); + + if (bandage != null) + { + // 3. Trigger the healing attempt directly using the established Context logic + // We call BeginHeal which handles the timer, skill checks, and target logic + if (BandageContext.BeginHeal(from, from) != null) + { + bandage.Consume(); + } + } + else + { + from.SendMessage("You do not have any bandages in your backpack."); + } + } + } +}