Skip to content

EN API UO Mount

Bad Newbie edited this page Oct 16, 2026 · 3 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

UO.Mount

C# signatures

int UO.Mount();
int UO.Mount(object? mount);

Behavior and result

Mount and Dismount send a protocol use-object request without a manual double-click or the war-mode attack policy. The int result is the current Mount-layer item serial, not a success flag. Server confirmation is asynchronous: Mount may still return 0 and Dismount may return the serial before removal is confirmed. Read ObjAtLayer("Mount") after the server reply.

Parameters

  • mount — Mount creature serial; omitted means the last target.

Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.

Chat commands

#mount 0x00001234
#mount

Complete C# examples

Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.

1

int mountLayerSerial = UO.Mount(0x00001234);
UO.Print(UO.Int2Hex(mountLayerSerial));

2

int currentSerial = UO.Mount();
UO.Print(UO.Int2Hex(currentSerial));

3

UO.Mount(0x00001234);
for (int attempt = 0; attempt < 40; attempt++)
{
    var serial = UO.ObjAtLayer("Mount");
    if (Convert.ToString(serial) != "0" && Convert.ToString(serial) != "0x00000000")
    {
        UO.Print(Convert.ToString(serial));
        break;
    }
    await WaitAsync(50);
}

4

new CommandSample().Execute(UO);

sealed class CommandSample
{
    public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
    {
        int mountLayerSerial = api.Mount(0x00001234);
        api.Print(api.Int2Hex(mountLayerSerial));
    }
}

Internal calls

CSharpGameApi.Mount
  -> CSharpScriptGlobals
  -> InjectionScript.Runtime.InjectionApiUO.Mount
ClassicUOInjectionApiBridge -> NativeMountController.Request
  -> OutgoingPackets.Send_UseObjectRequest (0x06)
  -> MountedLayerSerialUnsafe -> Player.FindItemByLayer(Layer.Mount)

Sources

ClassicUO · ServUO BaseMount

ClassicUO.Game.Managers.NativeMountController.Request

Clone this wiki locally