public ExperienceChecker(Kernel kernel) { this.Client = kernel.Client; _Active = false; ExperienceTimer = new Timer(1000, -1); ExperienceTimer.Execute += ExperienceTimer_Execute; }
private void FormatLabel(Tibia.Features.Model.Graphics.Sqm sqm, LabelControl label) { if (!sqm.Walkeable()) { label.Appearance.BackColor = Color.Silver; label.Appearance.BorderColor = Color.Gray; label.Appearance.ForeColor = Color.WhiteSmoke; //label.Cursor = Cursors.Help; } else if (sqm.GoUP()) { label.Appearance.BackColor = Color.LightGreen; label.Appearance.BorderColor = Color.LimeGreen; label.Appearance.ForeColor = Color.ForestGreen; //label.Cursor = Cursors.PanNorth; } else if (sqm.GoDown()) { label.Appearance.BackColor = Color.DarkSeaGreen; label.Appearance.BorderColor = Color.DarkOliveGreen; label.Appearance.ForeColor = Color.DarkGreen; //label.Cursor = Cursors.PanSouth; } else if (sqm.HasPlayer()) { label.Appearance.BackColor = Color.PaleTurquoise; label.Appearance.BorderColor = Color.LightSeaGreen; label.Appearance.ForeColor = Color.DarkSlateGray; //label.Cursor = Cursors.Hand; } else { label.Appearance.BackColor = Color.White; label.Appearance.BorderColor = Color.Black; label.Appearance.ForeColor = Color.LightGray; //label.Cursor = Cursors.No; } }
private void Pipe_OnSocketSend(Tibia.Packets.NetworkMessage msg) { int length = msg.GetUInt16(); if (msg.GetByte() == (byte)PipePacketType.HookSentPacket) { byte[] buf = new byte[msg.Data.Length - 3]; Array.Copy(msg.Data, 3, buf, 0, buf.Length); ProcessFromClient(buf); } }
private void Pipe_OnIconClick(Tibia.Packets.NetworkMessage msg) { msg.Position = 3; if (Click != null) Click.BeginInvoke((int)msg.GetUInt32(), null, null); }
/// <summary> /// Handles the LocationChanged event of the Creature control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="KTibiaX.Analyzer.Events.LocationEventArgs"/> instance containing the event data.</param> private void Creature_LocationChanged(object sender, Tibia.Features.Events.LocationEventArgs e) { this.Location = e.Location; }
private void Connection_PacketChanged(object sender, Tibia.Connection.Events.PacketEventArgs e) { PacketSource.Add(new PacketDTO(e.Packet, e.Source.ToString())); gridControl1.RefreshDataSource(); this.BeginInvoke(new Callback(delegate() { bandedGridView1.MakeRowVisible(PacketSource.Count - 1, false); })); }
bool Proxy_ReceivedTileAddThingIncomingPacket(Tibia.Packets.IncomingPacket packet) { TileAddThingPacket p = (TileAddThingPacket)packet; if (Enabled && Looting && OpenBodies != OpenBodyRule.None) { if (p.Item != null && (OpenDistantBodies || p.Location.IsAdjacent())) { if (p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsContainer) && p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsCorpse) && p.Location.Z == Core.Player.Z) { if (OpenBodies == OpenBodyRule.All) { LootBodies.Add(p.Location); } else { if (lastBody.IsValid()) { LootBodies.Add(lastBody); lastBody = Location.Invalid; } lastBody = p.Location; } } } } return true; }
bool Proxy_ReceivedTextMessageIncomingPacket(Tibia.Packets.IncomingPacket packet) { if (Enabled && Looting && lastBody.IsValid()) { TextMessagePacket p = (TextMessagePacket)packet; if (OpenBodies == OpenBodyRule.Allowed) { LootBodies.Add(lastBody); lastBody = Location.Invalid; } else { if (EatFromMonsters) { foreach (var item in ItemLists.Foods) { if (p.Message.ToLower().Contains(item.Value.Name.ToLower())) { LootBodies.Add(lastBody); lastBody = Location.Invalid; return true; } } } foreach (LootItem item in LootItems) { if (p.Message.ToLower().Contains(item.Description.ToLower())) { LootBodies.Add(lastBody); lastBody = Location.Invalid; return true; } } } lastBody = Location.Invalid; } return true; }
bool _proxy_ReceivedTileAddThingIncomingPacket(Tibia.Packets.IncomingPacket packet) { if (_autoOpenBodys) { TileAddThingPacket p = (TileAddThingPacket)packet; if (p.Item != null && p.Location.DistanceTo(_client.GetPlayer().Location) <= 3) { if (p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsContainer) && p.Item.GetFlag(Tibia.Addresses.DatItem.Flag.IsCorpse)) { p.Item.OpenAsContainer((byte)_client.Inventory.GetContainers().Count()); } } } return true; }
/// <summary> /// Handles the PacketChanged event of the Connection control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="Tibia.Connection.Events.PacketEventArgs"/> instance containing the event data.</param> private void Connection_PacketChanged(object sender, Tibia.Connection.Events.PacketEventArgs e) { if (e.Packet.PacketSource != PacketSource.Server && e.Packet.InType != IncomingPacketType.ChatMessage) { return; } KeyValuePair<string, string> message = Tibia.Features.Actions.Messages.Helper.GetArivedMsgInfo(e.Packet.Data); if (string.IsNullOrEmpty(message.Value)) { return; } if (!message.Value.Contains(Messages)) { return; } if (message.Key != Player.Name && LastMessageText.ToLower() != message.Value.ToLower()) { LastMessageText = message.Value; TibiaClient.Actions.Message.Server.Private(Player.Name, "[" + message.Key + "] - " + message.Value); } }
public void WriteTileCoords(Tibia.Objects.Location loc) { WriteByte((byte)loc.X); WriteByte((byte)loc.Y); }
public void WriteTileAreaCoords(Tibia.Objects.Location loc) { WriteUInt16((UInt16)(loc.X & 0xFF00)); WriteUInt16((UInt16)(loc.Y & 0xFF00)); WriteByte((byte)loc.Z); }
static bool proxy_ReceivedSelfAppearIncomingPacket(Tibia.Packets.IncomingPacket packet) { Tibia.Objects.Player p = kernel.Client.GetPlayer(); if (p == null) throw new Exception("Unable to set the Tibia client title, not logged in."); kernel.Client.Window.Title = string.Format(Kernel.TitleFormat, ProductName, p.Name); return true; }