Repository navigation
ZH TW API UO Mount
Bad Newbie edited this page Oct 16, 2026
·
3 revisions
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
int UO.Mount();
int UO.Mount(object? mount);Mount 與 Dismount 直接傳送使用物件請求,不需要手動雙擊,也不會套用戰鬥模式攻擊行為。int 是 Mount 層目前物品的 serial,並非成功旗標。伺服器回覆是非同步的:Mount 可能仍回傳 0,Dismount 可能回傳移除前的 serial。請在回覆後檢查 ObjAtLayer("Mount")。
-
mount— 坐騎序號;省略時使用最後目標。
每個程式碼區塊都是完整的獨立 .csx。請替換範例 serial、type 與座標;參數順序及 C# 具名參數依照簽章。
#mount 0x00001234
#mount
每個程式碼區塊都是完整的獨立 .csx。請替換範例 serial、type 與座標;參數順序及 C# 具名參數依照簽章。
int mountLayerSerial = UO.Mount(0x00001234);
UO.Print(UO.Int2Hex(mountLayerSerial));int currentSerial = UO.Mount();
UO.Print(UO.Int2Hex(currentSerial));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);
}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));
}
}CSharpGameApi.Mount
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.Mount
ClassicUOInjectionApiBridge -> NativeMountController.Request
-> OutgoingPackets.Send_UseObjectRequest (0x06)
-> MountedLayerSerialUnsafe -> Player.FindItemByLayer(Layer.Mount)
ClassicUO — Bad Newbie & C# Scripts IDE