コード例 #1
0
 public ExperienceChecker(Kernel kernel)
 {
     this.Client = kernel.Client;
     _Active = false;
     ExperienceTimer = new Timer(1000, -1);
     ExperienceTimer.Execute += ExperienceTimer_Execute;
 }
コード例 #2
0
ファイル: frm_Graphics.cs プロジェクト: alexisjojo/ktibiax
 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;
     }
 }
コード例 #3
0
 public ExperienceChecker(Kernel kernel)
 {
     this.Client              = kernel.Client;
     _Active                  = false;
     ExperienceTimer          = new Timer(1000, -1);
     ExperienceTimer.Execute += ExperienceTimer_Execute;
 }
コード例 #4
0
ファイル: HookProxy.cs プロジェクト: Xileck/tibiaapi
 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);
     }
 }
コード例 #5
0
ファイル: Icon.cs プロジェクト: Xileck/tibiaapi
 private void Pipe_OnIconClick(Tibia.Packets.NetworkMessage msg)
 {
     msg.Position = 3;
     if (Click != null)
         Click.BeginInvoke((int)msg.GetUInt32(), null, null);
 }
コード例 #6
0
ファイル: Creature.cs プロジェクト: alexisjojo/ktibiax
 /// <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;
 }
コード例 #7
0
ファイル: frm_Packets.cs プロジェクト: alexisjojo/ktibiax
 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); }));
 }
コード例 #8
0
ファイル: Looter.cs プロジェクト: Tomaszber93/kedrahcore
        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;
        }
コード例 #9
0
ファイル: Looter.cs プロジェクト: Tomaszber93/kedrahcore
        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;
        }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: Xileck/tibiaapi
        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;
        }
コード例 #11
0
ファイル: frm_TradeHelper.cs プロジェクト: alexisjojo/ktibiax
        /// <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);
            }
        }
コード例 #12
0
ファイル: OtbmMapWriter.cs プロジェクト: BeldenGit/maptracker
 public void WriteTileCoords(Tibia.Objects.Location loc)
 {
     WriteByte((byte)loc.X);
     WriteByte((byte)loc.Y);
 }
コード例 #13
0
ファイル: OtbmMapWriter.cs プロジェクト: BeldenGit/maptracker
 public void WriteTileAreaCoords(Tibia.Objects.Location loc)
 {
     WriteUInt16((UInt16)(loc.X & 0xFF00));
     WriteUInt16((UInt16)(loc.Y & 0xFF00));
     WriteByte((byte)loc.Z);
 }
コード例 #14
0
ファイル: Program.cs プロジェクト: oufooz/tibiatekbot
 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;
 }