Jump to content
  • 0

[HELP]Augment options!!!


Question

Posted

hi all again. i get this preconfigured pack  L2J-Archid Rev 1508 By Stefoulis15 its very nice.but i want to change the augmentation chances. where i have this option because i dont found it.i mean top grade like stone -skill chance,mid grade life stone -skill chance,top grade life stone- basestat chance ..... pls help me thx

5 answers to this question

Recommended Posts

  • 0
Posted

You need to implement this option

 

Index: java/config/Character.properties
===================================================================
--- java/config/Character.properties	(revision 2638)
+++ java/config/Character.properties	(working copy)
@@ -287,7 +287,7 @@
CastleCircletsRestriction = True

# This controls the chance an item has to break if it is enchanted.
@@ -323,6 +323,30 @@
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                             #
#============================================================#
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 2638)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -860,6 +860,33 @@
     /** 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 @@
	                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 @@
         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);
Index: java/net/sf/l2j/gameserver/datatables/AugmentationData.java
===================================================================
--- java/net/sf/l2j/gameserver/datatables/AugmentationData.java	(revision 2638)
+++ java/net/sf/l2j/gameserver/datatables/AugmentationData.java	(working copy)
@@ -35,7 +35,8 @@
/**
  * This class manages the augmentation data and can also create new augmentations.
  *
- * @author  durgus
+ * @author  durgus 
+ * edited by Gigiikun
+ * edited by xAddytzu (fx)
  */
public class AugmentationData
{
@@ -56,11 +57,6 @@
	// =========================================================
	// 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 @@
	//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 @@
	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 @@
		_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 @@
						{
							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 @@
									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 @@

	// =========================================================
	// Properties - Public
-	
+
	/**
	 * Generate a new random augmentation
	 * @param item
@@ -339,76 +345,139 @@
		// 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:
+		// 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;
+		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
-		int resultColor = 0;
		// 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);
+		// 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?

-		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);
-		
		// 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
		L2Skill skill = null;
		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);
	}

  • 0
Posted

and pls tell me where i need to put this file?:D because i dont know im new in this things:D thx

  • 0
Posted

Index: java/net/sf/l2j/gameserver/datatables/AugmentationData.java

Index: java/config/Character.properties

Index: java/net/sf/l2j/Config.java

  • 0
Posted

hes using a preconfig pack, he cant add the code

 

My FAQ is clear about them.

You use them - you risk.

Locked.

 

For further information, feel free to PM me.

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock