Exemple #1
0
    public UserItem(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
    {
        UniqueID  = reader.ReadUInt64();
        ItemIndex = reader.ReadInt32();

        CurrentDura = reader.ReadUInt16();
        MaxDura     = reader.ReadUInt16();

        Count = reader.ReadUInt32();

        AC  = reader.ReadByte();
        MAC = reader.ReadByte();
        DC  = reader.ReadByte();
        MC  = reader.ReadByte();
        SC  = reader.ReadByte();

        Accuracy = reader.ReadByte();
        Agility  = reader.ReadByte();
        HP       = reader.ReadByte();
        MP       = reader.ReadByte();

        AttackSpeed = reader.ReadSByte();
        Luck        = reader.ReadSByte();

        SoulBoundId = reader.ReadInt32();
        byte Bools = reader.ReadByte();

        Identified     = (Bools & 0x01) == 0x01;
        Cursed         = (Bools & 0x02) == 0x02;
        Strong         = reader.ReadByte();
        MagicResist    = reader.ReadByte();
        PoisonResist   = reader.ReadByte();
        HealthRecovery = reader.ReadByte();
        ManaRecovery   = reader.ReadByte();
        PoisonRecovery = reader.ReadByte();
        CriticalRate   = reader.ReadByte();
        CriticalDamage = reader.ReadByte();
        Freezing       = reader.ReadByte();
        PoisonAttack   = reader.ReadByte();


        int count = reader.ReadInt32();

        for (int i = 0; i < count; i++)
        {
            if (reader.ReadBoolean())
            {
                continue;
            }
            UserItem item = new UserItem(reader, version, Customversion);
            Slots[i] = item;
        }

        GemCount = reader.ReadUInt32();

        Awake = new Awake(reader);

        RefinedValue = (RefinedValue)reader.ReadByte();
        RefineAdded  = reader.ReadByte();
        WeddingRing  = reader.ReadInt32();

        if (version < 65)
        {
            return;
        }

        if (reader.ReadBoolean())
        {
            ExpireInfo = new ExpireInfo(reader, version, Customversion);
        }

        if (version < 76)
        {
            return;
        }

        if (reader.ReadBoolean())
        {
            RentalInformation = new RentalInformation(reader, version, Customversion);
        }
    }
Exemple #2
0
    public UserItem(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
    {
        UniqueID = reader.ReadUInt64();
        ItemIndex = reader.ReadInt32();

        CurrentDura = reader.ReadUInt16();
        MaxDura = reader.ReadUInt16();

        Count = reader.ReadUInt32();

        AC = reader.ReadByte();
        MAC = reader.ReadByte();
        DC = reader.ReadByte();
        MC = reader.ReadByte();
        SC = reader.ReadByte();

        Accuracy = reader.ReadByte();
        Agility = reader.ReadByte();
        HP = reader.ReadByte();
        MP = reader.ReadByte();

        AttackSpeed = reader.ReadSByte();
        Luck = reader.ReadSByte();

        if (version <= 19) return;
        SoulBoundId = reader.ReadInt32();
        byte Bools = reader.ReadByte();        
        Identified = (Bools & 0x01) == 0x01;
        Cursed = (Bools & 0x02) == 0x02;
        Strong = reader.ReadByte();
        MagicResist = reader.ReadByte();
        PoisonResist = reader.ReadByte();
        HealthRecovery = reader.ReadByte();
        ManaRecovery = reader.ReadByte();
        PoisonRecovery = reader.ReadByte();
        CriticalRate = reader.ReadByte();
        CriticalDamage = reader.ReadByte();
        Freezing = reader.ReadByte();
        PoisonAttack = reader.ReadByte();
        

        if (version <= 31) return;

        int count = reader.ReadInt32();
        for (int i = 0; i < count; i++)
        {
            if (reader.ReadBoolean()) continue;
            UserItem item = new UserItem(reader, version, Customversion);
            Slots[i] = item;
        }

        if (version <= 38) return;

        GemCount = reader.ReadUInt32();

        if (version <= 40) return;

        Awake = new Awake(reader);

        if (version <= 56) return;

        RefinedValue = (RefinedValue)reader.ReadByte();
        RefineAdded = reader.ReadByte();
        if (version < 60) return;
        WeddingRing = reader.ReadInt32();

        if (version < 65) return;

        if (reader.ReadBoolean())
        {
            ExpireInfo = new ExpireInfo(reader, version, Customversion);
        }

    }
Exemple #3
0
    public UserItem(BinaryReader reader, int version = int.MaxValue, int customVersion = int.MaxValue)
    {
        UniqueID  = reader.ReadUInt64();
        ItemIndex = reader.ReadInt32();

        CurrentDura = reader.ReadUInt16();
        MaxDura     = reader.ReadUInt16();

        if (version <= 84)
        {
            Count = (ushort)reader.ReadUInt32();
        }
        else
        {
            Count = reader.ReadUInt16();
        }

        if (version <= 84)
        {
            AddedStats = new Stats();

            AddedStats[Stat.MaxAC]  = reader.ReadByte();
            AddedStats[Stat.MaxMAC] = reader.ReadByte();
            AddedStats[Stat.MaxDC]  = reader.ReadByte();
            AddedStats[Stat.MaxMC]  = reader.ReadByte();
            AddedStats[Stat.MaxSC]  = reader.ReadByte();

            AddedStats[Stat.Accuracy] = reader.ReadByte();
            AddedStats[Stat.Agility]  = reader.ReadByte();
            AddedStats[Stat.HP]       = reader.ReadByte();
            AddedStats[Stat.MP]       = reader.ReadByte();

            AddedStats[Stat.AttackSpeed] = reader.ReadSByte();
            AddedStats[Stat.Luck]        = reader.ReadSByte();
        }

        SoulBoundId = reader.ReadInt32();
        byte Bools = reader.ReadByte();

        Identified = (Bools & 0x01) == 0x01;
        Cursed     = (Bools & 0x02) == 0x02;

        if (version <= 84)
        {
            AddedStats[Stat.Strong]         = reader.ReadByte();
            AddedStats[Stat.MagicResist]    = reader.ReadByte();
            AddedStats[Stat.PoisonResist]   = reader.ReadByte();
            AddedStats[Stat.HealthRecovery] = reader.ReadByte();
            AddedStats[Stat.SpellRecovery]  = reader.ReadByte();
            AddedStats[Stat.PoisonRecovery] = reader.ReadByte();
            AddedStats[Stat.CriticalRate]   = reader.ReadByte();
            AddedStats[Stat.CriticalDamage] = reader.ReadByte();
            AddedStats[Stat.Freezing]       = reader.ReadByte();
            AddedStats[Stat.PoisonAttack]   = reader.ReadByte();
        }

        int count = reader.ReadInt32();

        SetSlotSize(count);

        for (int i = 0; i < count; i++)
        {
            if (reader.ReadBoolean())
            {
                continue;
            }
            UserItem item = new UserItem(reader, version, customVersion);
            Slots[i] = item;
        }

        if (version <= 84)
        {
            GemCount = (ushort)reader.ReadUInt32();
        }
        else
        {
            GemCount = reader.ReadUInt16();
        }

        if (version > 84)
        {
            AddedStats = new Stats(reader);
        }

        Awake = new Awake(reader);

        RefinedValue = (RefinedValue)reader.ReadByte();
        RefineAdded  = reader.ReadByte();

        if (version > 85)
        {
            RefineSuccessChance = reader.ReadInt32();
        }

        WeddingRing = reader.ReadInt32();

        if (version < 65)
        {
            return;
        }

        if (reader.ReadBoolean())
        {
            ExpireInfo = new ExpireInfo(reader, version, customVersion);
        }

        if (version < 76)
        {
            return;
        }

        if (reader.ReadBoolean())
        {
            RentalInformation = new RentalInformation(reader, version, customVersion);
        }

        if (version < 83)
        {
            return;
        }

        IsShopItem = reader.ReadBoolean();
    }