Ejemplo n.º 1
0
    public static WaypointsSection Read(IBitReader reader)
    {
        var waypointsSection = new WaypointsSection
        {
            Header  = reader.ReadUInt16(),
            Version = reader.ReadUInt32(),
            Length  = reader.ReadUInt16()
        };

        for (int i = 0; i < waypointsSection._difficulties.Length; i++)
        {
            waypointsSection._difficulties[i] = WaypointsDifficulty.Read(reader);
        }

        return(waypointsSection);
    }
Ejemplo n.º 2
0
    private D2S(IBitReader reader)
    {
        Header         = Header.Read(reader);
        ActiveWeapon   = reader.ReadUInt32();
        Name           = reader.ReadString(16);
        Status         = Status.Read(reader.ReadByte());
        Progression    = reader.ReadByte();
        Unk0x0026      = reader.ReadBytes(2);
        ClassId        = reader.ReadByte();
        Unk0x0029      = reader.ReadBytes(2);
        Level          = reader.ReadByte();
        Created        = reader.ReadUInt32();
        LastPlayed     = reader.ReadUInt32();
        Unk0x0034      = reader.ReadBytes(4);
        AssignedSkills = Enumerable.Range(0, 16).Select(_ => Skill.Read(reader)).ToArray();
        LeftSkill      = Skill.Read(reader);
        RightSkill     = Skill.Read(reader);
        LeftSwapSkill  = Skill.Read(reader);
        RightSwapSkill = Skill.Read(reader);
        Appearances    = Appearances.Read(reader);
        Location       = Locations.Read(reader);
        MapId          = reader.ReadUInt32();
        Unk0x00af      = reader.ReadBytes(2);
        Mercenary      = Mercenary.Read(reader);
        RealmData      = reader.ReadBytes(140);
        Quests         = QuestsSection.Read(reader);
        Waypoints      = WaypointsSection.Read(reader);
        NPCDialog      = NPCDialogSection.Read(reader);
        Attributes     = Attributes.Read(reader);

        ClassSkills    = ClassSkills.Read(reader, ClassId);
        PlayerItemList = ItemList.Read(reader, Header.Version);
        PlayerCorpses  = CorpseList.Read(reader, Header.Version);

        if (Status.IsExpansion)
        {
            MercenaryItemList = MercenaryItemList.Read(reader, Mercenary, Header.Version);
            Golem             = Golem.Read(reader, Header.Version);
        }
    }
Ejemplo n.º 3
0
 public static byte[] Write(WaypointsSection waypointsSection)
 {
     using var writer = new BitWriter();
     waypointsSection.Write(writer);
     return(writer.ToArray());
 }