#W# Added: Added a new [bandself command.

This commit is contained in:
WarrentyExpired 2026-09-30 08:10:01 -04:00
parent 2b5d1e62fc
commit 72ce92cf34
3 changed files with 99 additions and 3 deletions

View file

@ -0,0 +1,42 @@
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;
if (BandageContext.GetContext(from) != null)
{
from.SendMessage( 33, "You are already applying a bandage." );
return;
}
Bandage bandage = from.Backpack.FindItemByType<Bandage>();
if (bandage != null)
{
if (BandageContext.BeginHeal(from, from) != null)
{
bandage.Consume();
}
}
else
{
from.SendMessage("You do not have any bandages in your backpack.");
}
}
}
}