private static void MainFormEx_Connected() { if (ConfigEx.GetAttribute(false, "enabled", "Status")) { new StatusBar(Serial.MinusOne).Show(); } }
protected override void Save() { ConfigEx.SetAttribute(Location.X, "locX", "Radar"); ConfigEx.SetAttribute(Location.Y, "locY", "Radar"); ConfigEx.SetAttribute(Width, "sizeW", "Radar"); ConfigEx.SetAttribute(Height, "sizeH", "Radar"); }
private static void MainFormEx_Connected() { if (ConfigEx.GetAttribute(false, "enabled", "Radar")) { new Radar().Show(); } }
private void addTarget(bool location, Serial serial, Point3D p, ushort gfxid) { Mobile mobile = World.FindMobile(serial); if (mobile != null && !string.IsNullOrEmpty(mobile.Name)) { CorpseItem corpse = new CorpseItem(mobile.Body, mobile.Name); if (items.Find(c => c.ItemID == corpse.ItemID) == null) { items.Add(corpse); listBox.Items.Add(corpse); XElement parent = ConfigEx.GetXElement(true, "Carving"); parent.RemoveAll(); parent.SetAttributeValue("enabled", enabled); foreach (CorpseItem item in items) { parent.Add(new XElement("Corpse", new XAttribute("itemID", item.ItemID.Value.ToString("X4")), item.Name)); } } } else { WorldEx.SendMessage("Invalid target"); } }
private static void WorldItem(PacketReader p, PacketHandlerEventArgs args) { Item item = World.FindItem(p.ReadUInt32() & 0x7FFFFFFF); if (item == null || item.ItemID != 0x2006 || item.DistanceTo(World.Player) > 2 || items.Find(c => c.ItemID == item.Amount) == null) { return; } Item carver = World.FindItem(ConfigEx.GetElement <uint>(0, "BoneCarver")); carved.RemoveAll(i => !World.Items.ContainsKey(i)); if (carver != null && !carved.Contains(item.Serial)) { Targeting.CancelTarget(); Targeting.QueuedTarget = () => { Targeting.Target(item); carved.Add(item.Serial); return(true); }; WorldEx.SendToServer(new DoubleClick(carver.Serial)); } }
private SkillIcon(SkillName skill) { this.skill = skill; table.Controls.Add(new LabelEx(skill.ToString(), ConfigEx.GetElement(8, "SkillIconSize"))); Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Skills", skill.ToString()), ConfigEx.GetAttribute(Location.Y, "locY", "Skills", skill.ToString())); }
public static void OnInit() { Command.Register("sosadd", args => Targeting.OneTimeTarget(OnAdd)); Command.Register("sosload", args => MoveNext()); Command.Register("sosclear", OnClear); Command.Register("sosclean", OnClean); Command.Register("sosstats", OnStats); Command.Register("sosexport", OnExport); Command.Register("sosget", OnGet); Command.Register("sosnear", OnNear); PacketHandler.RegisterServerToClientViewer(0x25, ContainerContentUpdate); Fixes.SOS.OnGump += SOS_OnGump; foreach (string[] line in ConfigEx.LoadCfg("sos", 3)) { SOSInfo info = new SOSInfo { Location = Point3D.Parse(line[2]) }; if (!string.IsNullOrEmpty(line[1])) { info.Felucca = bool.Parse(line[1]); } list.Add(Serial.Parse(line[0]), info); } }
public static void AfterInit() { ConfigAgent.AddItem(false, "PotionStack"); if (!ConfigEx.GetElement(false, "PotionStack")) { return; } AddFakeItem("Revitalize", 0x0F06, 0x000C, 0x0F0E, 0x000C); AddFakeItem("TMR", 0x0F0B, 0x012E, 0x0F0E, 0x012E); AddFakeItem("MR", 0x0F0B, 0x0130, 0x0F0E, 0x005F); AddFakeItem("GH", 0x0F0C, 0x0000, 0x0F0E, 0x0035); liftRequest = (ArrayList)PacketHandler.m_ClientViewers[7]; PacketHandler.m_ClientViewers[7] = new ArrayList(new PacketViewerCallback[] { LiftRequest }); dropRequest = (ArrayList)PacketHandler.m_ClientViewers[8]; PacketHandler.m_ClientViewers[8] = new ArrayList(new PacketViewerCallback[] { DropRequest }); clientDoubleClick = (ArrayList)PacketHandler.m_ClientViewers[6]; PacketHandler.m_ClientViewers[6] = new ArrayList(new PacketViewerCallback[] { ClientDoubleClick }); PacketHandler.RegisterClientToServerViewer(9, ClientSingleClick); PacketHandler.RegisterServerToClientFilter(0x25, ContainerContentUpdate); PacketHandler.RegisterServerToClientFilter(0x3C, ContainerContent); PacketHandler.RegisterClientToServerViewer(0x6C, TargetResponse); Event.RemoveObject += Event_RemoveObject; }
private Chat() { LabelEx label = new LabelEx("Chat", 12, style: FontStyle.Bold | FontStyle.Underline); CheckBox check = new CheckBox { AutoSize = true, Checked = textBox.AutoScroll, Dock = DockStyle.Fill }; check.CheckedChanged += (s, e) => textBox.AutoScroll = check.Checked; table.Controls.Add(check, 0, 0); table.Controls.Add(label, 1, 0); table.SetColumnSpan(textBox, 2); table.Controls.Add(textBox, 0, 1); ConfigEx.SetAttribute(true, "enabled", "Chat"); AutoSize = false; AutoSizeMode = AutoSizeMode.GrowOnly; Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Chat"), ConfigEx.GetAttribute(Location.Y, "locY", "Chat")); Size = new Size(ConfigEx.GetAttribute(Size.Width, "sizeW", "Chat"), ConfigEx.GetAttribute(Size.Height, "sizeH", "Chat")); Event.ASCIIMessage += Event_ASCIIMessage; Event.UnicodeMessage += Event_UnicodeMessage; PacketHandler.RegisterServerToClientViewer(0xBF, OnPartySpeech); instance = this; MainFormEx.Disconnected -= Close; MainFormEx.Disconnected += () => { Hidden = true; Hide(); }; textBox.LinkClicked += textBox_LinkClicked; }
protected override void Save() { ConfigEx.SetAttribute(Location.X, "locX", "Chat"); ConfigEx.SetAttribute(Location.Y, "locY", "Chat"); ConfigEx.SetAttribute(Size.Width, "sizeW", "Chat"); ConfigEx.SetAttribute(Size.Height, "sizeH", "Chat"); }
private static bool IsShitResource(Item item) { if (ConfigEx.GetElement(true, "CleanerResources") && (Array.IndexOf(resources, item.ItemID) != -1 || (item.ItemID == 0x26B4 && item.Hue != 0x08B0 && item.Hue != 0x0A11) || (item.ItemID == 0x1BF2 && item.Hue != 0x0578) || (item.ItemID == 0x19B9 && item.Hue != 0x0A54 && item.Hue != 0x047E)))//chromit a honor { return(true); } if (ConfigEx.GetElement(true, "CleanerFood") && (IsFood(item.ItemID) && (item.ItemID != 0x09B9 || item.Hue != 0x09B7) && (item.ItemID != 0x09C1 || item.Hue != 0x0A3E))) { return(true); } if (ConfigEx.GetElement(true, "CleanerRunics") && IsShitRunic(item) == true) { return(true); } byte min = ConfigEx.GetElement <byte>(30, "CleanerTalismans"); if (item.Hue != 0 || item.ItemID < 0x2F58 || item.ItemID > 0x2F5B || min == 0) { return(false); } foreach (ObjectPropertyList.OPLEntry prop in item.ObjPropList.m_Content) { if ((prop.Number == 1072394 || prop.Number == 1072395) && int.Parse(prop.Args.Split('\t')[1]) >= min) { return(false); } } return(true); }
private static void OnCommand(string[] args) { if (args.Length > 0 && args[0] == "set") { XElement parent = ConfigEx.GetXElement(true, "BackpackOrganizer"); parent.RemoveAll(); foreach (Item item in World.Player.Backpack.Contains) { parent.Add(new XElement("Item", new XAttribute("position", item.Position), item.Serial)); } } else { XElement parent = ConfigEx.GetXElement(true, "BackpackOrganizer"); foreach (XElement element in parent.Elements()) { Serial serial = Serial.Parse(element.Value); Point3D position = Point3D.Parse(element.Attribute("position").Value); Item item = World.FindItem(serial); if (item != null && item.Position != position) { DragDrop.Move(item, World.Player.Backpack, position); } } } }
private static void OnCommand(string[] args) { bool enabled = !ConfigEx.GetElement(false, "BlockFriendlyFire"); ConfigEx.SetElement(enabled, "BlockFriendlyFire"); WorldEx.SendMessage("Friendly fire " + (enabled ? "blocked." : "allowed.")); OnChange(enabled); }
public override bool Perform() { if (ConfigEx.GetElement(false, "FishingTracking") && (Used = !Used)) { skill.Perform(); } return(true); }
protected override void OnMouseRightClick() { if (serial == Serial.MinusOne) { ConfigEx.SetAttribute(false, "enabled", "Status"); } base.OnMouseRightClick(); }
private static void OnCommand(string[] args) { bool enabled = !ConfigEx.GetElement(false, "AutoGrab"); ConfigEx.SetElement(enabled, "AutoGrab"); WorldEx.SendMessage("Autograb " + (enabled ? "enabled." : "disabled.")); OnChange(enabled); }
private static void Save() { using (StreamWriter stream = new StreamWriter(ConfigEx.GetPath("sos"), false)) foreach (KeyValuePair <Serial, SOSInfo> sos in list) { stream.WriteLine("{0};{1};{2}", sos.Key, sos.Value.Felucca.HasValue ? sos.Value.Felucca.ToString() : "", sos.Value.Location); } }
private static void MainFormEx_Connected() { foreach (XElement element in ConfigEx.GetXElement(true, "Skills").Elements()) { SkillName skill; if (Enum.TryParse(element.Name.ToString(), out skill)) { new SkillIcon(skill).Show(); } } }
public override bool Perform() { Item item = World.FindItem(ConfigEx.GetElement <uint>(0, "BoneCarver")); if (item != null) { Targeting.CancelTarget(); WorldEx.SendToServer(new DoubleClick(item.Serial)); } return(true); }
private static void OnExport(string[] args) { using (StreamWriter stream = new StreamWriter(ConfigEx.GetPath("sos.map"), false)) { stream.WriteLine(3); foreach (SOSInfo sos in list.Values.Where(s => s.Felucca.HasValue)) { stream.WriteLine("+sos: {0} {1} {2} sos", sos.Location.X, sos.Location.Y, sos.Felucca == true ? 1 : 2); } } }
protected override void Dispose(bool disposing) { if (serial == Serial.MinusOne) { ConfigEx.SetAttribute(Location.X, "locX", "Status"); ConfigEx.SetAttribute(Location.Y, "locY", "Status"); } Bandages.Changed -= Bandages_Changed; Event.MobileUpdated -= WorldEx_MobileUpdated; base.Dispose(disposing); }
public override bool Perform() { if (!ConfigEx.GetElement(false, "FishingTracking") || !track.Used) { return(true); } ClientCommunication.SendToClient(new CloseGump(World.Player.CurrentGumpI)); ClientCommunication.SendToServer(new GumpResponse(World.Player.CurrentGumpS, World.Player.CurrentGumpI, 1, new int[0], new GumpTextEntry[0])); World.Player.HasGump = false; return(true); }
private StatusBar(Serial serial) { this.serial = serial; table.Padding = new Padding(3); table.Controls.Add(barHP = new Bar(Color.Red)); if (serial == Serial.MinusOne || PacketHandlers.Party.Contains(serial)) { table.Controls.Add(barMana = new Bar(Color.Blue)); table.Controls.Add(barStamina = new Bar(Color.DarkGoldenrod)); if (PacketHandlers.Party.Contains(serial)) { barMana.Text = barStamina.Text = "-"; } } if (serial == Serial.MinusOne) { if (ConfigEx.GetAttribute(false, "ex", "Status")) { table.ColumnCount = 2; table.Controls.Add(labelFoll = new LabelEx("-", margin: 0) { ForeColor = Color.White }); table.Controls.Add(labelWeight = new LabelEx("-", margin: 0) { ForeColor = Color.White }); table.Controls.Add(labelBands = new LabelEx("-", margin: 0) { ForeColor = Color.White }); table.Controls.SetChildIndex(labelFoll, 1); table.Controls.SetChildIndex(labelWeight, 3); table.Controls.SetChildIndex(labelBands, 5); Bandages.Changed += Bandages_Changed; } ConfigEx.SetAttribute(true, "enabled", "Status"); BackColor = Color.Purple; Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Status"), ConfigEx.GetAttribute(Location.Y, "locY", "Status")); UpdateStats(); } else { Mobile mobile = World.FindMobile(serial); if (mobile != null) { WorldEx.SendToServer(new StatusQuery(mobile)); } } Event.MobileUpdated += WorldEx_MobileUpdated; }
private static bool IsSOSCrap(Item item) { if (item.ItemID >= 0x1F2D && item.ItemID <= 0x1F72 && item.Hue == 0)//svitky { return(true); } if (item.ItemID >= 0x0F0F && item.ItemID <= 0x0F30 && item.Hue == 0)//small diamonds { return(true); } return(!ConfigEx.GetElement(false, "LootBigDiamonds") && IsBigDiamonds(item)); }
public FakeItem(string name, ItemID origID, ushort origHue, ItemID newID, ushort newHue) : base(++fakeSerial) { List = new List <Serial>(); Name = name; ItemID = newID; Hue = newHue; OrigID = origID; OrigHue = origHue; Position = new Point3D(ConfigEx.GetAttribute(100, "X", "FakeItems", Name), ConfigEx.GetAttribute(100, "Y", "FakeItems", Name), 0); }
private BuffBar() { table.GrowStyle = TableLayoutPanelGrowStyle.AddColumns; table.RowCount = ConfigEx.GetAttribute(0, "orientation", "BuffBar"); MinimumSize = new Size(30, 30); Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "BuffBar"), ConfigEx.GetAttribute(Location.Y, "locY", "BuffBar")); ConfigEx.SetAttribute(true, "enabled", "BuffBar"); BuffIcons.Added += BuffIcons_Added; BuffIcons.Removed += BuffIcons_Removed; Honor.Start += Honor_Start; Honor.End += Honor_End; Honor.Change += Honor_Change; }
private static void OnGumpResponse(Packet p, PacketHandlerEventArgs args) { p.ReadUInt32(); if (p.ReadUInt32() != gumpID) { return; } uint buttonID = p.ReadUInt32(); if ((buttonID - 2) % 6 == 0) { p.Seek(-4, SeekOrigin.Current); p.Write(buttonID + (uint)ConfigEx.GetElement(TeleportType.Default, "RuneBook")); } }
private static void MainFormEx_Connected() { if (ConfigEx.GetAttribute(false, "enabled", "Chat")) { if (instance != null) { instance.Hidden = false; instance.Show(); } else { new Chat().Show(); } } }
private Radar() { AutoSizeMode = AutoSizeMode.GrowOnly; ConfigEx.SetAttribute(true, "enabled", "Radar"); Location = new Point(ConfigEx.GetAttribute(Location.X, "locX", "Radar"), ConfigEx.GetAttribute(Location.Y, "locY", "Radar")); Size = new Size(ConfigEx.GetAttribute(200, "sizeW", "Radar"), ConfigEx.GetAttribute(200, "sizeH", "Radar")); table.Controls.Add(map); Event.MobileUpdated += Event_MobileUpdated; Event.PlayerMoved += Event_PlayerMoved; PacketHandler.RegisterServerToClientFilter(0xBF, OnMapChange); PacketHandler.RegisterServerToClientFilter(0xF0, OnPartyPosition); timer.Start(); }
private static void Carve(Item item) { Item carver = World.FindItem(ConfigEx.GetElement <uint>(0, "BoneCarver")); carved.RemoveAll(i => !World.Items.ContainsKey(i)); if (carver != null && !carved.Contains(item.Serial)) { Targeting.CancelTarget(); Targeting.QueuedTarget = () => { Targeting.Target(item); carved.Add(item.Serial); return(true); }; WorldEx.SendToServer(new DoubleClick(carver.Serial)); } }