public override void OnMapChange(byte old, byte cur) { List <Mobile> list = new List <Mobile>(World.Mobiles.Values); for (int i = 0; i < list.Count; i++) { Mobile m = list[i]; if (m != this && m.Map != cur) { m.Remove(); } } list = null; World.Items.Clear(); for (int i = 0; i < Contains.Count; i++) { Item item = (Item)Contains[i]; World.AddItem(item); item.Contains.Clear(); } if (Config.GetBool("AutoSearch") && Backpack != null) { PlayerData.DoubleClick(Backpack); } }
public override void OnMapChange(byte old, byte cur) { ArrayList list = new ArrayList(World.Mobiles.Values); for (int i = 0; i < list.Count; i++) { Mobile m = (Mobile)list[i]; if (m != this && m.Map != cur) { m.Remove(); } } World.Items.Clear(); Counter.Reset(); for (int i = 0; i < Contains.Count; i++) { Item item = (Item)Contains[i]; World.AddItem(item); item.Contains.Clear(); } if (Config.GetBool("AutoSearch") && Backpack != null) { PlayerData.DoubleClick(Backpack); } ClientCommunication.PostMapChange(cur); if (Engine.MainWindow != null && Engine.MainWindow.MapWindow != null) { Engine.MainWindow.MapWindow.PlayerMoved(); } }
//private UOEntity m_LastCtxM = null; //public UOEntity LastContextMenu { get { return m_LastCtxM; } set { m_LastCtxM = value; } } public bool UseItem(Item cont, ushort find) { if (!Client.Instance.AllowBit(FeatureBit.PotionHotkeys)) { return(false); } for (int i = 0; i < cont.Contains.Count; i++) { Item item = (Item)cont.Contains[i]; if (item.ItemID == find) { PlayerData.DoubleClick(item); return(true); } else if (item.Contains != null && item.Contains.Count > 0) { if (UseItem(item, find)) { return(true); } } } return(false); }
internal override void OnMapChange(byte old, byte cur) { // RazorEnhanced.ToolBar.ChangingMap = true; List <Mobile> list = new List <Mobile>(World.Mobiles.Values); foreach (Mobile t in list) { if (t != this && t.Map != cur) { t.Remove(); } } List <Item> itemlist = new List <Item>(World.Items.Values); foreach (Item i in itemlist) { if (i.RootContainer != World.Player) { i.Remove(); } } // World.Items.Clear(); //Counter.Reset(); // foreach (Item t in Contains) // { // World.AddItem(t); //t.Contains.Clear(); // } if (RazorEnhanced.Settings.General.ReadBool("AutoSearch") && Backpack != null) { PlayerData.DoubleClick(Backpack); } ClientCommunication.PostMapChange(cur); //RazorEnhanced.ToolBar.ChangingMap = false; }
internal override void OnMapChange(byte old, byte cur) { List <Mobile> list = new List <Mobile>(World.Mobiles.Values); foreach (Mobile t in list) { if (t != this && t.Map != cur) { t.Remove(); } } List <Item> itemlist = new List <Item>(World.Items.Values); foreach (Item i in itemlist) { if (i.RootContainer != World.Player) { i.Remove(); } } /* World.Items.Clear(); * for (int i = 0; i < Contains.Count; i++) * { * Item item = (Item)Contains[i]; * World.AddItem(item); * item.Contains.Clear(); * }*/ if (RazorEnhanced.Settings.General.ReadBool("AutoSearch") && Backpack != null) { PlayerData.DoubleClick(Backpack); } Assistant.UOAssist.PostMapChange(cur); m_HandCheck.Start(); }
public static void FullRecount() { Reset(); if (World.Player != null) { SupressWarnings = true; if (World.Player.Backpack != null) { while (World.Player.Backpack.Contains.Count > 0) { ((Item)World.Player.Backpack.Contains[0]).Remove(); } PacketHandlers.IgnoreGumps.Add(World.Player.Backpack); PlayerData.DoubleClick(World.Player.Backpack); } if (World.Player.Quiver != null) { while (World.Player.Quiver.Contains.Count > 0) { ((Item)World.Player.Quiver.Contains[0]).Remove(); } PacketHandlers.IgnoreGumps.Add(World.Player.Quiver); PlayerData.DoubleClick(World.Player.Quiver); } if (!Config.GetBool("AutoSearch")) { World.Player.SendMessage(MsgLevel.Info, LocString.NoAutoCount); } SupressWarnings = false; } }
public override void OnMapChange(byte old, byte cur) { List <Mobile> list = new List <Mobile>(World.Mobiles.Values); for (int i = 0; i < list.Count; i++) { Mobile m = list[i]; if (m != this && m.Map != cur) { m.Remove(); } } list = null; World.Items.Clear(); Counter.Reset(); for (int i = 0; i < Contains.Count; i++) { Item item = (Item)Contains[i]; World.AddItem(item); item.Contains.Clear(); } if (Config.GetBool("AutoSearch") && Backpack != null) { PlayerData.DoubleClick(Backpack); } UOAssist.PostMapChange(cur); if (Engine.MainWindow != null && Engine.MainWindow.MapWindow != null) { Engine.MainWindow.SafeAction(s => s.MapWindow.PlayerMoved()); } }
public bool UpdateContainer() { if (!(m_Parent is Serial) || Deleted) { return(true); } object o = null; Serial contSer = (Serial)m_Parent; if (contSer.IsItem) { o = World.FindItem(contSer); } else if (contSer.IsMobile) { o = World.FindMobile(contSer); } if (o == null) { return(false); } m_Parent = o; if (m_Parent is Item) { ((Item)m_Parent).AddItem(this); } else if (m_Parent is Mobile) { ((Mobile)m_Parent).AddItem(this); } if (World.Player != null && (IsChildOf(World.Player.Backpack) || IsChildOf(World.Player.Quiver))) { bool exempt = SearchExemptionAgent.IsExempt(this); if (!exempt) { Counter.Count(this); } if (m_IsNew) { if (m_AutoStack) { AutoStackResource(); } if (IsContainer && !exempt && (!IsPouch || !Config.GetBool("NoSearchPouches")) && Config.GetBool("AutoSearch")) { PacketHandlers.IgnoreGumps.Add(this); PlayerData.DoubleClick(this); for (int c = 0; c < Contains.Count; c++) { Item icheck = (Item)Contains[c]; if (icheck.IsContainer && !SearchExemptionAgent.IsExempt(icheck) && (!icheck.IsPouch || !Config.GetBool("NoSearchPouches"))) { PacketHandlers.IgnoreGumps.Add(icheck); PlayerData.DoubleClick(icheck); } } } } } m_AutoStack = m_IsNew = false; return(true); }
internal bool UpdateContainer() { if (!(m_Parent is Serial) || Deleted) { return(true); } object o = null; Serial contSer = (Serial)m_Parent; if (contSer.IsItem) { o = World.FindItem(contSer); } else if (contSer.IsMobile) { o = World.FindMobile(contSer); } if (o == null) { return(false); } m_Parent = o; if (m_Parent is Item) { ((Item)m_Parent).AddItem(this); } else if (m_Parent is Mobile) { ((Mobile)m_Parent).AddItem(this); } if (World.Player != null && (IsChildOf(World.Player.Backpack) || IsChildOf(World.Player.Quiver))) { if (m_IsNew) { if (m_AutoStack) { AutoStackResource(); } if (IsContainer && (!IsPouch || !RazorEnhanced.Settings.General.ReadBool("NoSearchPouches")) && RazorEnhanced.Settings.General.ReadBool("AutoSearch")) { PacketHandlers.IgnoreGumps.Add(this); PlayerData.DoubleClick(this); foreach (Item icheck in Contains) { if (icheck.IsContainer && (!icheck.IsPouch || !RazorEnhanced.Settings.General.ReadBool("NoSearchPouches"))) { PacketHandlers.IgnoreGumps.Add(icheck); PlayerData.DoubleClick(icheck); } } } } } m_AutoStack = m_IsNew = false; return(true); }