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(); } }
public override void OnPositionChanging(Point3D newPos) { int visRange = 18; //Configuration.GetInt( "VisRange" ); ArrayList list = new ArrayList(World.Mobiles.Values); for (int i = 0; i < list.Count; i++) { Mobile m = (Mobile)list[i]; if (m != this && Utility.Distance(m.Position, newPos) > visRange) { m.Remove(); } } list = new ArrayList(World.Items.Values); for (int i = 0; i < list.Count; i++) { Item item = (Item)list[i]; if (item.Deleted || item.Container != null) { continue; } int dist = Utility.Distance(item.GetWorldPosition(), newPos); if (item != this.Holding && dist > visRange) { item.Remove(); } } base.OnPositionChanging(newPos); }
public override void OnPositionChanging(Point3D newPos) { List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values); for (int i = 0; i < mlist.Count; i++) { Mobile m = mlist[i]; if (m != this) { if (!Utility.InRange(m.Position, newPos, VisRange)) { m.Remove(); } else { Targeting.CheckLastTargetRange(m); } } } mlist = null; List <Item> ilist = new List <Item>(World.Items.Values); ScavengerAgent s = ScavengerAgent.Instance; for (int i = 0; i < ilist.Count; i++) { Item item = ilist[i]; if (item.Deleted || item.Container != null) { continue; } int dist = Utility.Distance(item.GetWorldPosition(), newPos); if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange))) { item.Remove(); } else if (!IsGhost && Visible && dist <= 2 && s.Enabled && item.Movable) { s.Scavenge(item); } } ilist = null; base.OnPositionChanging(newPos); }
public override void OnPositionChanging(Point3D oldPos) { AutoOpenDoors(); List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values); for (int i = 0; i < mlist.Count; i++) { Mobile m = mlist[i]; if (m != this) { if (!Utility.InRange(m.Position, Position, VisRange)) { m.Remove(); } else { Targeting.CheckLastTargetRange(m); } } } mlist = null; List <Item> ilist = new List <Item>(World.Items.Values); for (int i = 0; i < ilist.Count; i++) { Item item = ilist[i]; if (item.Deleted || item.Container != null) { continue; } int dist = Utility.Distance(item.GetWorldPosition(), Position); if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange))) { item.Remove(); } } ilist = null; base.OnPositionChanging(oldPos); }
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(); for (int i = 0; i < Contains.Count; i++) { Item item = (Item)Contains[i]; World.AddItem(item); item.Contains.Clear(); } }
private static void RemoveObject(PacketReader p) { Serial serial = p.ReadUInt32(); if (serial.IsMobile) { Mobile m = World.FindMobile(serial); if (m != null && m != World.Player) { m.Remove(); } } else if (serial.IsItem) { Item i = World.FindItem(serial); if (i != null) { i.Remove(); } } }
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 override void OnPositionChanging(Point3D oldPos) { if (!IsGhost) { StealthSteps.OnMove(); } AutoOpenDoors(false); List <Mobile> mlist = new List <Mobile>(World.Mobiles.Values); for (int i = 0; i < mlist.Count; i++) { Mobile m = mlist[i]; if (m != this) { if (!Utility.InRange(m.Position, Position, VisRange)) { m.Remove(); } else { Targeting.CheckLastTargetRange(m); } } } mlist = null; List <Item> ilist = new List <Item>(World.Items.Values); ScavengerAgent s = ScavengerAgent.Instance; for (int i = 0; i < ilist.Count; i++) { Item item = ilist[i]; if (item.Deleted || item.Container != null) { continue; } int dist = Utility.Distance(item.GetWorldPosition(), Position); if (item != DragDropManager.Holding && (dist > MultiVisRange || (!item.IsMulti && dist > VisRange))) { item.Remove(); } else if (!IsGhost && Visible && dist <= 2 && s.Enabled && item.Movable) { s.Scavenge(item); } } ilist = null; if (Engine.MainWindow != null && Engine.MainWindow.MapWindow != null) { Engine.MainWindow.SafeAction(f => f.MapWindow.PlayerMoved()); } base.OnPositionChanging(oldPos); }