コード例 #1
0
        public void Load(ByteBuffer buff)
        {
            //ct2.2: 0C D5 5B 30 4F A6 95 0F 00 01 00 00 00 86 F2 01 00 54 68 FF FF 30 F2 FF FF 00 00 00 00 00 00 00 00 4D 01 00 00 16 01 00 00 AF 00 00 00 2C 00 00 00 AF 00 00 00 2C 00 00 00 AF 00 00 00 2C 00 00 00 AF 00 00 00 2C 00 00 00 9A 99 99 99 99 99 F1 3F 81 43 A8 52 B3 07 F0 3F 00 00 00 00 00 00 30 40 00 00 00 00 00 00 43 40 C8 09 00 00 00 00 00 00 06 1B 00 00 01 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 40 00 00 00 00 00 00 43 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            //int offset = 1;

            //13 March 2013
            //packet parser: cddddddddddddddddddffffdddcccccdhdsddddddddccffddddccddddddddchcdhchd(d)
            ID           = buff.ReadUInt32();
            NPCID        = buff.ReadUInt32();
            isAttackable = buff.ReadUInt32();

            X      = buff.ReadInt32();
            Y      = buff.ReadInt32();
            Z      = buff.ReadInt32();
            Dest_X = X;
            Dest_Y = Y;
            Dest_Z = Z;

            Heading = buff.ReadInt32();
            buff.ReadUInt32();
            MatkSpeed = buff.ReadUInt32();
            PatkSpeed = buff.ReadUInt32();

            RunSpeed      = buff.ReadUInt32();
            WalkSpeed     = buff.ReadUInt32();
            SwimRunSpeed  = buff.ReadUInt32();
            SwimWalkSpeed = buff.ReadUInt32();
            flRunSpeed    = buff.ReadUInt32();
            flWalkSpeed   = buff.ReadUInt32();
            FlyRunSpeed   = buff.ReadUInt32();
            FlyWalkSpeed  = buff.ReadUInt32();

            MoveSpeedMult   = System.Convert.ToSingle(buff.ReadDouble());
            AttackSpeedMult = System.Convert.ToSingle(buff.ReadDouble());
            CollisionRadius = System.Convert.ToSingle(buff.ReadDouble());
            CollisionHeight = System.Convert.ToSingle(buff.ReadDouble());

            RHand  = buff.ReadUInt32();
            LRHand = buff.ReadUInt32();
            LHand  = buff.ReadUInt32();

            NameShows   = buff.ReadByte();
            isRunning   = buff.ReadByte();
            isInCombat  = buff.ReadByte();
            isAlikeDead = buff.ReadByte();
            buff.ReadByte();
            isInvisible = 0;

            buff.ReadUInt32();        //FF FF FF FF
            Name = buff.ReadString(); //00 00
            buff.ReadUInt32();        //FF FF FF FF

            /*
             * Name = buff.ReadString();//Name
             * if (Name.Length == 0)
             * {
             *  Name = Util.GetNPCName(NPCID);
             * }
             *
             * buff.ReadUInt32(); //FF FF FF FF
             */
            if (Name.Length == 0)
            {
                Name = Util.GetNPCName(NPCID);
            }
            Title = buff.ReadString();

            //try and get the title for npcs (mobs, not summons)
            if (Title.Length == 0)
            {
                Title = Util.GetNPCTitle(NPCID);
            }

            //if that failed, we get the NPC's master's title... mobs get their name as their title, o well
            if (Title.Length == 0)
            {
                Title = Name;
            }
            //Globals.l2net_home.Add_Text("nametemp: " + nametemp + "Name: " + Name + "Title: " + Title, Globals.Red, TextType.ALL);

            //GD OK

            SummonedNameColor = buff.ReadUInt32();//0 = normal, 1 = summoned name color
            PvPFlag           = buff.ReadUInt32();
            Karma             = buff.ReadInt32();
            AbnormalEffects   = buff.ReadUInt32();
            buff.ReadUInt32(); //clan ID??
            buff.ReadUInt32(); //crest ID??

            buff.ReadUInt32(); //clan ID
            buff.ReadUInt32(); //crest ID
            buff.ReadByte();   //isflying
            TeamCircle = buff.ReadByte();

            buff.ReadDouble();                      // col height
            buff.ReadDouble();                      // col rad

            buff.ReadUInt32();                      // 00 00 00 00
            buff.ReadUInt32();                      // 00 00 00 00
            buff.ReadInt32();                       // 00 00 00 00
            buff.ReadInt32();                       // 00 00 00 00

            //  buff.ReadInt32();                   // 00 00 00 00
            isTargetable = buff.ReadByte();         // 01
            showName     = buff.ReadByte();         // 01
            if (isTargetable == 0 || showName == 0)
            {
                GameData.badmobs_ignored += 1;
            }
            ExtendedEffects = buff.ReadUInt32();    // 00 00 00 00
            buff.ReadInt32();                       // roacknow

            buff.ReadInt32();                       // rock now - cur hp
            buff.ReadInt32();                       // rock now - max hp
            buff.ReadInt32();                       // rock now - cur mp
            buff.ReadInt32();                       // rock now - max m
            buff.ReadInt32();                       // rock now - cur cp
            buff.ReadInt32();                       // rock now - max cp
            buff.ReadByte();                        //00
            buff.ReadInt16();                       //00 00
            buff.ReadByte();
            buff.ReadInt32();
            buff.ReadInt16();
            buff.ReadByte();
            buff.ReadInt16();

            int abn_count = buff.ReadInt32();

            if (abn_count >= 30)
            {
#if DEBUG
                Globals.l2net_home.Add_Text("More than 30 abnormal effects, probably an error... Count: " + abn_count, Globals.Yellow, TextType.BOT);
#endif
                abn_count = 10;
            }

            //Globals.l2net_home.Add_Text("count " + abn_count, Globals.Yellow, TextType.BOT);

            AbnEffects.Clear();
            for (uint i = 0; i < (uint)abn_count; i++)
            {
                uint tmpabneff = buff.ReadUInt32();
                //Globals.l2net_home.Add_Text("Adding abnormal vfx to npc : " + tmpabneff.ToString("X2") + " to : " + Name, Globals.Yellow, TextType.BOT);
                AbnEffects.Add(tmpabneff);
            }
        }
コード例 #2
0
ファイル: CharInfo.cs プロジェクト: devmvalvm/L2Net
        public void Load(ByteBuffer buff)
        {
            //int offset = 1;

            /*
             * 31
             *  6E C8 FE FF
             *  9B 50 02 00
             *  20 F4 FF FF
             *
             *  00 00 00 00
             *
             *  68 5F 11 4A id
             *  4C 00 61 00 64 00 79 00 64 00 77 00 61 00 72 00 66 00 00 00
             *  04 race
             *  00 sex
             *  01 ?
             *  35 00 00 00 base class ??
             *
             *  F0 33 00 00
             *  61 84 00 00
             *  5F 84 00 00
             *  00 00 00 00
             *  B8 45 00 00
             *  62 84 00 00
             *  63 84 00 00
             *  65 84 00 00
             *  00 00 00 00
             *  5F 84 00 00
             *  00 00 00 00
             *  00 00 00 00 -1
             *
             *  EF 33 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00 -2
             *
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00 -3
             *
             *  00 00 00 00
             *  00 00 00 00 -4
             *
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00 -5
             *
             *  00 00 00 00
             *
             *  02 01 00 00 // karma  ?
             *
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00
             *  DE 00 00 00 // 222 ? cast speed ?
             *  79 02 00 00 // 633 attac k speed
             *  00 00 00 00
             *  83 00
             *  50 00
             *  32 00
             *  32 00
             *  00 00 // title ?
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  F0 3F 93 C1 51 F2 EA 3C
             *  02 40 00 00 00 00 00 00
             *  14 40 00 00
             *  00 00 00 00
             *  33 40 00 00
             *  00 00
             *  01 00 00 00
             *  02 00 00 00
             *  49 00 6D 00 61 00 53 00 68 00 6F 00 72 00 74 00 73 00 74 00 75 00 66 00 66 00 00 00 //title
             *  1F 03 10 60 clanid
             *  6B 9B 00 00 clansrect
             *  00 00 00 00 allyid
             *  00 00 00 00 alycrest
             *  01 is sitting
             *  01 is runing
             *  00 in combat
             *  00 isalikedead
             *  00 invi
             *  00 mount
             *  00 store
             *  00 00 cub
             *  00 find pt
             *  00
             *  23 00 rec ?
             *  00 00 00 00
             *  9C 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 00 00 00
             *  00 FF FF FF //color
             *  00 FF 6F 00 //head ?
             *  00
             *  04 00
             *  00 A2 F9 EC //tit color
             *  00 00
             *  D0 07 00 00 // 2k - clan rep?
             *  00 00 00 00 trans
             *  00 00 00 00 aghat
             *  01 00 00 00
             *  00 00 00 00
             *  00 00
             *  79 28 00 00
             *  7C 3C 00 00
             *  7C 3C 00 00
             *  96 0A 00 00
             *  96 0A 00 00
             *  00 00 00 00
             *  00 00
             *  01 00 00 00 // effect
             *  28 00
             *  00
             */
            X      = buff.ReadInt32();
            Y      = buff.ReadInt32();
            Z      = buff.ReadInt32();
            Dest_X = X;
            Dest_Y = Y;
            Dest_Z = Z;

            buff.ReadInt32();     // in G+ and onward this is now the Vechile ID

            ID   = buff.ReadUInt32();
            Name = buff.ReadString();

            //Race = buff.ReadUInt32();
            //Sex = buff.ReadUInt32();
            Race = buff.ReadByte();
            buff.ReadByte();
            Sex = buff.ReadUInt32();

            BaseClass = buff.ReadUInt32();

            Underwear = buff.ReadUInt32();
            Head      = buff.ReadUInt32();
            RHand     = buff.ReadUInt32();
            LHand     = buff.ReadUInt32();
            Gloves    = buff.ReadUInt32();
            Chest     = buff.ReadUInt32();
            Legs      = buff.ReadUInt32();
            Feet      = buff.ReadUInt32();
            Back      = buff.ReadUInt32();
            LRHand    = buff.ReadUInt32();
            Hair      = buff.ReadUInt32();
            DollFace  = buff.ReadUInt32();

            //GD OK

            buff.ReadUInt32();    //right bracelet
            buff.ReadUInt32();    //left bracelet
            buff.ReadUInt32();    //deco 1
            buff.ReadUInt32();    //deco 2
            buff.ReadUInt32();    //deco 3
            buff.ReadUInt32();    //deco 4
            buff.ReadUInt32();    //deco 5
            buff.ReadUInt32();    //deco 6

            buff.ReadUInt32();    //belt

            //GD OK

            buff.ReadUInt32();    //aug underwear
            buff.ReadUInt32();    //aug head
            aug_RHand = buff.ReadUInt32();
            aug_LHand = buff.ReadUInt32();

            buff.ReadUInt32();    //aug gloves
            buff.ReadUInt32();    //aug chest
            buff.ReadUInt32();    //aug legs
            buff.ReadUInt32();    //aug feet
            buff.ReadUInt32();    //aug back
            buff.ReadUInt32();    //aug lr hand
            buff.ReadUInt32();    //aug hair
            buff.ReadUInt32();    //aug doll face

            //GD OK

            buff.ReadUInt32();    //aug right bracelet
            buff.ReadUInt32();    //aug left bracelet
            buff.ReadUInt32();    //aug deco 1
            buff.ReadUInt32();    //aug deco 2
            buff.ReadUInt32();    //aug deco 3
            buff.ReadUInt32();    //aug deco 4
            buff.ReadUInt32();    //aug deco 5
            buff.ReadUInt32();    //aug deco 6

            buff.ReadUInt32();    //aug belt


            buff.ReadUInt32(); //05 00 00 00
            buff.ReadUInt32(); //01 00 00 00

            buff.ReadUInt32(); // old pvp flag
            buff.ReadInt32();  // old karma

            //GD OK


            buff.ReadUInt32();
            buff.ReadUInt32();
            buff.ReadUInt32();
            buff.ReadUInt32(); //00 00 00 00
            buff.ReadUInt32(); //00 00 00 00
            buff.ReadUInt32(); //00 00 00 00
            //buff.ReadUInt32();
            buff.ReadByte();   //00 00 00 00
            buff.ReadInt16();
            MatkSpeed = buff.ReadUInt32();
            PatkSpeed = buff.ReadUInt32();
            buff.ReadUInt32();//00
            RunSpeed      = buff.ReadUInt16();
            WalkSpeed     = buff.ReadUInt16();
            SwimRunSpeed  = buff.ReadUInt16();
            SwimWalkSpeed = buff.ReadUInt16();
            //PvPFlag = buff.ReadUInt32();
            //Karma = buff.ReadInt32();

            //buff.ReadUInt32(); //00 00 00 00
            //buff.ReadUInt32(); //64 00 00 00

            //GD OK

            //MatkSpeed = buff.ReadUInt32();
            //PatkSpeed = buff.ReadUInt32();

            buff.ReadUInt32(); //00 00 00 00
            buff.ReadUInt32(); //00 00 00 00
            buff.ReadUInt32(); //00 00 00 00
            buff.ReadUInt16();

            /*RunSpeed = buff.ReadUInt32();
             * WalkSpeed = buff.ReadUInt32();
             * SwimRunSpeed = buff.ReadUInt32();
             * SwimWalkSpeed = buff.ReadUInt32();
             * flRunSpeed = buff.ReadUInt32();
             * flWalkSpeed = buff.ReadUInt32();
             * FlyRunSpeed = buff.ReadUInt32();
             * FlyWalkSpeed = buff.ReadUInt32();*/

            //MoveSpeedMult = System.Convert.ToSingle(buff.ReadDouble());
            //AttackSpeedMult = System.Convert.ToSingle(buff.ReadDouble());
            CollisionRadius = System.Convert.ToSingle(buff.ReadDouble());
            CollisionHeight = System.Convert.ToSingle(buff.ReadDouble());

            //GD OK
            buff.ReadUInt32();
            buff.ReadUInt32();
            buff.ReadUInt16();
            HairSytle = buff.ReadUInt32();
            HairColor = buff.ReadUInt32();
            Face      = buff.ReadUInt32();

            Title       = buff.ReadString();
            ClanID      = buff.ReadUInt32();
            ClanCrestID = buff.ReadUInt32();
            AllyID      = buff.ReadUInt32();
            AllyCrestID = buff.ReadUInt32();

            //GD OK

            isSitting   = buff.ReadByte();
            isRunning   = buff.ReadByte();
            isInCombat  = buff.ReadByte();
            isAlikeDead = buff.ReadByte();
            // re: hide
            //
            // When a player casts hide the server sets their CI
            // AbnormalEffect to the Stealth Mask and sets this byte to 1.
            // It then sends all clients a DeleteObject packet.
            // Since the Delete object packet is what actually makes the player
            // vanish this byte is responsible for handling what happens if the player
            // logs out and then back in.  Basically if this byte is set when
            // a player logs in, this tells all clients not to draw the actor :)
            // !! This byte alone does not mean a player is invisible, just that they will
            //  load invisible !!
            Invisible        = buff.ReadByte();
            MountType        = buff.ReadByte();
            PrivateStoreType = buff.ReadByte();

            CubicCount = buff.ReadUInt16();
            Cubics.Clear();
            for (uint i = 0; i < CubicCount; i++)
            {
                uint tmpc = buff.ReadUInt16();        //ushort
                Cubics.Add(tmpc);
            }

            FindParty = buff.ReadByte();


            //buff.ReadUInt32();


            isFlying  = buff.ReadByte();
            RecAmount = buff.ReadUInt16();

            buff.ReadUInt32();         //00 00 00 00
            Class = buff.ReadUInt32(); //class id

            //GD OK

            buff.ReadUInt32();               //00
            EnchantAmount = buff.ReadByte();
            TeamCircle    = buff.ReadByte(); //team color

            ClanCrestIDLarge = buff.ReadUInt32();

            HeroIcon = buff.ReadByte();    //is noble
            HeroGlow = buff.ReadByte();    //is hero

            isFishing = buff.ReadByte();
            FishX     = buff.ReadInt32();
            FishY     = buff.ReadInt32();
            FishZ     = buff.ReadInt32();

            NameColor   = buff.ReadUInt32();
            Heading     = buff.ReadInt32(); //heading
            PledgeClass = buff.ReadByte();
            buff.ReadByte();                //pledge type
            TitleColor = buff.ReadUInt32();

            //GD OK

            DemonSword = buff.ReadUInt16();   //z sword? //0 0 0 0
            buff.ReadUInt32();                //clan rep
            Transform_ID = buff.ReadUInt32(); //transformation id
            Agathon_ID   = buff.ReadUInt32(); //agathon id


            buff.ReadUInt32();//01 00 00 00


            ExtendedEffects = buff.ReadUInt32();     // Extended VFX (stigma etc)
            buff.ReadInt16();


            Cur_CP = buff.ReadUInt32(); //64 00 00 00

            Max_HP = buff.ReadUInt32(); //C1 00 00 00
            Cur_HP = buff.ReadUInt32(); //C1 00 00 00
            Max_MP = buff.ReadUInt32(); //27 00 00 00
            Cur_MP = buff.ReadUInt32(); //27 00 00 00

            buff.ReadUInt32();          //00 00 00 00
            buff.ReadByte();            //00

            AbnormalEffects = 0x00;
            uint AbnEffCount = buff.ReadUInt32();

            AbnEffects.Clear();

            for (uint i = 0; i < (uint)AbnEffCount; i++)
            {
                uint tmpabneff = buff.ReadUInt32();
                //Globals.l2net_home.Add_Text("Adding abnormal vfx: " + tmpabneff.ToString("X2") + "to : " + Name, Globals.Yellow, TextType.BOT);
                AbnEffects.Add(tmpabneff);
            }
            buff.ReadInt16();
        }