Пример #1
0
 public static byte[] AttackPetStats(WorldMgr.pet_obj c, byte slot)
 {
     CLFramework.PacketWriter writer = new CLFramework.PacketWriter();
     writer.Create(OperationCode.SERVER_PET_INFORMATION);
     writer.DWord(c.UniqueID);
     writer.DWord(c.Model);
     writer.DWord(0x00000168); //stats
     writer.DWord(0x00000168); //stats
     writer.LWord(c.exp);      //Experience
     writer.Byte(c.Level);     //Level
     writer.Word(0);           //Angle
     writer.DWord(0x00000001); //1 = Attack icon enabled, 2 = disabled
     if (c.Petname != "No name")
     {
         writer.Text(c.Petname);                        //Petname
     }
     else
     {
         writer.Word(0);      //No name
     }
     writer.Byte(0);          //Static perhaps
     writer.DWord(c.OwnerID); //Owner
     writer.Byte(slot);
     return(writer.GetBytes());
 }
Пример #2
0
 public static byte[] AttackPetHGP(WorldMgr.pet_obj c)
 {
     CLFramework.PacketWriter writer = new CLFramework.PacketWriter();
     writer.Create(OperationCode.SERVER_PET_HGP);
     writer.DWord(c.UniqueID);
     writer.Byte(3);
     writer.Byte(0);
     writer.Byte(0);
     return(writer.GetBytes());
 }
        public static byte[] ObjectSpawn(WorldMgr.pet_obj o)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(OperationCode.SERVER_SOLO_SPAWN);
            switch (o.Named)
            {
            ///////////////////////////////////////////////////////////////////////////
            // Job transports
            ///////////////////////////////////////////////////////////////////////////
            case 4:
                Writer.DWord(o.Model);                                                     //Pet Model id
                Writer.DWord(o.UniqueID);                                                  //Pet Unique id
                Writer.Byte(o.xSec);                                                       //X sector
                Writer.Byte(o.ySec);                                                       //Y sector
                Writer.Float(Formule.packetx((float)o.x, o.xSec));                         //X
                Writer.Float(o.z);                                                         //Z
                Writer.Float(Formule.packety((float)o.y, o.ySec));                         //Y

                Writer.Word(0);                                                            //Angle

                Writer.Byte(1);                                                            //Walking state
                Writer.Byte(1);                                                            //Static

                Writer.Byte(o.xSec);                                                       //X sector
                Writer.Byte(o.ySec);                                                       //Y sector

                Writer.Word(0);                                                            //Static
                Writer.Word(0);                                                            //
                Writer.Word(0);                                                            //

                Writer.Word(1);
                Writer.Word(3);

                Writer.Byte(0);
                Writer.Float(o.Walk);                                                               //Object walking
                Writer.Float(o.Run);                                                                //Object running
                Writer.Float(o.Zerk);                                                               //Object zerk

                Writer.Word(0);                                                                     //

                Writer.Text(o.OwnerName);

                Writer.Word(2);                                                                     //
                Writer.DWord(o.OwnerID);                                                            //Owner unique id
                Writer.Byte(4);                                                                     //Static byte 4
                break;

            case 3:
                ///////////////////////////////////////////////////////////////////////////
                // Attack pet main packet
                ///////////////////////////////////////////////////////////////////////////
                Writer.DWord(o.Model);
                Writer.DWord(o.UniqueID);
                Writer.Byte(o.xSec);
                Writer.Byte(o.ySec);
                Writer.Float(Formule.packetx((float)o.x, o.xSec));
                Writer.Float(o.z);
                Writer.Float(Formule.packety((float)o.y, o.ySec));
                Writer.Word(0);                        //angle
                Writer.Byte(0);
                Writer.Byte(o.Level);                  //level
                Writer.Byte(0);
                Writer.Word(0);                        //angle
                Writer.Byte(1);
                Writer.Byte(0);
                Writer.Byte(0);
                Writer.Byte(2);
                Writer.Byte(0);
                Writer.Float(o.Walk);                                                               //Object walking
                Writer.Float(o.Run);                                                                //Object running
                Writer.Float(o.Zerk);                                                               //Object zerk

                Writer.Byte(0);
                Writer.Byte(0);
                if (o.Named == 1)
                {
                    Writer.Text(o.Petname);
                }
                else
                {
                    Writer.Word(0);
                }
                Writer.Text(o.OwnerName);
                Writer.Byte(0);
                Writer.Byte(0);
                Writer.DWord(o.OwnerID);
                Writer.Byte(1);
                break;

            case 2:
                ///////////////////////////////////////////////////////////////////////////
                // Grab pet main packet
                ///////////////////////////////////////////////////////////////////////////
                Writer.DWord(o.Model);                                                     //Pet Model id
                Writer.DWord(o.UniqueID);                                                  //Pet Unique id
                Writer.Byte(o.xSec);                                                       //X sector
                Writer.Byte(o.ySec);                                                       //Y sector
                Writer.Float(Formule.packetx((float)o.x, o.xSec));                         //X
                Writer.Float(o.z);                                                         //Z
                Writer.Float(Formule.packety((float)o.y, o.ySec));                         //Y

                Writer.Word(0xDC72);                                                       //Angle

                Writer.Byte(0);                                                            //Walking state
                Writer.Byte(1);                                                            //Static
                Writer.Byte(0);                                                            //Static
                Writer.Word(0xDC72);                                                       //Angle

                Writer.Byte(1);                                                            //Static
                Writer.Word(0);                                                            //
                Writer.Byte(0);
                Writer.Byte(0);
                Writer.Float(o.Walk);                                                               //Object walking
                Writer.Float(o.Run);                                                                //Object running
                Writer.Float(o.Zerk);                                                               //Object zerk
                Writer.Word(0);                                                                     //
                if (o.Petname != "No name")
                {
                    Writer.Text(o.Petname);
                }
                else
                {
                    Writer.Word(0);
                }
                Writer.Text(o.OwnerName);                                                           //Pet owner name
                Writer.Byte(4);                                                                     //Static byte 4?
                Writer.DWord(o.OwnerID);                                                            //Owner unique id
                Writer.Byte(1);                                                                     //Static byte 1

                ///////////////////////////////////////////////////////////////////////////
                break;

            default:
                ///////////////////////////////////////////////////////////////////////////
                // // Horse //
                ///////////////////////////////////////////////////////////////////////////
                Writer.DWord(o.Model);
                Writer.DWord(o.UniqueID);
                Writer.Byte(o.xSec);
                Writer.Byte(o.ySec);
                Writer.Float(Formule.packetx((float)o.x, o.xSec));
                Writer.Float(o.z);
                Writer.Float(Formule.packety((float)o.y, o.ySec));

                Writer.Word(0);
                Writer.Byte(0);
                Writer.Byte(1);
                Writer.Byte(0);
                Writer.Word(0);
                Writer.Byte(1);
                Writer.Word(0);
                Writer.Byte(0);

                Writer.Float(o.Speed1);
                Writer.Float(o.Speed2);
                Writer.Float(o.Zerk);
                Writer.Word(0);
                Writer.Byte(1);
                ///////////////////////////////////////////////////////////////////////////
                break;
            }
            return(Writer.GetBytes());
        }