Пример #1
0
        public static bool ParseRequiredGender(string s, out RequiredGender gender)
        {
            if (RequiredGenderMap.TryGetValue(s, out gender))
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
    public ItemInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
    {
        Index = reader.ReadInt32();
        Name = reader.ReadString();
        Type = (ItemType) reader.ReadByte();
        if (version >= 40) Grade = (ItemGrade)reader.ReadByte();
        RequiredType = (RequiredType) reader.ReadByte();
        RequiredClass = (RequiredClass) reader.ReadByte();
        RequiredGender = (RequiredGender) reader.ReadByte();
        if(version >= 17) Set = (ItemSet)reader.ReadByte();

        Shape = version >= 30 ? reader.ReadInt16() : reader.ReadSByte();
        Weight = reader.ReadByte();
        Light = reader.ReadByte();
        RequiredAmount = reader.ReadByte();

        Image = reader.ReadUInt16();
        Durability = reader.ReadUInt16();

        StackSize = reader.ReadUInt32();
        Price = reader.ReadUInt32();

        MinAC = reader.ReadByte();
        MaxAC = reader.ReadByte();
        MinMAC = reader.ReadByte();
        MaxMAC = reader.ReadByte();
        MinDC = reader.ReadByte();
        MaxDC = reader.ReadByte();
        MinMC = reader.ReadByte();
        MaxMC = reader.ReadByte();
        MinSC = reader.ReadByte();
        MaxSC = reader.ReadByte();
        if (version < 25)
        {
            HP = reader.ReadByte();
            MP = reader.ReadByte();
        }
        else
        {
            HP = reader.ReadUInt16();
            MP = reader.ReadUInt16();
        }
        Accuracy = reader.ReadByte();
        Agility = reader.ReadByte();

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

        StartItem = reader.ReadBoolean();

        BagWeight = reader.ReadByte();
        HandWeight = reader.ReadByte();
        WearWeight = reader.ReadByte();

        if (version >= 9) Effect = reader.ReadByte();
        if (version >= 20)
        {
            Strong = reader.ReadByte();
            MagicResist = reader.ReadByte();
            PoisonResist = reader.ReadByte();
            HealthRecovery = reader.ReadByte();
            SpellRecovery = reader.ReadByte();
            PoisonRecovery = reader.ReadByte();
            HPrate = reader.ReadByte();
            MPrate = reader.ReadByte();
            CriticalRate = reader.ReadByte();
            CriticalDamage = reader.ReadByte();
            byte bools = reader.ReadByte();
            NeedIdentify = (bools & 0x01) == 0x01;
            ShowGroupPickup = (bools & 0x02) == 0x02;
            ClassBased = (bools & 0x04) == 0x04;
            LevelBased = (bools & 0x08) == 0x08;
            CanMine = (bools & 0x10) == 0x10;
            MaxAcRate = reader.ReadByte();
            MaxMacRate = reader.ReadByte();
            Holy = reader.ReadByte();
            Freezing = reader.ReadByte();
            PoisonAttack = reader.ReadByte();
            if (version < 55)
            {
                Bind = (BindMode)reader.ReadByte();
            }
            else
            {
                Bind = (BindMode)reader.ReadInt16();
            }
            
        }
        if (version >= 21)
        {
            Reflect = reader.ReadByte();
            HpDrainRate = reader.ReadByte();
            Unique = (SpecialItemMode)reader.ReadInt16();
        }
        if (version >= 24)
        {
            RandomStatsId = reader.ReadByte();
        }
        else
        {
            RandomStatsId = 255;
            if ((Type == ItemType.Weapon) || (Type == ItemType.Armour) || (Type == ItemType.Helmet) || (Type == ItemType.Necklace) || (Type == ItemType.Bracelet) || (Type == ItemType.Ring) || (Type == ItemType.Mount))
                RandomStatsId = (byte)Type;
            if ((Type == ItemType.Belt) || (Type == ItemType.Boots))
                RandomStatsId = 7;
        }

        if (version >= 40) CanFastRun = reader.ReadBoolean();

        if (version >= 41)
        {
            CanAwakening = reader.ReadBoolean();
            bool isTooltip = reader.ReadBoolean();
            if (isTooltip)
                ToolTip = reader.ReadString();
        }
    }
Пример #3
0
    public ItemInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue)
    {
        Index          = reader.ReadInt32();
        Name           = reader.ReadString();
        Type           = (ItemType)reader.ReadByte();
        Grade          = (ItemGrade)reader.ReadByte();
        RequiredType   = (RequiredType)reader.ReadByte();
        RequiredClass  = (RequiredClass)reader.ReadByte();
        RequiredGender = (RequiredGender)reader.ReadByte();
        Set            = (ItemSet)reader.ReadByte();

        Shape          = reader.ReadInt16();
        Weight         = reader.ReadByte();
        Light          = reader.ReadByte();
        RequiredAmount = reader.ReadByte();

        Image      = reader.ReadUInt16();
        Durability = reader.ReadUInt16();

        StackSize = reader.ReadUInt32();
        Price     = reader.ReadUInt32();

        MinAC    = reader.ReadByte();
        MaxAC    = reader.ReadByte();
        MinMAC   = reader.ReadByte();
        MaxMAC   = reader.ReadByte();
        MinDC    = reader.ReadByte();
        MaxDC    = reader.ReadByte();
        MinMC    = reader.ReadByte();
        MaxMC    = reader.ReadByte();
        MinSC    = reader.ReadByte();
        MaxSC    = reader.ReadByte();
        HP       = reader.ReadUInt16();
        MP       = reader.ReadUInt16();
        Accuracy = reader.ReadByte();
        Agility  = reader.ReadByte();

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

        StartItem = reader.ReadBoolean();

        BagWeight  = reader.ReadByte();
        HandWeight = reader.ReadByte();
        WearWeight = reader.ReadByte();

        Effect         = reader.ReadByte();
        Strong         = reader.ReadByte();
        MagicResist    = reader.ReadByte();
        PoisonResist   = reader.ReadByte();
        HealthRecovery = reader.ReadByte();
        SpellRecovery  = reader.ReadByte();
        PoisonRecovery = reader.ReadByte();
        HPrate         = reader.ReadByte();
        MPrate         = reader.ReadByte();
        CriticalRate   = reader.ReadByte();
        CriticalDamage = reader.ReadByte();
        byte bools = reader.ReadByte();

        NeedIdentify    = (bools & 0x01) == 0x01;
        ShowGroupPickup = (bools & 0x02) == 0x02;
        ClassBased      = (bools & 0x04) == 0x04;
        LevelBased      = (bools & 0x08) == 0x08;
        CanMine         = (bools & 0x10) == 0x10;

        if (version >= 77)
        {
            GlobalDropNotify = (bools & 0x20) == 0x20;
        }

        MaxAcRate     = reader.ReadByte();
        MaxMacRate    = reader.ReadByte();
        Holy          = reader.ReadByte();
        Freezing      = reader.ReadByte();
        PoisonAttack  = reader.ReadByte();
        Bind          = (BindMode)reader.ReadInt16();
        Reflect       = reader.ReadByte();
        HpDrainRate   = reader.ReadByte();
        Unique        = (SpecialItemMode)reader.ReadInt16();
        RandomStatsId = reader.ReadByte();

        CanFastRun = reader.ReadBoolean();

        CanAwakening = reader.ReadBoolean();
        bool isTooltip = reader.ReadBoolean();

        if (isTooltip)
        {
            ToolTip = reader.ReadString();
        }

        if (version < 70) //before db version 70 all specialitems had wedding rings disabled, after that it became a server option
        {
            if ((Type == ItemType.Ring) && (Unique != SpecialItemMode.None))
            {
                Bind |= BindMode.NoWeddingRing;
            }
        }
    }
Пример #4
0
    public ItemInfo(BinaryReader reader, int version = int.MaxValue)
    {
        Index = reader.ReadInt32();
        Name = reader.ReadString();
        Type = (ItemType) reader.ReadByte();
        RequiredType = (RequiredType) reader.ReadByte();
        RequiredClass = (RequiredClass) reader.ReadByte();
        RequiredGender = (RequiredGender) reader.ReadByte();

        Shape = reader.ReadSByte();
        Weight = reader.ReadByte();
        Light = reader.ReadByte();
        RequiredAmount = reader.ReadByte();

        Image = reader.ReadUInt16();
        Durability = reader.ReadUInt16();

        StackSize = reader.ReadUInt32();
        Price = reader.ReadUInt32();

        MinAC = reader.ReadByte();
        MaxAC = reader.ReadByte();
        MinMAC = reader.ReadByte();
        MaxMAC = reader.ReadByte();
        MinDC = reader.ReadByte();
        MaxDC = reader.ReadByte();
        MinMC = reader.ReadByte();
        MaxMC = reader.ReadByte();
        MinSC = reader.ReadByte();
        MaxSC = reader.ReadByte();
        HP = reader.ReadByte();
        MP = reader.ReadByte();
        Accuracy = reader.ReadByte();
        Agility = reader.ReadByte();

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

        StartItem = reader.ReadBoolean();

        BagWeight = reader.ReadByte();
        HandWeight = reader.ReadByte();
        WearWeight = reader.ReadByte();

        if (version >= 9) Effect = reader.ReadByte();
    }
Пример #5
0
 public static string GetRequiredGenderShorcut(RequiredGender requiredGender)
 {
     return(RequiredGenderMap.Where(x => x.Value == requiredGender).OrderBy(x => x.Key.Length).First().Key);
 }
Пример #6
0
    public ItemInfo(BinaryReader reader, int version = int.MaxValue, int customVersion = int.MaxValue)
    {
        Index          = reader.ReadInt32();
        Name           = reader.ReadString();
        Type           = (ItemType)reader.ReadByte();
        Grade          = (ItemGrade)reader.ReadByte();
        RequiredType   = (RequiredType)reader.ReadByte();
        RequiredClass  = (RequiredClass)reader.ReadByte();
        RequiredGender = (RequiredGender)reader.ReadByte();
        Set            = (ItemSet)reader.ReadByte();

        Shape          = reader.ReadInt16();
        Weight         = reader.ReadByte();
        Light          = reader.ReadByte();
        RequiredAmount = reader.ReadByte();

        Image      = reader.ReadUInt16();
        Durability = reader.ReadUInt16();

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

        Price = reader.ReadUInt32();

        if (version <= 84)
        {
            Stats                = new Stats();
            Stats[Stat.MinAC]    = reader.ReadByte();
            Stats[Stat.MaxAC]    = reader.ReadByte();
            Stats[Stat.MinMAC]   = reader.ReadByte();
            Stats[Stat.MaxMAC]   = reader.ReadByte();
            Stats[Stat.MinDC]    = reader.ReadByte();
            Stats[Stat.MaxDC]    = reader.ReadByte();
            Stats[Stat.MinMC]    = reader.ReadByte();
            Stats[Stat.MaxMC]    = reader.ReadByte();
            Stats[Stat.MinSC]    = reader.ReadByte();
            Stats[Stat.MaxSC]    = reader.ReadByte();
            Stats[Stat.HP]       = reader.ReadUInt16();
            Stats[Stat.MP]       = reader.ReadUInt16();
            Stats[Stat.Accuracy] = reader.ReadByte();
            Stats[Stat.Agility]  = reader.ReadByte();

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

        StartItem = reader.ReadBoolean();

        if (version <= 84)
        {
            Stats[Stat.BagWeight]  = reader.ReadByte();
            Stats[Stat.HandWeight] = reader.ReadByte();
            Stats[Stat.WearWeight] = reader.ReadByte();
        }

        Effect = reader.ReadByte();

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


        byte bools = reader.ReadByte();

        NeedIdentify    = (bools & 0x01) == 0x01;
        ShowGroupPickup = (bools & 0x02) == 0x02;
        ClassBased      = (bools & 0x04) == 0x04;
        LevelBased      = (bools & 0x08) == 0x08;
        CanMine         = (bools & 0x10) == 0x10;

        if (version >= 77)
        {
            GlobalDropNotify = (bools & 0x20) == 0x20;
        }

        if (version <= 84)
        {
            Stats[Stat.MaxACRatePercent]  = reader.ReadByte();
            Stats[Stat.MaxMACRatePercent] = reader.ReadByte();
            Stats[Stat.Holy]         = reader.ReadByte();
            Stats[Stat.Freezing]     = reader.ReadByte();
            Stats[Stat.PoisonAttack] = reader.ReadByte();
        }

        Bind = (BindMode)reader.ReadInt16();

        if (version <= 84)
        {
            Stats[Stat.Reflect]            = reader.ReadByte();
            Stats[Stat.HPDrainRatePercent] = reader.ReadByte();
        }

        Unique        = (SpecialItemMode)reader.ReadInt16();
        RandomStatsId = reader.ReadByte();

        CanFastRun = reader.ReadBoolean();

        CanAwakening = reader.ReadBoolean();

        if (version > 83)
        {
            Slots = reader.ReadByte();
        }

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

        bool isTooltip = reader.ReadBoolean();

        if (isTooltip)
        {
            ToolTip = reader.ReadString();
        }

        if (version < 70) //before db version 70 all specialitems had wedding rings disabled, after that it became a server option
        {
            if ((Type == ItemType.Ring) && (Unique != SpecialItemMode.None))
            {
                Bind |= BindMode.NoWeddingRing;
            }
        }
    }
Пример #7
0
 public PlayerSettings(int playerIndex, RequiredGender gender)
 {
     PlayerIndex = playerIndex;
     Gender      = gender;
 }