Ejemplo n.º 1
0
        public void Send(byte[] data)
        {
            PacketBuilder builder = new PacketBuilder();

            builder.Append(Protocol.Header2Bytes(data.Length));
            builder.Append(data);
            SendLow(builder.ToArray());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Change the Current Attack Mode.
        /// </summary>
        public void SetMode(AttackMode mode)
        {
            Memory.Writer.Uint(Memory.Addresses.Client.AttackMode, Convert.ToUInt32(mode.Type.GetHashCode()), 1);
            Memory.Writer.Uint(Memory.Addresses.Client.FollowMode, Convert.ToUInt32(mode.Follow.GetHashCode()), 1);

            PacketBuilder Builder = new PacketBuilder(0xA0, connection);
            Builder.Append(mode.Type.GetHashCode());      //[01 = OFFENSIVE | 02 = BALANCED | 03 = DEFENSIVE]
            Builder.Append(mode.Follow.GetHashCode());    //[00 = STAND| 01 = CHASE]
            if (mode.AttackUnmarkedPlayers) { Builder.Append(0x00); } else { Builder.Append(0x01); }
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Send a Message to Default Channel.
        /// </summary>
        public void Default(string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------------------
            //SZ      ID  SZ NM
            //---------------------------------------
            //07 00 96 01 03 00 61 65 77
            //0B 00 96 01 07 00 62 6C 7A 69 6E 68 61
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(MessageType.Normal.GetHashCode());
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Close the Defined Container.
 /// </summary>
 public void CloseContainer(IContainer containerSource)
 {
     //TODO: Need Test this Feature. Probably is a Client Packet.
     PacketBuilder Builder = new PacketBuilder(0x6F, connection);
     Builder.Append(containerSource.Index);
     Connection.Send(Builder.GetPacket());
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Attack the Defined Creature.
        /// </summary>
        public void Creature(Creature target)
        {
            Model.Player nPlayer = new Model.Player(Connection);
            nPlayer.Target = target;

            PacketBuilder Builder = new PacketBuilder(0xA1, connection);
            Builder.Append(target.Id);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Open the specified Channel.
        /// </summary>
        /// <param name="channel"></param>
        public void OpenChannel(InternalChannels channel)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------------------
            //.  .  ID ID .  SZ .  H  e  l  p  .  .
            //---------------------------------------
            //0B 00 AC 0A 00 06 00 4B 65 79 58 00 00
            //---------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xAC, Connection);
            Builder.Append(GetChannelInfo(channel).Key, 2);
            Builder.Append(GetChannelInfo(channel).Value, true, true);

            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Drink any kind of Fluid Item.
 /// </summary>
 public void DrinkFluid(uint fluidID)
 {
     PacketBuilder Builder = new PacketBuilder(0x84, connection);
     Builder.Append(0xFF);
     Builder.Append(0xFF);
     Builder.Append(0x00);
     Builder.Append(0x00);
     Builder.Append(0x00);
     Builder.Append(fluidID);
     if (connection.IsOtServer) {
         Builder.Append(0x02);
     }
     else { Builder.Append(0x0A); }
     Builder.Append(new Model.Player(Connection).Id);
     Connection.Send(Builder.GetPacket());
 }
Ejemplo n.º 8
0
        public void Send(byte[] data)
        {
            if (data == null)
            {
                return;
            }
            if (state != GClientState.Connected)
            {
                OnFatalError(new Exception("Packet can't be sent because the socket isn't connected."));
                return;
            }

            PacketBuilder builder = new PacketBuilder();

            builder.Append(protocol.Header2Bytes(data.Length));
            builder.Append(data);

            byte[] packet = builder.ToArray();

            lock (sendEventArgs) {
                if (isSending)
                {
                    sendQueue.Enqueue(packet);

                    return;
                }
                else
                {
                    isSending = true;
                }
            }

            try {
                sendEventArgs.SetBuffer(packet, 0, packet.Length);
                if (!socket.SendAsync(sendEventArgs))
                {
                    Base_OnPacketSended(socket, sendEventArgs);
                }
            } catch (Exception ex) {
                DisconnectByError(ex);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Follow the Defined Creature.
        /// </summary>
        public void Follow(uint creatureID)
        {
            #region " Packet Structure Analyze "
            //SZ    ID [ CreatID ]
            //--------------------
            //05 00 A2 4F 2D 45 01
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xA2, connection);
            Builder.Append(creatureID);
            Connection.Send(Builder.GetPacket());
            Connection.Memory.Writer.Uint(Connection.Memory.Addresses.BattleList.GreenSQuare, creatureID, 4);
        }
Ejemplo n.º 10
0
        public override void Build(L2PlayerData data)
        {
            PacketBuilder pack = packet;

            pack.SetId((int)ILPacketIds.ClientPrimary.RequestMoveTo);
            pack.Append(x);
            pack.Append(y);
            pack.Append(z);
            pack.Append(data.MainHero.ValidatedX);
            pack.Append(data.MainHero.ValidatedY);
            pack.Append(data.MainHero.ValidatedZ);
            pack.Append(1);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Shoot a Rune against a defined Creature.
        /// </summary>
        public void Shoot(uint creatureID, uint runeID)
        {
            #region " Packet Structure Analyze "
            //SZ    ID                [ UH]    [Player ID]
            //0D 00 84 FF FF 00 00 00 58 0C 00 63 14 32 00
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x84, connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(runeID);
            Builder.Append(0x00);
            Builder.Append(creatureID);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Use the Item stacked on defined Slot.
        /// e.g: Open Containers, Eat Food, etc.
        /// </summary>
        public void InContainer(ISlot slotSource, int openInPosition)
        {
            PacketBuilder Builder = new PacketBuilder(0x82, connection);
            if (slotSource.Id == InventoryID.Container) {

                #region " Packet Structure Analyze "
                //------------------------------------
                //SZ    ID       BP    ST [ ID] ST PS
                //------------------------------------
                //0A 00 82 FF FF 40 00 00 26 0B 00 01
                //------------------------------------
                #endregion

                Builder.Append(0xFF);
                Builder.Append(0XFF);
                Builder.Append(slotSource.Container.Position);
                Builder.Append(0x00);
                Builder.Append(slotSource.Position);
                Builder.Append(slotSource.Item.Id);
                Builder.Append(slotSource.Position);
            }
            else {

                #region " Packet Structure Analyze "
                //------------------------------------
                //SZ    ID       ST      [ ID ]    PS
                //------------------------------------
                //0A 00 82 FF FF 03 00 00 25 0B 00 00
                //------------------------------------
                #endregion

                Builder.Append(0xFF);
                Builder.Append(0XFF);
                Builder.Append(slotSource.Id.GetHashCode());
                Builder.Append(0x00);
                Builder.Append(0x00);
                Builder.Append(slotSource.Item.Id);
                Builder.Append(0x00);
            }
            Builder.Append(openInPosition);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Use the Defined Item on a Player in Defined SQM and Drop after use if needed.
        /// e.g: Use Fluids on Players, Use Runes on Players, etc.
        /// </summary>
        public void OnPlayer(ISlot slotSource, Location sqm, bool dropAfterUse)
        {
            #region " Packet Structure Analyze "
            // SZ      ID         BP     SLOT  HMM         X      Y    Z   ??     QD
            //----------------------------------------------------------------------
            // 11  00  83  FF FF  40  00  00  7E 0C  00  15 7E  ED 7B  07  63 00  01
            //----------------------------------------------------------------------
            // 00  01  02  03 04  05  06  07  08 09  10  11 12  13 14  15  16 17  18
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x83, connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(slotSource.Container.Position);
            Builder.Append(0x00);
            Builder.Append(slotSource.Position);
            Builder.Append(slotSource.Item.Id);
            Builder.Append(slotSource.Position);
            Builder.Append(sqm.X);
            Builder.Append(sqm.Y);
            Builder.Append(sqm.Z);
            Builder.Append(0x63);
            Builder.Append(0x00);
            Builder.Append(0x01); //TODO: Test increase this ammount.
            Connection.Send(Builder.GetPacket());

            if (dropAfterUse) {
                System.Threading.Thread.Sleep(300);
                new Stack(Connection).ContainerToGround(slotSource, sqm);
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Use the Defined Item in Ground.
        /// e.g: Eat Food in Ground, Up Stairs, Open Container.
        /// </summary>
        public void InGround(Location sqm, uint itemId, uint stackPosition, bool isContainer)
        {
            #region " Packet Structure Analyze "
            //------------------------------------
            //Bag
            //------------------------------------
            //0A 00 82 15 7E ED 7B 07 25 0B 01 01
            //------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11
            //------------------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x82, connection);
            Builder.Append(sqm.X);
            Builder.Append(sqm.Y);
            Builder.Append(sqm.Z);
            Builder.Append(itemId);
            Builder.Append(stackPosition);

            if (isContainer) { Builder.Append(new Model.Player(Connection).Containers.Count); }
            else { Builder.Append(0x00); }
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Use the Defined Item to the Ground.
        /// e.g: Rope on Ground, Obsidian Knife on Creature, Shovel on Role, etc.
        /// </summary>
        public void OnGround(ISlot slotSource, Location sqm, uint tileID, uint stackPosition)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------------
            //USE ROPE
            //---------------------------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18
            //---------------------------------------------------------
            //11 00 83 FF FF 40 00 0D BB 0B 0D 64 7F C3 7B 0A 82 01 00
            //SZ    ID       BP    ST ROPE  ST [ X ] [ Y ] ZZ [TID] ??
            //---------------------------------------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x83, connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(slotSource.Container.Position);
            Builder.Append(0x00);

            Builder.Append(slotSource.Position);
            Builder.Append(slotSource.Item.Id);
            Builder.Append(slotSource.Position);

            Builder.Append(sqm.X);
            Builder.Append(sqm.Y);
            Builder.Append(sqm.Z);

            Builder.Append(tileID);
            Builder.Append(stackPosition);

            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Send the ammount of ground Item to defined Inventory Slot.
        /// </summary>
        public void GroundToSlot(IItem item, InventoryID destiny, Location sqm, uint stackPosition)
        {
            #region " Packet Structure Analyze "
            // SZ    ID   X     Y   ZZ  ITM  ??       ST       QT
            //---------------------------------------------------
            // 0F 00 78 14 7E ED 7B 07 CD 0C 01 FF FF 06 00 00 04
            //---------------------------------------------------
            // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(sqm.X);
            Builder.Append(sqm.Y);
            Builder.Append(sqm.Z);
            Builder.Append(item.Id);
            Builder.Append(stackPosition);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(destiny.GetHashCode());
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(item.Count);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Move a ammount of defined item from sqm to sqm on ground.
        /// </summary>
        public void GroundToGround(IItem item, Location from, Location to, uint stackPosition)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------
            // SZ    ID [ X ] [ Y ] Z  ITMID OD [ X ] [ Y ] Z  QT
            // 0F 00 78 90 7F AC 7C 08 25 0B 02 90 7F AB 7C 08 01
            // 0F 00 78 93 7F A8 7C 08 B3 0D 01 92 7F A8 7C 08 01
            //---------------------------------------------------
            // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            //---------------------------------------------------
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(from.X);
            Builder.Append(from.Y);
            Builder.Append(from.Z);
            Builder.Append(item.Id);
            Builder.Append(stackPosition);
            Builder.Append(to.X);
            Builder.Append(to.Y);
            Builder.Append(to.Z);
            Builder.Append(item.Count);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Send the ammount of stacked Item to defined Inventory Slot.
        /// </summary>
        public void SlotToSlot(IItem item, InventoryID toSlot)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------
            // SZ    ID       ST        ITM           ST       QT
            // 0F 00 78 FF FF 06 00 00 D6 0C 00 FF FF 0A 00 00 01
            //---------------------------------------------------
            // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            //---------------------------------------------------
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(0xFF);
            Builder.Append(0XFF);
            Builder.Append(item.Slot.Id.GetHashCode());
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(item.Id);
            Builder.Append(0x00);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(toSlot.GetHashCode());
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(item.Count);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 19
0
 /// <summary>
 /// Drop the stacked item to defined location.
 /// </summary>
 public void SlotToGround(IItem item, Location sqm)
 {
     var Builder = new PacketBuilder(0x78, Connection);
     Builder.Append(0xFF);
     Builder.Append(0xFF);
     Builder.Append(item.Slot.Id.GetHashCode());
     Builder.Append(0x00);
     Builder.Append(0x00);
     Builder.Append(item.Id);
     Builder.Append(0x00);
     Builder.Append(sqm.X);
     Builder.Append(sqm.Y);
     Builder.Append(sqm.Z);
     Builder.Append(item.Count);
     Connection.Send(Builder.GetPacket());
 }
Ejemplo n.º 20
0
        /// <summary>
        /// Send a Private Message.
        /// </summary>
        public void Private(string playerName, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ      ID  SZ NM                         SZ MS
            //------------------------------------------------------------------------
            //16 00 96 04 08 00 53 75 64 75 64 69 67 75 08 00 62 6C 7A 20 63 61 72 61
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(ChannelType.GameChat.GetHashCode());
            Builder.Append(playerName, true);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Send the ammount of stacked Item to defined Container Slot.
        /// </summary>
        public void ContainerToContainer(ISlot fromSlot, ISlot toSlot)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------
            // SZ    ID       BP    ST  ITM  ST       BP    ST QT
            // 0F 00 78 FF FF 41 00 02 7E 0C 02 FF FF 40 00 02 01
            //---------------------------------------------------
            // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            //---------------------------------------------------
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(fromSlot.Container.Position);
            Builder.Append(0x00);
            Builder.Append(fromSlot.Position);
            Builder.Append(fromSlot.Item.Id);
            Builder.Append(fromSlot.Position);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(toSlot.Container.Position);
            Builder.Append(0x00);
            Builder.Append(toSlot.Position);
            Builder.Append(fromSlot.Item.Count);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Drop the stacked item to defined location.
        /// </summary>
        public void ContainerToGround(ISlot slotSource, Location sqm)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------------
            //DROP ITEM
            //---------------------------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            //---------------------------------------------------------
            //0F 00 78 FF FF 40 00 00 25 0B 00 34 7D CC 7D 07 01
            //SZ    ID       BP    ST ITEMD ST [ X ] [ Y ] ZZ QT
            //---------------------------------------------------------
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(slotSource.Container.Position);
            Builder.Append(0x00);
            Builder.Append(slotSource.Position);
            Builder.Append(slotSource.Item.Id);
            Builder.Append(slotSource.Position);
            Builder.Append(sqm.X);
            Builder.Append(sqm.Y);
            Builder.Append(sqm.Z);
            Builder.Append(slotSource.Item.Count);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Opens Trade Channel.
        /// </summary>
        public void OpenTradeChannel()
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ    ID CHANNEL
            //------------------------------------------------------------------------
            //03 00 98 05 00
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x98, Connection);
            Builder.Append(0x05, 2);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Send a Message to Default Channel.
        /// </summary>
        public void Trade(string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //------------------------------------------------------------------------
            //SZ    ID          SZ    MSG
            //------------------------------------------------------------------------
            //14 00 96 05 05 00 0E 00 73 65 6C 6C 20 63 72 6F 73 73 20 62 6F 77
            //0A 00 96 05 05 00 04 00 73 65 6C 6C
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x96, Connection);
            Builder.Append(ChannelType.Trade.GetHashCode());
            Builder.Append(0x05);
            Builder.Append(0x00);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Client);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 25
0
 /// <summary>
 /// Send the ammount of stacked Item to defined Container Slot.
 /// </summary>
 public void GroundToContainer(IItem item, ISlot destiny, Location sqm, uint stackPosition)
 {
     var Builder = new PacketBuilder(0x78, Connection);
     Builder.Append(sqm.X);
     Builder.Append(sqm.Y);
     Builder.Append(sqm.Z);
     Builder.Append(item.Id);
     Builder.Append(stackPosition);
     Builder.Append(0xFF);
     Builder.Append(0xFF);
     Builder.Append(destiny.Container.Position);
     Builder.Append(0x00);
     Builder.Append(destiny.Position);
     Builder.Append(item.Count);
     Connection.Send(Builder.GetPacket());
 }
Ejemplo n.º 26
0
        /// <summary>
        /// Shoot a Rune against the defined Target.
        /// </summary>
        public void Shoot(Slot runeSlot, Creature target)
        {
            #region " Packet Structure Analyze "
            // SZ      ID         BP     SLOT  HMM         X      Y    Z   ??     QD
            //----------------------------------------------------------------------
            // 11  00  83  FF FF  40  00  00  7E 0C  00  15 7E  ED 7B  07  63 00  01
            //----------------------------------------------------------------------
            // 00  01  02  03 04  05  06  07  08 09  10  11 12  13 14  15  16 17  18
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x83, connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(runeSlot.Container.Position);
            Builder.Append(0x00);
            Builder.Append(runeSlot.Position);
            Builder.Append(runeSlot.Item.Id);
            Builder.Append(runeSlot.Position);
            Builder.Append(target.Location.X);
            Builder.Append(target.Location.Y);
            Builder.Append(target.Location.Z);
            Builder.Append(0x63);
            Builder.Append(0x00);
            Builder.Append(0x01); //TODO: Try increase this value. (Quantity)
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Send Message to defined Internal Channel.
        /// </summary>
        public void SendToChannel(InternalChannels channel, CustomMessageType color, string charname, uint level, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            //--------------------------------------------------------------------------------------------------------------
            //SZ    ID ?? ?? ?? ?? SZ    [                   NAME                ] LV    CR CH    SZ    [        MSG       ]
            //--------------------------------------------------------------------------------------------------------------
            //23 00 AA 00 00 00 00 0E 00 4F 6D 65 67 61 20 4C 61 6D 62 61 20 4C 61 04 00 0C 0A 00 07 00 68 65 6C 6C 6F 00 00
            //.  .  .  .  S  .  .  .  .  N  i  g  h  t  .  C  r  e  a  t  u  r  e  .  .  .  .  .  .  .  H  e  l  l  o  .  .
            //--------------------------------------------------------------------------------------------------------------
            //00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
            //--------------------------------------------------------------------------------------------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xAA, Connection);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(charname, true);
            Builder.Append(level, 2);
            Builder.Append(color.GetHashCode());
            Builder.Append(GetChannelInfo(channel).Key, 2);
            Builder.Append(message, true, true);

            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Send a Animated Message to Client.
        /// </summary>
        public byte[] SendAnimated(AnimatedMsgColor color, Location sqm, string message)
        {
            #region "[rgn] Packet Structure Analyze "
            #endregion

            PacketBuilder Builder = new PacketBuilder(0x84, Connection);
            Builder.Append(sqm.X, 2);
            Builder.Append(sqm.Y, 2);
            Builder.Append(sqm.Z, 1);
            Builder.Append(color.GetHashCode(), 1);
            Builder.Append(message, true);
            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
            return Builder.GetPacket().Data;
        }
Ejemplo n.º 29
0
        /// <summary>
        /// Send a System Message to Client.
        /// </summary>
        public byte[] Send(string message, SystemMsgColor color)
        {
            #region "[rgn] Packet Structure Analyze "
            //---------------------------
            //07 00 B4 12 03 00 69 61 65
            //---------------------------
            //SZ    ID CR SZ    i  a  e
            //---------------------------
            #endregion

            PacketBuilder Builder = new PacketBuilder(0xB4, Connection);
            Builder.Append(color.GetHashCode());
            Builder.Append(message, true, true);
            Builder.SetPacketSource(PacketSource.Server);
            Connection.Send(Builder.GetPacket());
            return Builder.GetPacket().Data;
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Send the ammount of stacked Item to defined Inventory Slot.
        /// </summary>
        public void ContainerToSlot(ISlot fromSlot, InventoryID toSloT)
        {
            #region " Packet Structure Analyze "
            //---------------------------------------------------
            // SZ    ID       BP    ST  ITM  ST       ST       QT
            // 0F 00 78 FF FF 40 00 03 CD 0C 03 FF FF 06 00 00 04
            //---------------------------------------------------
            // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
            //---------------------------------------------------
            #endregion

            var Builder = new PacketBuilder(0x78, Connection);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(fromSlot.Container.Position);
            Builder.Append(0x00);
            Builder.Append(fromSlot.Position);
            Builder.Append(fromSlot.Item.Id);
            Builder.Append(fromSlot.Position);
            Builder.Append(0xFF);
            Builder.Append(0xFF);
            Builder.Append(toSloT.GetHashCode());
            Builder.Append(0x00);
            Builder.Append(0x00);
            Builder.Append(fromSlot.Item.Count);
            Connection.Send(Builder.GetPacket());
        }