- recallne nb runou (pokud ji mate)
- predelany runebook script
hlavicka *.cs
Kód: Vybrat vše
using Phoenix.Communication;
Kód: Vybrat vše
private DateTime requestTime;
private uint? buttonId;
[Command]
public void nbruna()
{
UOItem book = UO.Backpack.AllItems.FindType(0x1F14, 0x0B1D);
if (!book.Exist)
throw new ScriptErrorException("Rune not found");
buttonId = 1;
requestTime = DateTime.Now;
book.Use();
}
[ServerMessageHandler(0xB0)]
public CallbackResult OnGenericGump(byte[] data, CallbackResult prevResult)
{
if (prevResult != CallbackResult.Normal)
return prevResult;
if (buttonId != null && DateTime.Now - requestTime < TimeSpan.FromSeconds(6)) {
uint gumpSerial = ByteConverter.BigEndian.ToUInt32(data, 7);
PacketWriter reply = new PacketWriter(0xB1);
reply.WriteBlockSize();
reply.Write(World.Player.Serial);
reply.Write(gumpSerial);
reply.Write(buttonId.Value);
reply.Write(0);
reply.Write(0);
Core.SendToServer(reply.GetBytes());
buttonId = null;
return CallbackResult.Sent;
}
return CallbackResult.Normal;
}