public static void SwitchSlotKlamak() { if (Current == null) { MobMaster.ExecMoveKlamakNext(1); return; } if (Current.InvokeRequired) { Current.BeginInvoke(new ThreadStart(SwitchSlotKlamak)); return; } lock (SyncRoot) { int selIndex = 0; List <int> possible = new List <int>(); for (int i = 0; i < SlotKeyList.Count; i++) { SlotItem sl = Slots[SlotKeyList[i]]; if (sl.SlotType != "Klamak") { continue; } if (sl.Control.Selected) { selIndex = i; sl.Control.Selected = false; } if (!sl.IsEmpty && sl.Selectable && sl.Exist) { possible.Add(i); } } if (possible.Count > 0) { for (int i = 0; i < possible.Count; i++) { int curr = possible[i]; if (curr > selIndex) { SlotItem s = Slots[SlotKeyList[curr]]; s.Control.Selected = true; if (!String.IsNullOrEmpty(s.ItemName)) { World.Player.PrintMessage("[ " + s.ItemName + "]"); } //EquipSlotWeapon(Slots[SlotKeyList[curr]]); return; } } for (int i = 0; i < possible.Count; i++) { int curr = possible[i]; if (curr <= selIndex) { SlotItem s = Slots[SlotKeyList[curr]]; s.Control.Selected = true; if (!String.IsNullOrEmpty(s.ItemName)) { World.Player.PrintMessage("[ " + s.ItemName + "]"); } //EquipSlotWeapon(Slots[SlotKeyList[curr]]); return; } } } } }
public static void UseSlotKlamak() { if (Current == null) { MobMaster.ExecVyhodKlamak(); return; } if (Current.InvokeRequired) { Current.BeginInvoke(new ThreadStart(UseSlotKlamak)); return; } SlotItem slot = null; lock (SyncRoot) { for (int i = 0; i < SlotKeyList.Count; i++) { SlotItem sl = Slots[SlotKeyList[i]]; if (sl.SlotType != "Klamak") { continue; } if (sl.Control.Selected) { slot = sl; break; } } if (slot == null || !slot.Exist) { for (int i = 0; i < SlotKeyList.Count; i++) { SlotItem sl = Slots[SlotKeyList[i]]; if (sl.SlotType != "Klamak") { continue; } if (!sl.IsEmpty && sl.Exist) { slot = sl; break; } } } } if (slot != null && slot.Exist) { Game.RunScriptCheck(650); World.Player.PrintMessage("[ " + slot.ItemName + " ]"); Game.CurrentGame.CurrentPlayer.SwitchWarmode(); slot.Item.Use(); MobMaster.LasTimeUseKlamak = DateTime.Now; //itemKlamak.Use(); } }