Exemple #1
0
        private Item getItem()
        {
            if (current_item == null)
            {
                return(null);
            }
            else
            {
                int  category  = (int)current_item.category_ID;
                int  index     = (int)current_item.ID;
                int  level     = level_field.SelectedIndex;
                int  add_level = add_level_field.SelectedIndex;
                int  dur       = int.Parse(dur_field.Text);
                bool luck      = (bool)luck_field.IsChecked;
                bool skill     = (bool)skill_field.IsChecked;
                int  harm_lvl  = (int)harm_opt_lvl.Value;

                DBSets set   = getSelectedAncient();
                int    setID = (set != null) ? (int)set.ID : -1;

                DBHarmoneyOpts selectedHarm = ((DBHarmoneyOpts)harm_opt_list.SelectedValue);
                int            harm_opt     = (selectedHarm != null) ? selectedHarm.ID : 0;

                //DBRefineOpts selectedRef = (DBRefineOpts) ref_opt_check.Content;
                //int refID = (selectedRef != null) ? selectedRef.ID : 0;
                int refID = 0;

                ExcOpts excOpts = getExcOpts();
                return(new Item(index, category, skill, luck, level, add_level, dur, setID, harm_opt, harm_lvl, refID, excOpts));
            }
        }
Exemple #2
0
        private void initExcOptions(Item item)
        {
            ExcOpts excOpts = item.excellent_options;

            exc_opt1.IsChecked = excOpts.isExcellent(0);
            exc_opt2.IsChecked = excOpts.isExcellent(1);
            exc_opt3.IsChecked = excOpts.isExcellent(2);
            exc_opt4.IsChecked = excOpts.isExcellent(3);
            exc_opt5.IsChecked = excOpts.isExcellent(4);
            exc_opt6.IsChecked = excOpts.isExcellent(5);
        }
Exemple #3
0
        public void initExcOptsFromObject(string exc_hex, ExcOpts opts)
        {
            if (exc_hex.Equals("00") || exc_hex.Equals("FF"))
            {
                excellent_options = new ExcOpts();
            }
            else
            {
                if (addLevel > 3)
                {
                    int dec = (int)hexToDec(exc_hex.Substring(0, 1));
                    dec    -= 4;
                    exc_hex = decToHex(dec).Substring(1, 1) + exc_hex.Substring(1, 1);
                }

                excellent_options = (opts == null) ? new ExcOpts(exc_hex) : opts;
            }
        }
Exemple #4
0
 public Item(int index, int category, bool skill, bool luck, int level, int addLevel, int durability, int ancID, int harm_opt, int harm_lvl, int refine_id, ExcOpts excellent_options)
 {
     item     = new char[32];
     this.hex = def;
     initItem();
     changeIndex(index);
     changeCategory(category);
     changeAncient(ancID);
     changeLevel(level);
     changeSkill(skill);
     changeLuck(luck);
     changeAdditionalOpts(addLevel);
     setDurability(durability);
     initExcOptsFromObject(excellent_options.getCode(), excellent_options);
     initExcOptsToItem();
     //changeHarmoneyOption(harm_opt);
     //changeHarmoneyLevel(harm_lvl);
     //changeRefine(refine_id);
     updateHex();
 }
Exemple #5
0
        public void initExcOptsFromObject(string exc_hex, ExcOpts opts)
        {
            if (exc_hex.Equals("00") || exc_hex.Equals("FF")) excellent_options = new ExcOpts();
            else
            {
                if (addLevel > 3)
                {
                    int dec = (int)hexToDec(exc_hex.Substring(0, 1));
                    dec -= 4;
                    exc_hex = decToHex(dec).Substring(1, 1) + exc_hex.Substring(1, 1);
                }

                excellent_options = (opts == null) ? new ExcOpts(exc_hex) : opts;
            }
        }
Exemple #6
0
 public Item(int index, int category, bool skill, bool luck, int level, int addLevel, int durability, int ancID, int harm_opt, int harm_lvl, int refine_id, ExcOpts excellent_options)
 {
     item     = new char[32];
     this.hex = def;
     initItem();
     changeIndex(index);
     changeCategory(category);
     changeAncient(ancID);
     changeLevel(level);
     changeSkill(skill);
     changeLuck(luck);
     changeAdditionalOpts(addLevel);
     setDurability(durability);
     initExcOptsFromObject(excellent_options.getCode(), excellent_options);
     initExcOptsToItem();
     //changeHarmoneyOption(harm_opt);
     //changeHarmoneyLevel(harm_lvl);
     //changeRefine(refine_id);
     updateHex();
 }