private void Cast() { if (RazorEnhanced.Settings.General.ReadBool("SpellUnequip")) { Item pack = World.Player.Backpack; if (pack != null) { // dont worry about uneqipping RuneBooks or SpellBooks Item item = World.Player.GetItemOnLayer(Layer.RightHand); #if DEBUG if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield) #else if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA) #endif { DragDropManager.Drag(item, item.Amount); DragDropManager.Drop(item, pack); } item = World.Player.GetItemOnLayer(Layer.LeftHand); #if DEBUG if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield) #else if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA) #endif { DragDropManager.Drag(item, item.Amount); DragDropManager.Drop(item, pack); } } } ClientCommunication.PostSpellCast(this.Number); if (World.Player != null) { World.Player.LastSpell = GetID(); LastCastTime = DateTime.Now; Targeting.SpellTargetID = 0; } }
private void Cast() { if (Config.GetBool("SpellUnequip") && ClientCommunication.AllowBit(FeatureBit.UnequipBeforeCast)) { Item pack = World.Player.Backpack; if (pack != null) { // dont worry about uneqipping RuneBooks or SpellBooks Item item = World.Player.GetItemOnLayer(Layer.RightHand); #if DEBUG if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield) #else if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA) #endif { DragDropManager.Drag(item, item.Amount); DragDropManager.Drop(item, pack); } item = World.Player.GetItemOnLayer(Layer.LeftHand); #if DEBUG if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA && !item.IsVirtueShield) #else if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA) #endif { DragDropManager.Drag(item, item.Amount); DragDropManager.Drop(item, pack); } } } for (int i = 0; i < Counter.List.Count; i++) { ((Counter)Counter.List[i]).Flag = false; } if (Config.GetBool("HighlightReagents")) { for (int r = 0; r < Reagents.Length; r++) { for (int i = 0; i < Counter.List.Count; i++) { Counter c = (Counter)Counter.List[i]; if (c.Enabled && c.Format.ToLower() == Reagents[r]) { c.Flag = true; break; } } } if (m_UnflagTimer != null) { m_UnflagTimer.Stop(); } else { m_UnflagTimer = new UnflagTimer(); } m_UnflagTimer.Start(); } ClientCommunication.RequestTitlebarUpdate(); ClientCommunication.PostSpellCast(this.Number); if (World.Player != null) { World.Player.LastSpell = GetID(); LastCastTime = DateTime.Now; Targeting.SpellTargetID = 0; } }