Code: Select all
final String aug_type = rset.getString("type"); final int skill_level = rset.getInt("skill_level"); int stat12 = 0; int stat34 = rset.getInt("skill_id"); // comes from augmentation_skillmap.xml // Second: decide which grade the augmentation result is going to have: // 0:yellow, 1:blue, 2:purple, 3:red // The chances used here are most likely custom, // what's known is: you can't have yellow with skill(or baseStatModifier) // noGrade stone can not have glow, mid only with skill, high has a chance(custom), top allways glow int resultColor = 1; switch(aug_type) { default: resultColor = 1; break; case "red": resultColor = 3; break; case "purple": resultColor = 2; break; } // life stone level is used for stat Id and skill level, but here the max level is 9 int lifeStoneLevel = 9; int lifeStoneGrade = AbstractRefinePacket.GRADE_TOP; int temp = Rnd.get(2, 3); // is neither a skill nor basestat used for stat34? then generate a normal stat int offset = 0; //(lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + (((lifeStoneGrade + resultColor) / 2) * (10 * STAT_SUBBLOCKSIZE)) + 1;// offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + ((temp - 2) * STAT_BLOCKSIZE) + (lifeStoneGrade * (10 * STAT_SUBBLOCKSIZE)) + 1;// offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + (Rnd.get(0, 1) * STAT_BLOCKSIZE) + 1; int colorOffset = (resultColor * (10 * STAT_SUBBLOCKSIZE)) + (temp * STAT_BLOCKSIZE) + 1; offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + colorOffset; player.sendMessage("offset " + offset); stat12 = Rnd.get(offset, (offset + STAT_SUBBLOCKSIZE) - 1); final L2Augmentation aug = new L2Augmentation(((stat34 << 16) + stat12)); item.removeAugmentation(); item.setAugmentation(aug); // Update player client stat12 = 0x0000FFFF & aug.getAugmentationId(); stat34 = aug.getAugmentationId() >> 16; player.sendPacket(new ExVariationResult(stat12, stat34, 1)); L2ItemInstance[] unequiped = player.getInventory().equipItemAndRecord(item); StatusUpdate su = new StatusUpdate(player); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); InventoryUpdate iu = new InventoryUpdate(); for (L2ItemInstance itm : unequiped) { iu.addModifiedItem(itm); } player.sendPacket(iu); player.broadcastUserInfo();
