Ejemplo n.º 1
0
        /// <summary>
        /// Send WorldItem packet to client.
        /// </summary>
        /// <param name="client">Target client.</param>
        /// <param name="serial">Item serial.</param>
        /// <param name="itemid">Item ID.</param>
        /// <param name="x">X Location.</param>
        /// <param name="y">Y Location.</param>
        /// <param name="z">Z Location.</param>
        /// <param name="hue">Item hue.</param>
        public static void WorldItem(int client, int serial, int itemid, int x, int y, int z, int hue)
        {
            byte[] packet = new byte[26];
            packet[0] = 0xF3;
            packet[2] = 0x01;
            packet[4] = (byte)(serial >> 24);
            packet[5] = (byte)(serial >> 16);
            packet[6] = (byte)(serial >> 8);
            packet[7] = (byte)serial;
            itemid   &= 0xFFFF;
            packet[8] = (byte)(itemid >> 8);
            packet[9] = (byte)itemid;
            int amount = 1;

            packet[11] = (byte)(amount >> 8);
            packet[12] = (byte)amount;
            packet[13] = (byte)(amount >> 8);
            packet[14] = (byte)amount;
            packet[15] = (byte)(x >> 8);
            packet[16] = (byte)x;
            packet[17] = (byte)(y >> 8);
            packet[18] = (byte)y;
            packet[19] = (byte)z;
            //byte - light
            packet[21] = (byte)(hue >> 8);
            packet[22] = (byte)hue;
            MacroEx.SendPacketToClient(client, packet);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Send RemoveObject packet to client.
 /// </summary>
 /// <param name="client">Target client.</param>
 /// <param name="serial">Serial of item/mobile/multi.</param>
 public static void RemoveObject(int client, int serial)
 {
     byte[] packet = new byte[5];
     packet[0] = 0x1D;
     packet[1] = (byte)(serial >> 24);
     packet[2] = (byte)(serial >> 16);
     packet[3] = (byte)(serial >> 8);
     packet[4] = (byte)(serial);
     MacroEx.SendPacketToClient(client, packet);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Change client cursor to normal or target cursor.
        /// </summary>
        /// <param name="client">Target client.</param>
        /// <param name="target">True sets cursor to target cursor, false sets it to normal.</param>
        public static void SetTargetCursor(int client, bool target)
        {
            ClientInfo ci;

            if (ClientInfoCollection.GetClient(client, out ci))
            {
                if (target)
                {
                    MacroEx.SendPacketToClient(client, myTargetPacket);
                }
                else
                {
                    Memory.Write(ci.Handle, ci.CursorAddress, dwordZero, true);
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Send quest arrow packet to client.
 /// </summary>
 /// <param name="client">Target client.</param>
 /// <param name="active">Turn on or off.</param>
 /// <param name="x">X location</param>
 /// <param name="y">Y location</param>
 /// <param name="serial">Target serial or -1</param>
 public static void QuestArrow(int client, bool active, int x, int y, int serial)
 {
     byte[] packet = new byte[10];
     packet[0] = 0xBA;
     if (active)
     {
         packet[1] = 0x01;
         packet[2] = (byte)(x >> 8);
         packet[3] = (byte)x;
         packet[4] = (byte)(y >> 8);
         packet[5] = (byte)y;
     }
     packet[6] = (byte)(serial >> 24);
     packet[7] = (byte)(serial >> 16);
     packet[8] = (byte)(serial >> 8);
     packet[9] = (byte)serial;
     MacroEx.SendPacketToClient(client, packet);
 }