RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

Auto Sheathe Weapon 1.2

No permission to download
Introduction

This is an automatic system to make characters sheathe their weapons when they change from war to peace mode. It will also reequip their last used weapon when they get back to war mode.

Installation

You can put this into your shard in 2 easy steps:

1. Drop this script somewhere in your Scripts folder.

2. Open PlayerMobile.cs and find:
C#:
public override void OnWarmodeChanged()
{
    if (!Warmode)
        Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(RecoverAmmo));
}

There, you just need to add the function "AutoSheatheWeapon.From(this)".
Now your method should look like this:
C#:
public override void OnWarmodeChanged()
{
    if (!Warmode)
        Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(RecoverAmmo));
 
    AutoSheatheWeapon.From(this);
}

Configuration

You can configure the items that should not be unequiped when changing warmode. By default, the system will keep all kind of shields and spellbooks. You can easily add or remove type of items to keep equiped on the top of the script:
C#:
private static Type[] ItemTypesToKeepEquiped = new Type[]
{
    typeof(BaseShield),
    typeof(Spellbook)
};

You can also enable or disable some features at the top of the script:
C#:
public static class Config
{
    public static bool SendOverheadMessage = true; // Should we send a overhead message to the player about the auto-sheathe?
    public static bool AllowPlayerToggle = true;   // Should we allow player to use a command to toggle the auto-sheathe?
}
Author
Felladrin
Downloads
42
Views
341
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from Felladrin

Latest updates

  1. Added player command: [AutoSheathe

    As suggested by Macil, now player can use the command [AutoSheathe to toggle this feature. You...
  2. Added local overhead message to the player about the auto-sheathe

    As Macil suggested, now the system can send a local overhead message to the player. You can...

Latest reviews

Brilliant little script, works like a charm and will easily add a little extra depth to any role playing shard but can also be enjoyed by any type of shard too! Good job!
Top