#W# Commands Decorate/GenTeleporter/SignParser tweaked. Added some regions. Mount/Unmount for regions.
This commit is contained in:
parent
3045c83799
commit
8fca4205a0
110 changed files with 974 additions and 68626 deletions
63
Scripts/Commands/StableMount.cs
Normal file
63
Scripts/Commands/StableMount.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class StableMountCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("StableMount", AccessLevel.Player, new CommandEventHandler(StableMount_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("StableMount")]
|
||||
[Description("Forces a player off their mount and bypasses stable limits for zone control.")]
|
||||
public static void StableMount_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
PlayerMobile pm = e.Mobile as PlayerMobile;
|
||||
if (pm != null)
|
||||
{
|
||||
ForceDismountAndStore(pm);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ForceDismountAndStore(PlayerMobile pm)
|
||||
{
|
||||
if (pm == null || !pm.Mounted)
|
||||
return;
|
||||
|
||||
IMount mount = pm.Mount;
|
||||
|
||||
if (mount == null)
|
||||
return;
|
||||
|
||||
if (mount is BaseMount)
|
||||
{
|
||||
BaseMount baseMount = (BaseMount)mount;
|
||||
BaseCreature mountCreature = baseMount as BaseCreature;
|
||||
|
||||
if (mountCreature != null)
|
||||
{
|
||||
baseMount.Rider = null;
|
||||
|
||||
mountCreature.ControlTarget = null;
|
||||
mountCreature.ControlOrder = OrderType.Stay;
|
||||
mountCreature.Internalize();
|
||||
mountCreature.SetControlMaster(null);
|
||||
mountCreature.SummonMaster = null;
|
||||
mountCreature.IsStabled = true;
|
||||
pm.Stabled.Add(mountCreature);
|
||||
//pm.SendMessage("Mounts are not allowed here! Your mount has been tucked away.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mount.Rider = null;
|
||||
pm.SendMessage("Ethereal mounts are not allowed in this zone.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue