Example #1
0
        public static void ToggleMounted()
        {
            PlayerMobile player = Engine.Player;

            if (player == null)
            {
                return;
            }

            if (player.IsMounted)
            {
                ObjectCommands.UseObject(player.Serial);
                return;
            }

            if (!AliasCommands.FindAlias("mount"))
            {
                int serial = UOC.GetTargetSerialAsync(Strings.Target_new_mount___).Result;

                if (serial == -1)
                {
                    UOC.SystemMessage(Strings.Invalid_mount___);
                    return;
                }

                AliasCommands.SetAlias("mount", serial);
            }

            int mountSerial = AliasCommands.GetAlias("mount");

            ObjectCommands.UseObject(mountSerial);
        }