///////////////////////////////////////////////////////////////////////// // // www.ultima.smoce.net // Name: War/Pal - Equip/UnEquip // ///////////////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using Phoenix; using Phoenix.WorldData; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Runtime.InteropServices; using Phoenix.Gui; namespace Scripts.DarkParadise { public class equips { [Executable] public void equip() { ushort[] invulko = new ushort[7]; invulko[0] = 0x1411; // Layer: InnerLegs invulko[1] = 0x1415; // Layer: InnerTorso invulko[2] = 0x1410; // Layer: Arms invulko[3] = 0x1414; // Layer: Gloves invulko[4] = 0x1412; // Layer: Hat invulko[5] = 0x1413; // Layer: Neck invulko[6] = 0x1B76; // Layer: LeftHand for (int i = 0; i < invulko.Length; i++) { if (over_existenci(invulko[i])) { UO.EquipItem(over_serial(invulko[i])); UO.Print(0x024D, "Nasazuji Equip - {0} z {1}", i, invulko.Length); UO.Wait(50); } } } public static bool over_existenci(ushort type) { UOItem overime_existenci_casti_tela = World.Player.Backpack.AllItems.FindType(type); return overime_existenci_casti_tela.Exist; } public static Serial over_serial(ushort type) { UOItem overime_existenci_casti_telas = World.Player.Backpack.AllItems.FindType(type); return overime_existenci_casti_telas.Serial; } [Executable] public void unequip() { Layer[] impes = new Layer[7]; impes[0] = Layer.InnerLegs; // Layer: InnerLegs impes[1] = Layer.InnerTorso; // Layer: InnerTorso impes[2] = Layer.Arms; // Layer: Arms impes[3] = Layer.Gloves; // Layer: Gloves impes[4] = Layer.Hat; // Layer: Hat impes[5] = Layer.Neck; // Layer: Neck impes[6] = Layer.LeftHand; // Layer: LeftHand for (int i = 0; i < impes.Length; i++) { if (sundat_existujici(impes[i])) { sundat_layers(impes[i]); } } } public static bool sundat_existujici(Layer type) { UOItem overimasd = World.Player.Layers[type] ; return overimasd.Exist; } public static void sundat_layers(Layer type) { UO.MoveItem(World.Player.Layers[type].Serial, 1, World.Player.Backpack); UO.Wait(50); } } }