Jump to content

[Share] Retail Grade Penalty System ( Interlude - Gracia pt2)


dEvilKinG

Recommended Posts

Here i have Grade Penalty retail system for interlude to Gracia Part2 (On Gracia final it was changed) 90% working.

It's been reworked for aCis, so you will need to apply it on your pack :)

What needed to be fixed:

Strider speed.

Weapons SA not applying on weapon penalty

Mage Success rate

* I just noticed main armor matches 1 item, so it needs to be changed.

 

How it works:

Grade Penalties:

Weapon:

*General: No SA Applied,-20 Accuracy

*Mage:  Attack failed on magic skills

 

Armor:

Armor goes by level, each item which is not allowed to wear due to grade increases penalty level

Main armor matches 2 items.

Shield & Jewels is used for armor penalty.

Max Armor penalty = 4, even if you wear full jewel set and armor, level is maxxed on 4.

Set Extra stats such as for example casting speed etc is applied normaly.

Grade doesn't matter, same results for D,C,B,A,S grades.

 

Values affected:

Evasion: -2 * penalty lvl

Speed: -15%, -30%, -45%, -50%

Casting Speed: -15%, -30%, -45%, -50%

 

 

 

### Eclipse Workspace Patch 1.0
#P aCis
Index: aCis_datapack/data/xml/skills/4200-4299.xml
===================================================================
--- aCis_datapack/data/xml/skills/4200-4299.xml	(revision 269)
+++ aCis_datapack/data/xml/skills/4200-4299.xml	(working copy)
@@ -1007,11 +1007,6 @@
		<set name="skillType" val="DEBUFF" />
		<set name="operateType" val="OP_PASSIVE" />
		<set name="stayAfterDeath" val="true" />
-		<for>
-			<mul order="0x30" stat="pAtkSpd" val="0.5" />
-			<mul order="0x30" stat="mAtkSpd" val="0.5" />
-			<mul order="0x30" stat="runSpd" val="0.5" />
-		</for>
	</skill>
	<skill id="4268" levels="1" name="Danger Area">
		<set name="target" val="TARGET_SELF" />
Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java
===================================================================
--- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java	(revision 269)
+++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java	(working copy)
@@ -350,21 +350,82 @@
		if (getActiveChar() == null)
			return 1;

-		int val;
+		int val = super.getRunSpeed();
+		int pen = getActiveChar().getExpertiseArmorPenalty();

		L2PcInstance player = getActiveChar();
-		if (player.is-beep-ted())
+
+		if (pen == 1)
+			val = (int)(val - (val * 0.15));
+		
+		else if (pen == 2)
+			val = (int)(val - (val * 0.3));
+		
+		else if (pen == 3)
+			val = (int)(val - (val * 0.45));
+		
+		else if (pen == 4)
+			val = (int)(val - (val * 0.5));
+
+		/*if (player.is-beep-ted())
		{
			int baseRunSpd = NpcTable.getInstance().getTemplate(getActiveChar().get-beep-tNpcId()).getBaseRunSpd();
			val = (int) (calcStat(Stats.RUN_SPEED, baseRunSpd, null, null));
		}
-		else
-			val = super.getRunSpeed();
+		*/
+		return val;
+	}
+	
+	@Override
+	public int getMAtkSpd()
+	{
+		if (getActiveChar() == null)
+			return 1;

+		int val = super.getMAtkSpd();
+		int pen = getActiveChar().getExpertiseArmorPenalty();
+		if (pen == 1)
+			val = (int)(val - (val * 0.15));
+		
+		else if (pen == 2)
+			val = (int)(val - (val * 0.3));
+		
+		else if (pen == 3)
+			val = (int)(val - (val * 0.45));
+		
+		else if (pen == 4)
+			val = (int)(val - (val * 0.5));
+
		return val;
	}

	@Override
+	public int getEvasionRate(L2Character target)
+	{
+		if (getActiveChar() == null)
+			return 1;
+		
+		int val = super.getEvasionRate(target);
+		int pen = getActiveChar().getExpertiseArmorPenalty();
+		if (pen > 0)
+			val = (int) val - (2 * pen);
+		return val;
+	}
+	
+	@Override
+	public int getAccuracy()
+	{
+		if (getActiveChar() == null)
+			return 1;
+		
+		int val = super.getAccuracy();
+		int pen = getActiveChar().getExpertiseWeaponPenalty();
+		if (pen > 0)
+			val = (val -20);
+		return val;
+	}
+	
+	@Override
	public float getMovementSpeedMultiplier()
	{
		if (getActiveChar() == null)
Index: aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 269)
+++ aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -595,7 +595,9 @@

	/** The current higher Expertise of the L2PcInstance (None=0, D=1, C=2, B=3, A=4, S=5) */
	private int _expertiseIndex; // index in EXPERTISE_LEVELS
-	private int _expertisePenalty = 0;
+    private int _expertiseArmorPenalty = 0; 
+	private int _expertiseWeaponPenalty = 0; 
+	private int _expertisePenalty = 0; 

	private L2ItemInstance _activeEnchantItem = null;

@@ -1735,11 +1737,22 @@
		return (int) calcStat(Stats.MAX_LOAD, baseLoad * Config.ALT_WEIGHT_LIMIT, this, null);
	}

-	public int getExpertisePenalty()
-	{
-		return _expertisePenalty;
+	public int getExpertiseArmorPenalty() 
+ 	{ 
+		return _expertiseArmorPenalty; 
+ 	} 
+	
+	public int getExpertiseWeaponPenalty() 
+	{ 
+		return _expertiseWeaponPenalty; 
	}

+	public int getExpertisePenalty() 
+	{ 
+		return _expertisePenalty; 
+	}
+	
+	
	public int getWeightPenalty()
	{
		return _curWeightPenalty;
@@ -1791,33 +1804,58 @@

	public void refreshExpertisePenalty()
	{
-		int newPenalty = 0;
+		int armorPenalty = 0;
+		int weaponPenalty = 0;
+		int expertisePenalty = 0;

		for (L2ItemInstance item : getInventory().getItems())
		{
-			if (item != null && item.isEquipped())
+			if (item != null && item.isEquipped() && (item.getItemType() != L2EtcItemType.ARROW))
			{
				int crystaltype = item.getItem().getCrystalType();

-				if (crystaltype > newPenalty)
-					newPenalty = crystaltype;
+				if (crystaltype > getExpertiseIndex())
+				{
+					expertisePenalty++;
+					if (item.isWeapon() && crystaltype > weaponPenalty)
+						weaponPenalty++;
+					else if (crystaltype > armorPenalty)
+						armorPenalty++;
+				}
			}
		}

-		newPenalty = newPenalty - getExpertiseIndex();
+		boolean changed = false;

-		if (newPenalty <= 0)
-			newPenalty = 0;
+		// calc armor penalty

-		if (getExpertisePenalty() != newPenalty)
+		if (armorPenalty < 0)
+			armorPenalty = 0;
+		else if (armorPenalty > 4)
+			armorPenalty = 4;
+		
+		
+		// calc weapon penalty
+		if (weaponPenalty < 0)
+			weaponPenalty = 0;
+		else if (weaponPenalty > 1)
+			weaponPenalty = 1;
+		
+		if ((getExpertiseWeaponPenalty() != weaponPenalty) || (getExpertiseArmorPenalty() != armorPenalty))
		{
-			_expertisePenalty = newPenalty;
-			
-			if (newPenalty > 0)
-				super.addSkill(SkillTable.getInstance().getInfo(4267, 1)); // level used to be newPenalty
+			_expertiseWeaponPenalty = weaponPenalty;
+			_expertiseArmorPenalty = armorPenalty;
+			_expertisePenalty = expertisePenalty;
+			if ((_expertiseWeaponPenalty > 0) || (_expertiseArmorPenalty > 0))
+				super.addSkill(SkillTable.getInstance().getInfo(4267, 1)); 
			else
				super.removeSkill(getKnownSkill(4267));

+			changed = true;
+		}
+		
+		if (changed)
+		{
			sendSkillList();
			sendPacket(new EtcStatusUpdate(this));
		}

 

Credits dEvilKinG.

Reworked for aCis.

Have fun :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...