KO API UO Mount - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
ะฃะบัะฐัะฝััะบะฐ ยท ะ ัััะบะธะน ยท English ยท Deutsch ยท Franรงais ยท Italiano ยท Espaรฑol ยท ็น้ซไธญๆ ยท ๆฅๆฌ่ช ยท ํ๊ตญ์ด
UO.Mount
C# ์๊ทธ๋์ฒ
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
์์ ํ C# ์์
๊ฐ ์ฝ๋ ๋ธ๋ก์ ์์ ํ ๋ ๋ฆฝ .csx์ ๋๋ค. ์์ serial, type๊ณผ ์ขํ๋ฅผ ๋ฐ๊พธ์ธ์. ์ธ์ ์์์ C# ๋ช ๋ช ๋ ์ธ์๋ ์๊ทธ๋์ฒ๋ฅผ ๋ฐ๋ฆ ๋๋ค.
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));
}
}
๋ด๋ถ ํธ์ถ
CSharpGameApi.Mount
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.Mount
ClassicUOInjectionApiBridge -> NativeMountController.Request
-> OutgoingPackets.Send_UseObjectRequest (0x06)
-> MountedLayerSerialUnsafe -> Player.FindItemByLayer(Layer.Mount)