Ejemplo n.º 1
0
        public ItemInfo(BinaryReader BReader)
        {
            ItemIndex      = BReader.ReadInt32();
            ItemName       = BReader.ReadString();
            ItemType       = (MirItemType)BReader.ReadByte();
            RequiredType   = (MirRequiredType)BReader.ReadByte();
            RequiredClass  = (MirRequiredClass)BReader.ReadByte();
            RequiredAmount = BReader.ReadInt32();

            Durability = BReader.ReadInt32();
            StackSize  = BReader.ReadInt32();
            Price      = BReader.ReadInt32();
            Image      = BReader.ReadInt32();

            Shape = BReader.ReadInt32();

            MinAC  = BReader.ReadInt32();
            MaxAC  = BReader.ReadInt32();
            MinMAC = BReader.ReadInt32();
            MaxMAC = BReader.ReadInt32();
            MinDC  = BReader.ReadInt32();
            MaxDC  = BReader.ReadInt32();
            MinMC  = BReader.ReadInt32();
            MaxMC  = BReader.ReadInt32();
            MinSC  = BReader.ReadInt32();
            MaxSC  = BReader.ReadInt32();

            Health = BReader.ReadInt32();
            Mana   = BReader.ReadInt32();

            Weight       = BReader.ReadInt32();
            Light        = BReader.ReadInt32();
            Accuracy     = BReader.ReadInt32();
            Agility      = BReader.ReadInt32();
            MagicResist  = BReader.ReadInt32();
            PoisonResist = BReader.ReadInt32();
            HealthRegen  = BReader.ReadInt32();
            ManaRegen    = BReader.ReadInt32();
            Holy         = BReader.ReadInt32();

            BodyWeight = BReader.ReadInt32();
            HandWeight = BReader.ReadInt32();
            BagWeight  = BReader.ReadInt32();

            Luck        = BReader.ReadInt32();
            AttackSpeed = BReader.ReadInt32();

            Set = (SetType)BReader.ReadByte();

            CanBreak   = BReader.ReadBoolean();
            CanRepair  = BReader.ReadBoolean();
            CanSRepair = BReader.ReadBoolean();
            CanDrop    = BReader.ReadBoolean();
            CanTrade   = BReader.ReadBoolean();
            CanStore   = BReader.ReadBoolean();
            CanSell    = BReader.ReadBoolean();
        }
Ejemplo n.º 2
0
        public ItemInfo(DataRow Row)
        {
            ItemIndex      = Row["Item Index"] is DBNull ? -1 : (int)Row["Item Index"];
            ItemName       = Row["Item Name"] is DBNull ? string.Empty : Row["Item Name"].ToString();
            ItemType       = (MirItemType)(Row["Item Type"] is DBNull ? 0 : (int)Row["Item Type"]);
            RequiredType   = (MirRequiredType)(Row["Required Type"] is DBNull ? 0 : (int)Row["Required Type"]);
            RequiredClass  = (MirRequiredClass)(Row["Required Class"] is DBNull ? 0 : (int)Row["Required Class"]);
            RequiredAmount = Row["Required Amount"] is DBNull ? 0 : (int)Row["Required Amount"];

            Durability = Row["Durability"] is DBNull ? 0 : (int)Row["Durability"];
            StackSize  = Row["Stack Size"] is DBNull ? 0 : (int)Row["Stack Size"];
            Price      = Row["Price"] is DBNull ? 0 : (int)Row["Price"];
            Image      = Row["Image Index"] is DBNull ? -1 : (int)Row["Image Index"];

            Shape = Row["Shape"] is DBNull ? 0 : (int)Row["Shape"];

            MinAC  = Row["Min AC"] is DBNull ? 0 : (int)Row["Min AC"];
            MaxAC  = Row["Max AC"] is DBNull ? 0 : (int)Row["Max AC"];
            MinMAC = Row["Min MAC"] is DBNull ? 0 : (int)Row["Min MAC"];
            MaxMAC = Row["Max MAC"] is DBNull ? 0 : (int)Row["Max MAC"];
            MinDC  = Row["Min DC"] is DBNull ? 0 : (int)Row["Min DC"];
            MaxDC  = Row["Max DC"] is DBNull ? 0 : (int)Row["Max DC"];
            MinMC  = Row["Min MC"] is DBNull ? 0 : (int)Row["Min MC"];
            MaxMC  = Row["Max MC"] is DBNull ? 0 : (int)Row["Max MC"];
            MinSC  = Row["Min SC"] is DBNull ? 0 : (int)Row["Min SC"];
            MaxSC  = Row["Max SC"] is DBNull ? 0 : (int)Row["Max SC"];

            Health = Row["Health"] is DBNull ? 0 : (int)Row["Health"];
            Mana   = Row["Mana"] is DBNull ? 0 : (int)Row["Mana"];

            Weight       = Row["Weight"] is DBNull ? 0 : (int)Row["Weight"];
            Light        = Row["Light"] is DBNull ? 0 : (int)Row["Light"];
            Accuracy     = Row["Accuracy"] is DBNull ? 0 : (int)Row["Accuracy"];
            Agility      = Row["Agility"] is DBNull ? 0 : (int)Row["Agility"];
            MagicResist  = Row["Magic Resist"] is DBNull ? 0 : (int)Row["Magic Resist"];
            PoisonResist = Row["Poison Resist"] is DBNull ? 0 : (int)Row["Poison Resist"];
            HealthRegen  = Row["Health Regen"] is DBNull ? 0 : (int)Row["Health Regen"];
            ManaRegen    = Row["Mana Regen"] is DBNull ? 0 : (int)Row["Mana Regen"];
            Holy         = Row["Holy"] is DBNull ? 0 : (int)Row["Holy"];

            BodyWeight  = Row["Body Weight"] is DBNull ? 0 : (int)Row["Body Weight"];
            HandWeight  = Row["Hand Weight"] is DBNull ? 0 : (int)Row["Hand Weight"];
            BagWeight   = Row["Bag Weight"] is DBNull ? 0 : (int)Row["Bag Weight"];
            Luck        = (Row["Luck"] is DBNull ? 0 : (int)Row["Luck"]);
            AttackSpeed = (Row["Attack Speed"] is DBNull ? 0 : (int)Row["Attack Speed"]);

            Set = (SetType)(Row["Set"] is DBNull ? 0 : (int)Row["Set"]);

            CanBreak   = Row["Can Break"] is DBNull ? false : (bool)Row["Can Break"];
            CanRepair  = Row["Can Repair"] is DBNull ? false : (bool)Row["Can Repair"];
            CanSRepair = Row["Can SRepair"] is DBNull ? false : (bool)Row["Can SRepair"];
            CanDrop    = Row["Can Drop"] is DBNull ? false : (bool)Row["Can Drop"];
            CanTrade   = Row["Can Trade"] is DBNull ? false : (bool)Row["Can Trade"];
            CanStore   = Row["Can Store"] is DBNull ? false : (bool)Row["Can Store"];
            CanSell    = Row["Can Sell"] is DBNull ? false : (bool)Row["Can Sell"];
            StartItem  = Row["Start Item"] is DBNull ? false : (bool)Row["Start Item"];
        }
Ejemplo n.º 3
0
        public bool CorrectSlot(UserItem I)
        {
            MirItemType Type = I.Info.ItemType;

            switch ((MirEquipmentSlot)ItemSlot)
            {
            case MirEquipmentSlot.Weapon:
                return(Type == MirItemType.Weapon);

            case MirEquipmentSlot.Armour:
                return(Type == MirItemType.ArmourMale || Type == MirItemType.ArmourFemale);

            case MirEquipmentSlot.Helmet:
                return(Type == MirItemType.Helmet);

            case MirEquipmentSlot.Torch:
                return(Type == MirItemType.Torch);

            case MirEquipmentSlot.Necklace:
                return(Type == MirItemType.Necklace);

            case MirEquipmentSlot.BraceletL:
            case MirEquipmentSlot.BraceletR:
                return(Type == MirItemType.Bracelet);

            case MirEquipmentSlot.RingL:
            case MirEquipmentSlot.RingR:
                return(Type == MirItemType.Ring);

            case MirEquipmentSlot.Amulet:
                return(Type == MirItemType.Amulet);

            case MirEquipmentSlot.Boots:
                return(Type == MirItemType.Boots);

            case MirEquipmentSlot.Belt:
                return(Type == MirItemType.Belt);

            case MirEquipmentSlot.Stone:
                return(Type == MirItemType.Stone);

            case MirEquipmentSlot.Tiger:
                return(Type == MirItemType.Tiger);

            default:
                return(false);
            }
        }