Exemple #1
0
        public static void Target(int client, Mobile mobile)
        {
            PlayerMobile pm;

            if (mobile != null && ClientInfoCollection.GetPlayer(client, out pm))
            {
                byte[] packet = new byte[19];
                packet[0]  = 0x6C;
                packet[1]  = 0x00;
                packet[2]  = (byte)(pm.Serial >> 24);
                packet[3]  = (byte)(pm.Serial >> 16);
                packet[4]  = (byte)(pm.Serial >> 8);
                packet[5]  = (byte)(pm.Serial);
                packet[7]  = (byte)(mobile.Serial >> 24);
                packet[8]  = (byte)(mobile.Serial >> 16);
                packet[9]  = (byte)(mobile.Serial >> 8);
                packet[10] = (byte)(mobile.Serial);
                packet[11] = (byte)(mobile.X >> 8);
                packet[12] = (byte)mobile.X;
                packet[13] = (byte)(mobile.Y >> 8);
                packet[14] = (byte)mobile.Y;
                //packet[15] = (byte)(mobile.Z >> 8);
                packet[16] = (byte)mobile.Z;
                packet[17] = (byte)(mobile.ID >> 8);
                packet[18] = (byte)mobile.ID;
                SendPacketToServer(client, packet);
                Macro.SetTargetCursor(client, false);
            }
        }
Exemple #2
0
            private static void OutgoingPackets_InternalDragItemRequestedEvent(int client, int serial, int amount)
            {
                ClientInfo   ci;
                PlayerMobile p;

                if (ClientInfoCollection.GetClient(client, out ci))
                {
                    Item i;
                    if (ci.Items.GetItem(serial, out i))
                    {
                        if (i.Layer != Layer.Invalid)
                        {
                            if (ClientInfoCollection.GetPlayer(client, out p))
                            {
                                p.SetLayer((int)i.Layer, 0);
                            }
                        }
                        i.Layer = Layer.Invalid;
                    }
                }
            }
Exemple #3
0
        public static void Target(int client, TargetType targetType, int serial, int x, int y, int z, int ID)
        {
            PlayerMobile pm;

            if (ClientInfoCollection.GetPlayer(client, out pm))
            {
                byte[] packet = new byte[19];
                packet[0] = 0x6C;
                switch (targetType)
                {
                case TargetType.Object:
                    packet[1] = 0x00;
                    break;

                case TargetType.Ground:
                    packet[1] = 0x01;
                    break;
                }
                packet[2]  = (byte)(pm.Serial >> 24);
                packet[3]  = (byte)(pm.Serial >> 16);
                packet[4]  = (byte)(pm.Serial >> 8);
                packet[5]  = (byte)(pm.Serial);
                packet[7]  = (byte)(serial >> 24);
                packet[8]  = (byte)(serial >> 16);
                packet[9]  = (byte)(serial >> 8);
                packet[10] = (byte)(serial);
                packet[11] = (byte)(x >> 8);
                packet[12] = (byte)x;
                packet[13] = (byte)(y >> 8);
                packet[14] = (byte)y;
                //packet[15] = (byte)(z >> 8);
                packet[16] = (byte)z;
                packet[17] = (byte)(ID >> 8);
                packet[18] = (byte)ID;
                SendPacketToServer(client, packet);
                Macro.SetTargetCursor(client, false);
            }
        }
Exemple #4
0
 /// <summary>
 /// Get PlayerMobile from specified client.
 /// </summary>
 /// <param name="client">Target client.</param>
 /// <returns>True on success.</returns>
 public static bool GetPlayer(int client, out PlayerMobile player)
 {
     return(ClientInfoCollection.GetPlayer(client, out player));
 }