Selaa lähdekoodia

More retail-like augmentation process thanks Gigii-kun

Quote:
Changes:
- With this patch you can control the chance to get skills/BaseStatModifier/Glow effect easily.
- Augmentation process is more retail like, augmentId of stat34 is defines from what range of augmentId can you get for stat12. 100-200 augmentation with this patch has similar distribution as 100-200 augmentation from retail.

Version 2:
- added support for lvl82 stones
- removed not retail like conditions(Ex.: now you can use lvl46 LS for every Crystal Type weapon)

Missing:
- real retail values for the chances  
- a lot of information for LS lvl dependence on stat34-stat12 values, current version probably still custom.

This is only for weapon augmentation!
Sami 16 vuotta sitten
vanhempi
sitoutus
0eb4d782e9

+ 25 - 1
L2_GameServer/java/config/Character.properties

@@ -287,7 +287,7 @@ CastleLordsCrownRestriction = True
 CastleCircletsRestriction = True
 
 #============================================================#
-#                        Enchanting                          #
+#                  Enchanting & Augmenting                   #
 #============================================================#
 
 # This controls the chance an item has to break if it is enchanted.
@@ -323,6 +323,30 @@ EnchantMaxJewelry = 0
 EnchantSafeMax = 3
 EnchantSafeMaxFull = 4
 
+# These controls the chance to get a skill in the augmentation process
+# Retail: 15, 30, 45, 60
+AugmentationNGSkillChance = 15
+AugmentationMidSkillChance = 30
+AugmentationHighSkillChance = 45
+AugmentationTopSkillChance = 60
+
+# These controls the chance to get a Base Stat Modifier in the augmentation process
+# Note:
+#       No dependancy on LS grade
+# Retail: 1
+AugmentationBaseStatChance = 1
+
+# These controls the chance to get a glow effect in the augmentation process
+# Note:
+#       No/Mid Grade Life Stone can not have glow effect
+#       if you do not get a skill or Base Stat Modifier
+#       On Retail you can not get glow effect with NoGrade LS
+# Retail: 0, 40, 70, 100
+AugmentationNGGlowChance = 0
+AugmentationMidGlowChance = 40
+AugmentationHighGlowChance = 70
+AugmentationTopGlowChance = 100
+
 #============================================================#
 #                          Karma                             #
 #============================================================#

+ 46 - 0
L2_GameServer/java/net/sf/l2j/Config.java

@@ -860,6 +860,33 @@ public final class Config
     /** maximum level of safe enchantment for full body armor*/
     public static int ENCHANT_SAFE_MAX_FULL;
 
+    /** Chance to get a skill while using a NoGrade Life Stone*/
+    public static int AUGMENTATION_NG_SKILL_CHANCE;
+
+    /** Chance to get a Glow effect while using a NoGrade Life Stone(only if you get a skill)*/
+    public static int AUGMENTATION_NG_GLOW_CHANCE;
+
+    /** Chance to get a skill while using a MidGrade Life Stone*/
+    public static int AUGMENTATION_MID_SKILL_CHANCE;
+
+    /** Chance to get a Glow effect while using a MidGrade Life Stone(only if you get a skill)*/
+    public static int AUGMENTATION_MID_GLOW_CHANCE;
+
+    /** Chance to get a skill while using a HighGrade Life Stone*/
+    public static int AUGMENTATION_HIGH_SKILL_CHANCE;
+
+    /** Chance to get a Glow effect while using a HighGrade Life Stone*/
+    public static int AUGMENTATION_HIGH_GLOW_CHANCE;
+
+    /** Chance to get a skill while using a TopGrade Life Stone*/
+    public static int AUGMENTATION_TOP_SKILL_CHANCE;
+
+    /** Chance to get a Glow effect while using a TopGrade Life Stone*/
+    public static int AUGMENTATION_TOP_GLOW_CHANCE;
+
+    /** Chance to get a BaseStatModifier in the augmentation process*/
+    public static int AUGMENTATION_BASESTAT_CHANCE;
+
     // Character multipliers
     /** Multiplier for character HP regeneration */
     public static double  HP_REGEN_MULTIPLIER;
@@ -1246,6 +1273,15 @@ public final class Config
 	                ENCHANT_MAX_JEWELRY					= Integer.parseInt(Character.getProperty("EnchantMaxJewelry", "255"));
 	                ENCHANT_SAFE_MAX					= Integer.parseInt(Character.getProperty("EnchantSafeMax", "3"));
 	                ENCHANT_SAFE_MAX_FULL				= Integer.parseInt(Character.getProperty("EnchantSafeMaxFull", "4"));
+	                AUGMENTATION_NG_SKILL_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationNGSkillChance", "15"));
+	                AUGMENTATION_NG_GLOW_CHANCE			= Integer.parseInt(Character.getProperty("AugmentationNGGlowChance", "0"));
+	                AUGMENTATION_MID_SKILL_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationMidSkillChance", "30"));
+	                AUGMENTATION_MID_GLOW_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationMidGlowChance", "40"));
+	                AUGMENTATION_HIGH_SKILL_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationHighSkillChance", "45"));
+	                AUGMENTATION_HIGH_GLOW_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationHighGlowChance", "70"));
+	                AUGMENTATION_TOP_SKILL_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationTopSkillChance", "60"));
+	                AUGMENTATION_TOP_GLOW_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationTopGlowChance", "100"));
+	                AUGMENTATION_BASESTAT_CHANCE		= Integer.parseInt(Character.getProperty("AugmentationBaseStatChance", "1"));
 	                ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE	= Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
 	                ALT_GAME_KARMA_PLAYER_CAN_SHOP		= Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanShop", "true"));
 	                ALT_GAME_KARMA_PLAYER_CAN_TELEPORT	= Boolean.parseBoolean(Character.getProperty("AltKarmaPlayerCanTeleport", "true"));
@@ -2099,6 +2135,16 @@ public final class Config
         else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
         else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
 
+        else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);
+
         else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
         else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
         else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);

+ 135 - 64
L2_GameServer/java/net/sf/l2j/gameserver/datatables/AugmentationData.java

@@ -35,7 +35,8 @@ import org.w3c.dom.Node;
 /**
  * This class manages the augmentation data and can also create new augmentations.
  *
- * @author  durgus
+ * @author  durgus 
+ * edited by Gigiikun
  */
 public class AugmentationData
 {
@@ -56,11 +57,6 @@ public class AugmentationData
 	// =========================================================
 	// Data Field
 	
-	// chances
-	//private static final int CHANCE_STAT = 88;
-	private static final int CHANCE_SKILL = 11;
-	private static final int CHANCE_BASESTAT = 1;
-	
 	// stats
 	private static final int STAT_START = 1;
 	private static final int STAT_END = 14560;
@@ -68,6 +64,11 @@ public class AugmentationData
 	//private static final int STAT_NUMBEROF_BLOCKS = 4;
 	private static final int STAT_SUBBLOCKSIZE = 91;
 	//private static final int STAT_NUMBEROF_SUBBLOCKS = 40;
+
+	// skills
+	// private static final int BLUE_START = 14561;
+	private static final int PURPLE_START = 14578;
+	private static final int RED_START = 14685;
 	
 	// basestats
 	private static final int BASESTAT_STR = 16341;
@@ -76,9 +77,10 @@ public class AugmentationData
 	private static final int BASESTAT_MEN = 16344;
 	
 	private FastList<?> _augmentationStats[];
-	private FastList<augmentationSkill> _activeSkills;
-	private FastList<augmentationSkill> _passiveSkills;
-	private FastList<augmentationSkill> _chanceSkills;
+	private FastList<augmentationSkill> _blueSkills;
+	private FastList<augmentationSkill> _purpleSkills;
+	private FastList<augmentationSkill> _redSkills;
+	private int _skillsCount;
 	
 	// =========================================================
 	// Constructor
@@ -92,15 +94,17 @@ public class AugmentationData
 		_augmentationStats[2] = new FastList<augmentationStat>();
 		_augmentationStats[3] = new FastList<augmentationStat>();
 		
-		_activeSkills = new FastList<augmentationSkill>();
-		_passiveSkills = new FastList<augmentationSkill>();
-		_chanceSkills = new FastList<augmentationSkill>();
+		_blueSkills = new FastList<augmentationSkill>();
+		_purpleSkills = new FastList<augmentationSkill>();
+		_redSkills = new FastList<augmentationSkill>();
 		
 		load();
 		
+		_skillsCount = _blueSkills.size() + _purpleSkills.size() + _redSkills.size();
+		
 		// Use size*4: since theres 4 blocks of stat-data with equivalent size
 		_log.info("AugmentationData: Loaded: " + (_augmentationStats[0].size() * 4) + " augmentation stats.");
-		_log.info("AugmentationData: Loaded: " + _activeSkills.size() + " active, " + _passiveSkills.size() + " passive and " + _chanceSkills.size() + " chance skills");
+		_log.info("AugmentationData: Loaded: " + _blueSkills.size() + " blue, " + _purpleSkills.size() + " purple and " + _redSkills.size() + " red skills");
 	}
 	
 	// =========================================================
@@ -216,7 +220,9 @@ public class AugmentationData
 						{
 							NamedNodeMap attrs = d.getAttributes();
 							int skillId = 0, augmentationId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
-							String type = "passive";
+							// type of the skill is not needed anymore but I do not erase the code.
+							// maybe someone can use it for something
+							// String type = "passive";
 							
 							for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
 							{
@@ -225,19 +231,19 @@ public class AugmentationData
 									attrs = cd.getAttributes();
 									skillId = Integer.parseInt(attrs.getNamedItem("val").getNodeValue());
 								}
-								else if ("type".equalsIgnoreCase(cd.getNodeName()))
+								/* else if ("type".equalsIgnoreCase(cd.getNodeName()))
 								{
 									attrs = cd.getAttributes();
 									type = attrs.getNamedItem("val").getNodeValue();
-								}
+								}*/
 							}
 							
-							if (type.equalsIgnoreCase("active"))
-								_activeSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
-							else if (type.equalsIgnoreCase("passive"))
-								_passiveSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
+							if (augmentationId < PURPLE_START)
+								_blueSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
+							else if (augmentationId < RED_START)
+								_purpleSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
 							else
-								_chanceSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
+								_redSkills.add(new augmentationSkill(skillId, st.getMaxLevel(skillId, 1), augmentationId));
 						}
 					}
 				}
@@ -325,7 +331,7 @@ public class AugmentationData
 	
 	// =========================================================
 	// Properties - Public
-	
+
 	/**
 	 * Generate a new random augmentation
 	 * @param item
@@ -339,49 +345,112 @@ public class AugmentationData
 		// this is because a value can contain up to 2 stat modifications
 		// (there are two short values packed in one integer value, meaning 4 stat modifications at max)
 		// for more info take a look at getAugStatsById(...)
-		
+
 		// Note: lifeStoneGrade: (0 means low grade, 3 top grade)
-		// First: decide which grade the augmentation result is going to have:
-		// 0:yellow, 1:blue, 2:purple, 3:red
+		// First: determine whether we will add a skill/baseStatModifier or not
+		//        because this determine which color could be the result 
+		int skill_Chance = 0;
+		int stat34 = 0;
+		boolean generateSkill = false;
 		int resultColor = 0;
+		boolean generateGlow = false;
+		//lifestonelevel is used for stat Id and skill level, but here the max level is 10
+		if (lifeStoneLevel > 10) lifeStoneLevel = 10;
+		switch (lifeStoneGrade)
+		{
+			case 0:
+				skill_Chance = Config.AUGMENTATION_NG_SKILL_CHANCE;
+				if (Rnd.get(1,100) <= Config.AUGMENTATION_NG_GLOW_CHANCE)
+					generateGlow = true;
+				break;
+			case 1:
+				skill_Chance = Config.AUGMENTATION_MID_SKILL_CHANCE;
+				if (Rnd.get(1,100) <= Config.AUGMENTATION_MID_GLOW_CHANCE)
+					generateGlow = true;
+				break;
+			case 2:
+				skill_Chance = Config.AUGMENTATION_HIGH_SKILL_CHANCE;
+				if (Rnd.get(1,100) <= Config.AUGMENTATION_HIGH_GLOW_CHANCE)
+					generateGlow = true;
+				break;
+			case 3:
+				skill_Chance = Config.AUGMENTATION_TOP_SKILL_CHANCE;
+				if (Rnd.get(1,100) <= Config.AUGMENTATION_TOP_GLOW_CHANCE)
+					generateGlow = true;
+		}
+
+		if (Rnd.get(1, 100) <= skill_Chance)
+			generateSkill = true;
+		else if (Rnd.get(1, 100) <= Config.AUGMENTATION_BASESTAT_CHANCE)
+			stat34 = Rnd.get(BASESTAT_STR, BASESTAT_MEN);
+
+		// 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,
-		// whats known is: u can also get a red result from a normal grade lifeStone
-		// however I will make it so that a higher grade lifeStone will more likely result in a
-		// higher grade augmentation... and the augmentation result will at least have the grade
-		// of the life stone
-		resultColor = Rnd.get(0, 100);
-		if (lifeStoneGrade == 3 || resultColor <= (15 * lifeStoneGrade) + 10)
-			resultColor = 3;
-		else if (lifeStoneGrade == 2 || resultColor <= (15 * lifeStoneGrade) + 20)
-			resultColor = 2;
-		else if (lifeStoneGrade == 1 || resultColor <= (15 * lifeStoneGrade) + 30)
-			resultColor = 1;
+		// whats known is: you cant have yellow with skill(or baseStatModifier)
+		//                 noGrade stone can not have glow, mid only with skill, high has a chance(custom), top allways glow
+		if (stat34 == 0 && !generateSkill)
+		{
+			resultColor = Rnd.get(0, 100);
+			if (resultColor <= (15 * lifeStoneGrade) + 40)
+				resultColor = 1;
+			else
+				resultColor = 0;
+		}
 		else
-			resultColor = 0;
+		{
+			resultColor = Rnd.get(0, 100);
+			if (resultColor <= (10 * lifeStoneGrade) + 5 || stat34 != 0)
+				resultColor = 3;
+			else if (resultColor <= (10 * lifeStoneGrade) + 10)
+				resultColor = 1;
+			else
+				resultColor = 2;
+		}
 		
-		// Second: Calculate the subblock offset for the choosen color,
+		// Third: Calculate the subblock offset for the choosen color,
 		// and the level of the lifeStone
-		int colorOffset = (resultColor * (STAT_SUBBLOCKSIZE * 10)) + ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE);
-		
-		int offset = ((3 - lifeStoneGrade) * STAT_BLOCKSIZE) + colorOffset;
-		
-		int stat12 = Rnd.get(offset, offset + STAT_SUBBLOCKSIZE);
-		int stat34 = 0;
-		boolean generateSkill = false;
-		
-		// use a chance to determine whether we will add a skill or not
-		if (Rnd.get(1, 100) <= CHANCE_SKILL)
-			generateSkill = true;
-		// only if no skill is going to be applyed
-		else if (Rnd.get(1, 100) <= CHANCE_BASESTAT)
-			stat34 = Rnd.get(BASESTAT_STR, BASESTAT_MEN);
+		// from large number of retail augmentations:
+		// no skill part
+		// Id for stat12:
+		// A:1-910 B:911-1820 C:1821-2730 D:2731-3640 E:3641-4550 F:4551-5460 G:5461-6370 H:6371-7280
+		// Id for stat34(this defines the color):
+		// I:7281-8190(yellow) K:8191-9100(blue) L:10921-11830(yellow) M:11831-12740(blue)
+		// you can combine I-K with A-D and L-M with E-H
+		// using C-D or G-H Id you will get a glow effect
+		// there seems no correlation in which grade use which Id except for the glowing restriction
+		// skill part
+		// Id for stat12:
+		// same for no skill part
+		// A same as E, B same as F, C same as G, D same as H
+		// A - no glow, no grade LS
+		// B - weak glow, mid grade LS?
+		// C - glow, high grade LS?
+		// D - strong glow, top grade LS?
 		
 		// is neither a skill nor basestat used for stat34? then generate a normal stat
+		int stat12 = 0;
 		if (stat34 == 0 && !generateSkill)
 		{
-			offset = (lifeStoneGrade * STAT_BLOCKSIZE) + colorOffset;
+			int temp = Rnd.get(2,3);
+			int colorOffset = resultColor * (10 * STAT_SUBBLOCKSIZE) + temp * STAT_BLOCKSIZE + 1;
+			int offset = ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE) + colorOffset;
 			
-			stat34 = Rnd.get(offset, offset + STAT_SUBBLOCKSIZE);
+			stat34 = Rnd.get(offset, offset + STAT_SUBBLOCKSIZE - 1);
+			if (generateGlow && lifeStoneGrade >= 2)
+				offset = ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE) + (temp - 2) * STAT_BLOCKSIZE + lifeStoneGrade * (10 * STAT_SUBBLOCKSIZE) + 1;
+			else
+				offset = ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE) + (temp - 2) * STAT_BLOCKSIZE + Rnd.get(0, 1) * (10 * STAT_SUBBLOCKSIZE) + 1;
+			stat12 = Rnd.get(offset, offset + STAT_SUBBLOCKSIZE - 1);
+		}
+		else
+		{
+			int offset;
+			if (!generateGlow)
+				offset = ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE) + Rnd.get(0, 1) * STAT_BLOCKSIZE + 1;
+			else
+				offset = ((lifeStoneLevel - 1) * STAT_SUBBLOCKSIZE) + Rnd.get(0, 1) * STAT_BLOCKSIZE + (lifeStoneGrade + resultColor) / 2 * (10 * STAT_SUBBLOCKSIZE) + 1;
+			stat12 = Rnd.get(offset, offset + STAT_SUBBLOCKSIZE - 1);
 		}
 		
 		// generate a skill if neccessary
@@ -389,26 +458,28 @@ public class AugmentationData
 		if (generateSkill)
 		{
 			augmentationSkill temp = null;
-			switch (Rnd.get(1, 3))
+			switch (resultColor)
 			{
-				case 1: // chance skill
-					temp = _chanceSkills.get(Rnd.get(0, _chanceSkills.size() - 1));
+				case 1: // blue skill
+					temp = _blueSkills.get(Rnd.get(0, _blueSkills.size() - 1));
 					skill = temp.getSkill(lifeStoneLevel);
-					stat34 = temp.getAugmentationSkillId();
+					stat34 = temp.getAugmentationSkillId() + (lifeStoneLevel - 1) * _skillsCount;
 					break;
-				case 2: // active skill
-					temp = _activeSkills.get(Rnd.get(0, _activeSkills.size() - 1));
+				case 2: // purple skill
+					temp = _purpleSkills.get(Rnd.get(0, _purpleSkills.size() - 1));
 					skill = temp.getSkill(lifeStoneLevel);
-					stat34 = temp.getAugmentationSkillId();
+					stat34 = temp.getAugmentationSkillId() + (lifeStoneLevel - 1) * _skillsCount;
 					break;
-				case 3: // passive skill
-					temp = _passiveSkills.get(Rnd.get(0, _passiveSkills.size() - 1));
+				case 3: // red skill
+					temp = _redSkills.get(Rnd.get(0, _redSkills.size() - 1));
 					skill = temp.getSkill(lifeStoneLevel);
-					stat34 = temp.getAugmentationSkillId();
+					stat34 = temp.getAugmentationSkillId() + (lifeStoneLevel - 1) * _skillsCount;
 					break;
 			}
 		}
 		
+		if (Config.DEBUG)
+			_log.info("Augmentation success: stat12=" + stat12 + "; stat34=" + stat34 + "; resultColor=" + resultColor + "; level=" + lifeStoneLevel + "; grade=" + lifeStoneGrade);
 		return new L2Augmentation(((stat34 << 16) + stat12), skill);
 	}
 	

+ 1 - 34
L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/RequestConfirmRefinerItem.java

@@ -64,7 +64,7 @@ public class RequestConfirmRefinerItem extends L2GameClientPacket
 		int refinerItemId = refinerItem.getItem().getItemId();
 
 		// is the item a life stone?
-		if (refinerItemId < 8723 || (refinerItemId > 8762 && refinerItemId < 9573) || refinerItemId > 9576)
+		if (refinerItemId < 8723 || (refinerItemId > 8762 && refinerItemId < 9573) || (refinerItemId > 9576 && refinerItemId < 10483) || refinerItemId > 10486)
 		{
 			activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM));
 			return;
@@ -78,7 +78,6 @@ public class RequestConfirmRefinerItem extends L2GameClientPacket
 
 		int gemstoneCount=0;
 		int gemstoneItemId=0;
-		int lifeStoneLevel = getLifeStoneLevel(refinerItemId);
 		SystemMessage sm = new SystemMessage(SystemMessageId.REQUIRES_S1_S2);
 		switch (itemGrade)
 		{
@@ -89,22 +88,12 @@ public class RequestConfirmRefinerItem extends L2GameClientPacket
 				sm.addString("Gemstone D");
 				break;
 			case L2Item.CRYSTAL_B:
-				if (lifeStoneLevel < 3)
-				{
-					activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM));
-					return;
-				}
 				gemstoneCount = 30;
 				gemstoneItemId = GEMSTONE_D;
 				sm.addNumber(gemstoneCount);
 				sm.addString("Gemstone D");
 				break;
 			case L2Item.CRYSTAL_A:
-				if (lifeStoneLevel < 6)
-				{
-					activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM));
-					return;
-				}
 				gemstoneCount = 20;
 				gemstoneItemId = GEMSTONE_C;
 				sm.addNumber(gemstoneCount);
@@ -112,11 +101,6 @@ public class RequestConfirmRefinerItem extends L2GameClientPacket
 				break;
 			case L2Item.CRYSTAL_S:
 			case L2Item.CRYSTAL_S80:
-				if (lifeStoneLevel != 10)
-				{
-					activeChar.sendPacket(new SystemMessage(SystemMessageId.THIS_IS_NOT_A_SUITABLE_ITEM));
-					return;
-				}
 				gemstoneCount = 25;
 				gemstoneItemId = GEMSTONE_C;
 				sm.addNumber(gemstoneCount);
@@ -129,23 +113,6 @@ public class RequestConfirmRefinerItem extends L2GameClientPacket
 		activeChar.sendPacket(sm);
 	}
 
-	private int getLifeStoneGrade(int itemId)
-	{
-		itemId -= 8723;
-        if (itemId < 10 || itemId == 850) return 0; // normal grade
-        if (itemId < 20 || itemId == 851) return 1; // mid grade
-        if (itemId < 30 || itemId == 852) return 2; // high grade
-		return 3; // top grade
-	}
-
-	private int getLifeStoneLevel(int itemId)
-	{
-		itemId -= 10 * getLifeStoneGrade(itemId);
-		itemId -= 8722;
-		if (itemId > 823) return 10;
-		return itemId;
-	}
-
 	/**
 	 * @see net.sf.l2j.gameserver.BasePacket#getType()
 	 */

+ 14 - 9
L2_GameServer/java/net/sf/l2j/gameserver/network/clientpackets/RequestRefine.java

@@ -156,7 +156,7 @@ public final class RequestRefine extends L2GameClientPacket
 		int gemstoneItemId = gemstoneItem.getItemId();
 
 		// is the refiner Item a life stone?
-		if (lifeStoneId < 8723 || (lifeStoneId > 8762 &&  lifeStoneId < 9573) || lifeStoneId > 9576) return false;
+		if (lifeStoneId < 8723 || (lifeStoneId > 8762 &&  lifeStoneId < 9573) || (lifeStoneId > 9576 && lifeStoneId < 10483) || lifeStoneId > 10486) return false;
 
 		// must be a weapon, must be > d grade
 		// TODO: can do better? : currently: using isdestroyable() as a check for hero / cursed weapons
@@ -176,16 +176,17 @@ public final class RequestRefine extends L2GameClientPacket
 				modifyGemstoneCount = 20;
 				break;
 			case L2Item.CRYSTAL_B:
-				if (lifeStoneLevel < 3 || player.getLevel() < 52 || gemstoneItemId != 2130) return false;
+				if (player.getLevel() < 52 || gemstoneItemId != 2130) return false;
 				modifyGemstoneCount = 30;
 				break;
 			case L2Item.CRYSTAL_A:
-				if (lifeStoneLevel < 6 || player.getLevel() < 61 || gemstoneItemId != 2131) return false;
+				if (player.getLevel() < 61 || gemstoneItemId != 2131) return false;
 				modifyGemstoneCount = 20;
 				break;
-			case L2Item.CRYSTAL_S:
 			case L2Item.CRYSTAL_S80:
-				if (lifeStoneLevel != 10 || player.getLevel() < 76 || gemstoneItemId != 2131) return false;
+				if (player.getLevel() < 80 || gemstoneItemId != 2131) return false;
+			case L2Item.CRYSTAL_S:
+				if (player.getLevel() < 76 || gemstoneItemId != 2131) return false;
 				modifyGemstoneCount = 25;
 				break;
 		}
@@ -226,6 +227,9 @@ public final class RequestRefine extends L2GameClientPacket
             case 11:
                 if (player.getLevel() < 80) return false;
                 break;
+            case 12:
+                if (player.getLevel() < 82) return false;
+                break;
 		}
 
 		if (gemstoneItem.getCount()-modifyGemstoneCount < 0) return false;
@@ -264,9 +268,9 @@ public final class RequestRefine extends L2GameClientPacket
 	private int getLifeStoneGrade(int itemId)
 	{
 		itemId -= 8723;
-		if (itemId < 10 || itemId == 850) return 0; // normal grade
-		if (itemId < 20 || itemId == 851) return 1; // mid grade
-		if (itemId < 30 || itemId == 852) return 2; // high grade
+		if (itemId < 10 || itemId == 850 || itemId == 1760) return 0; // normal grade
+		if (itemId < 20 || itemId == 851 || itemId == 1761) return 1; // mid grade
+		if (itemId < 30 || itemId == 852 || itemId == 1762) return 2; // high grade
 		return 3; // top grade
 	}
 
@@ -274,7 +278,8 @@ public final class RequestRefine extends L2GameClientPacket
 	{
         itemId -= 10 * getLifeStoneGrade(itemId);
         itemId -= 8722;
-        if (itemId > 823) return 10;
+        if (itemId > 823 && itemId < 852) return 11;
+        if (itemId > 833 && itemId < 1762) return 12;
         return itemId;
 	}