Ejemplo n.º 1
0
        public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
        {
            base.WriteToCreatePacket(packet);

            if (extended || this is Character) // only chars and vehicles can be extended
                return;

            packet.WriteInteger(EnhancementId);

            packet.WritePadding(4);

            packet.WriteTFID(SummonOwner);
            packet.WriteBoolean(DoesntCountAsSummon);

            packet.WritePadding(7);

            packet.WriteLong(CurrentVehicleId);
            packet.WriteLong(CurrentTrailerCoid);
            packet.WriteInteger(-1); // current spawn owner
            packet.WriteByte(0); // number skills

            packet.WritePadding(3);

            packet.WriteInteger(Analyzed);
            packet.WriteInteger(Level);
            packet.WriteInteger(0); // current path id
            packet.WriteInteger(0); // extra path id
            packet.WriteSingle(0.0f); // patrol distance
            packet.WriteBoolean(false); // path is reversing
            packet.WriteBoolean(false); // path is road
            packet.WriteBoolean(IsElite); // iselite
            packet.WriteByte(AIState); // ai state
            packet.WriteInteger(0); // on use trigger
            packet.WriteInteger(0); // on use reaction
            packet.WriteLong(0); // murderer coid

            for (var i = 0; i < 255; ++i)
            {
                packet.WriteInteger(0); // skill id
                packet.WriteShort(0); // skill level
                packet.WritePadding(2);
            }
        }
Ejemplo n.º 2
0
        public override void WriteToCreatePacket(Packet packet, Boolean extended = false)
        {
            packet.WriteInteger(CBID);
            packet.WriteLong(-1L); // coid Store
            packet.WriteInteger(GetCurrentHP() + 100);
            packet.WriteInteger(GetMaximumHP() + 100);
            packet.WriteInteger(GetValue());
            packet.WriteInteger(GetIDFaction());
            packet.WriteInteger(TeamFaction);
            packet.WriteInteger(CustomValue);

            for (var i = 0; i < 5; ++i) // prefix id
                packet.WriteInteger(-1);

            for (var i = 0; i < 5; ++i) // gadget id
                packet.WriteInteger(-1);

            for (var i = 0; i < 5; ++i) // prefix level
                packet.WriteShort(0);

            for (var i = 0; i < 5; ++i) // gadget level
                packet.WriteShort(0);

            packet.WriteSingle(Position.X);
            packet.WriteSingle(Position.Y);
            packet.WriteSingle(Position.Z);
            packet.WriteSingle(Rotation.X);
            packet.WriteSingle(Rotation.Y);
            packet.WriteSingle(Rotation.Z);
            packet.WriteSingle(Rotation.W);
            packet.WriteSingle(Scale);
            packet.WriteInteger(GetQuantity());
            packet.WriteByte(InventoryPositionX);
            packet.WriteByte(InventoryPositionY);
            packet.WriteBoolean(GetIsCorpse()); // is corpse

            packet.WritePadding(5);

            packet.WriteTFID(COID);
            packet.WriteBoolean(false); // will equip
            packet.WriteBoolean(false); // is item link
            packet.WriteBoolean(false); // is in inventory
            packet.WriteByte(SkillLevel1);
            packet.WriteByte(SkillLevel2);
            packet.WriteByte(SkillLevel3);
            packet.WriteBoolean(false); // is identified
            packet.WriteBoolean(false); // possible mission item
            packet.WriteBoolean(false); // tempitem
            packet.WriteBoolean((UnkFlags & UnkFlags.IsKit) != 0);
            packet.WriteBoolean(false); // isinfinite
            packet.WriteBoolean((UnkFlags & UnkFlags.IsBound) != 0);
            packet.WriteShort(UsesLeft);
            packet.WriteUtf8StringOn(CustomizedName, 17);
            packet.WriteBoolean(MadeFromMemory);
            packet.WriteBoolean(false); // is mail

            packet.WritePadding(1);

            packet.WriteShort((Int16)MaxGadgets);
            packet.WriteShort((Int16)RequiredLevel);
            packet.WriteShort((Int16)RequiredCombat);
            packet.WriteShort((Int16)RequiredPerception);
            packet.WriteShort((Int16)RequiredTech);
            packet.WriteShort((Int16)RequiredTheory);

            packet.WritePadding(2);

            packet.WriteInteger(ItemTemplateId);

            packet.WritePadding(4);
        }