Auto Sheathe Weapon

Auto Sheathe Weapon 1.4.0

Author
Felladrin
Downloads
43
Views
1,795
First release
Last update
Rating
0.00 star(s) 0 ratings
No permission to download Join the discussion More information

More resources from Felladrin

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:
Code:
public override void OnWarmodeChanged()
{
    if (!Warmode)
    {
        Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(RecoverAmmo));
    }
}

There, you just need to add the function Felladrin.Automations.AutoSheatheWeapon.From(this). Now your method should look like this:
Code:
public override void OnWarmodeChanged()
{
    Felladrin.Automations.AutoSheatheWeapon.From(this);

    if (!Warmode)
    {
        Timer.DelayCall(TimeSpan.FromSeconds(10), new TimerCallback(RecoverAmmo));
    }
}

Configuration

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

You can also enable or disable some features at the top of the script:
Code:
bool Enabled = true;                // Is this system enabled?
bool SendOverheadMessage = true;    // Should we send a overhead message to the player about the auto-sheathe?
bool AllowPlayerToggle = true;      // Should we allow player to use a command to toggle the auto-sheathe?

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back