ComeClarity 0 Опубликовано 10 февраля, 2012 Кто встречался с такой проблемой? Нужно что бы при неудачной заточке Crystall Scroll'ом, уровень заточки оставался таким же. Вот пробовал, не получается: if(item.getItem().getType2() == L2Item.TYPE2_WEAPON) { if(blessedScroll){ for(int blessedweaponscroll : BLESSED_WEAPON_SCROLLS) { if(scroll.getItemId() == blessedweaponscroll) { if(item.getEnchantLevel() >= Config.BLESS_WEAPON_ENCHANT_LEVEL.size()) //the hash has size equals to //max enchant, so if the actual //enchant level is equal or more then max //then the enchant rate is equal to last //enchant rate { chance = Config.BLESS_WEAPON_ENCHANT_LEVEL.get(Config.BLESS_WEAPON_ENCHANT_LEVEL.size()); } else { chance = Config.BLESS_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_WEAPON_MAX; break; } } }else if(crystalScroll){ for(int crystalweaponscroll : CRYSTAL_WEAPON_SCROLLS) { if(scroll.getItemId() == crystalweaponscroll) { if(item.getEnchantLevel() >= Config.CRYSTAL_WEAPON_ENCHANT_LEVEL.size()) { chance = Config.CRYSTAL_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 0); } else { chance = Config.CRYSTAL_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } minEnchantLevel = Config.CRYSTAL_ENCHANT_MIN; maxEnchantLevel = Config.CRYSTAL_ENCHANT_MAX; break; } } }else{ //normal scrolls for(int normalweaponscroll : NORMAL_WEAPON_SCROLLS) { if(scroll.getItemId() == normalweaponscroll) { if(item.getEnchantLevel() >= Config.NORMAL_WEAPON_ENCHANT_LEVEL.size()) { chance = Config.NORMAL_WEAPON_ENCHANT_LEVEL.get(Config.NORMAL_WEAPON_ENCHANT_LEVEL.size()); } else { chance = Config.NORMAL_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_WEAPON_MAX; break; } } } } else if(item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR) { if(blessedScroll){ for(int blessedarmorscroll : BLESSED_ARMOR_SCROLLS) { if(scroll.getItemId() == blessedarmorscroll) { if(item.getEnchantLevel() >= Config.BLESS_ARMOR_ENCHANT_LEVEL.size()) { chance = Config.BLESS_ARMOR_ENCHANT_LEVEL.get(Config.BLESS_ARMOR_ENCHANT_LEVEL.size()); } else { chance = Config.BLESS_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_ARMOR_MAX; break; } } }else if(crystalScroll){ for(int crystalarmorscroll : CRYSTAL_ARMOR_SCROLLS) { if(scroll.getItemId() == crystalarmorscroll) { if(item.getEnchantLevel() >= Config.CRYSTAL_ARMOR_ENCHANT_LEVEL.size()) { chance = Config.CRYSTAL_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 0); } else { chance = Config.CRYSTAL_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } minEnchantLevel = Config.CRYSTAL_ENCHANT_MIN; maxEnchantLevel = Config.CRYSTAL_ENCHANT_MAX; break; } } }else{ //normal scrolls for(int normalarmorscroll : NORMAL_ARMOR_SCROLLS) { if(scroll.getItemId() == normalarmorscroll) { if(item.getEnchantLevel() >= Config.NORMAL_ARMOR_ENCHANT_LEVEL.size()) { chance = Config.NORMAL_ARMOR_ENCHANT_LEVEL.get(Config.NORMAL_ARMOR_ENCHANT_LEVEL.size()); } else { chance = Config.NORMAL_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_ARMOR_MAX; break; } } } } else if(item.getItem().getType2() == L2Item.TYPE2_ACCESSORY) { if(blessedScroll){ for(int blessedjewelscroll : BLESSED_ARMOR_SCROLLS) { if(scroll.getItemId() == blessedjewelscroll) { if(item.getEnchantLevel() >= Config.BLESS_JEWELRY_ENCHANT_LEVEL.size()) { chance = Config.BLESS_JEWELRY_ENCHANT_LEVEL.get(Config.BLESS_JEWELRY_ENCHANT_LEVEL.size()); } else { chance = Config.BLESS_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_JEWELRY_MAX; break; } } }else if(crystalScroll){ for(int crystaljewelscroll : CRYSTAL_ARMOR_SCROLLS) { if(scroll.getItemId() == crystaljewelscroll) { if(item.getEnchantLevel() >= Config.CRYSTAL_JEWELRY_ENCHANT_LEVEL.size()) { chance = Config.CRYSTAL_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 0); } else { chance = Config.CRYSTAL_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } minEnchantLevel = Config.CRYSTAL_ENCHANT_MIN; maxEnchantLevel = Config.CRYSTAL_ENCHANT_MAX; break; } } }else{ for(int normaljewelscroll : NORMAL_ARMOR_SCROLLS) { if(scroll.getItemId() == normaljewelscroll) { if(item.getEnchantLevel() >= Config.NORMAL_JEWELRY_ENCHANT_LEVEL.size()) { chance = Config.NORMAL_JEWELRY_ENCHANT_LEVEL.get(Config.NORMAL_JEWELRY_ENCHANT_LEVEL.size()); } else { chance = Config.NORMAL_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1); } maxEnchantLevel = Config.ENCHANT_JEWELRY_MAX; break; } } } } Было get(Config.CRYSTAL_WEAPON_ENCHANT_LEVEL.size()) изменил на get(item.getEnchantLevel() + 0) З.Ы. Блессед скрулы не предлагать. Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты