Jump to content

[Share] Anti - Heavy System - IL


Recommended Posts

Hello again, here is anti-heavy system.

 

Previous shares had problems, errors and more things.

 

Code :

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 45)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -558,7 +558,26 @@
	public static int HOPZONE_DUALBOXES_ALLOWED;
     public static boolean ALLOW_HOPZONE_GAME_SERVER_REPORT;
     
+    public static boolean ENABLE_ANTI_HEAVY;
+    	
     //--------------------------------------------------
	// Server
	//--------------------------------------------------
@@ -1462,6 +1481,38 @@
                 }
                 HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(mods.getProperty("HopzoneDualboxesAllowed", "1"));
                 ALLOW_HOPZONE_GAME_SERVER_REPORT = Boolean.parseBoolean(mods.getProperty("AllowHopzoneGameServerReport", "false"));

+                ENABLE_ANTI_HEAVY = Boolean.parseBoolean(mods.getProperty("EnableAntiHeavySystem", "True"));
+                   			
             }
             catch (Exception e)
             {

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: config/mods.properties
===================================================================
--- config/mods.properties	(revision 44)
+++ config/mods.properties	(working copy)
@@ -5,7 +5,7 @@
+
+# Enable or Disable anti-heavy system.
+# Dagger, tyrant, and bow classes won't be able to equip heavy type armours.
+EnableAntiHeavySystem = True
\ No newline at end of file

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(revision 44)
+++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(working copy)
@@ -31,6 +31,7 @@
import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
import net.sf.l2j.gameserver.network.serverpackets.ShowCalculator;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.templates.item.L2ArmorType;
import net.sf.l2j.gameserver.templates.item.L2Item;
import net.sf.l2j.gameserver.templates.item.L2Weapon;
import net.sf.l2j.gameserver.templates.item.L2WeaponType;
@@ -116,6 +117,17 @@
			return;
		}

+		if (Config.ENABLE_ANTI_HEAVY && item.getItemType() == L2ArmorType.HEAVY) {
+			if (activeChar.getClassId().getId() == 48 || activeChar.getClassId().getId() == 114 || activeChar.getClassId().getId() == 109
+				|| activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 36
+				|| activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 101
+				|| activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 8
+				|| activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 9) {
+				activeChar.sendMessage("Your class can't equip heavy type armors.");
+				return;
+			}
+		}
+		
		if (!Config.KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
		{
			switch (_itemId)

 

I would be greatful, if someone give feedback.

 

Coded on aCis, credits are DarthVader's and mine for the addaption - rework.

 

Link to comment
Share on other sites

It's a good code , pretty addapted ( not sure if it's yours , if is, congratulations) .Waiting for other shares .

 

EDIT : That's a really basic code and need more changed ( e.g. for changing subclass ) .

Link to comment
Share on other sites

if (activeChar.getClassId().getId() == 48 || activeChar.getClassId().getId() == 114 || activeChar.getClassId().getId() == 109
+				|| activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 36
+				|| activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 101
+				|| activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 8
+				|| activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 9) {

better way is to find something that connect this classes = they dont have heavy mastery, and do not do such big IF.

anyway try to do something 100% by u :)

Link to comment
Share on other sites

It's a good code , pretty addapted ( not sure if it's yours , if is, congratulations) .Waiting for other shares .

 

EDIT : That's a really basic code and need more changed ( e.g. for changing subclass ) .

 

I see the same mistake all over again!

 

If several persons have made the same thing, it doesn't mean anyone stole your idea, it just means it was such an obviously great idea that more than one person came up with the same thing. Is very small and easy LOL.

 

------------

 

Coded on aCis, credits are DarthVader's and mine for the addaption - rework.

 

addaption - rework?

 

1st. Adaptation is not rework. Rework means when you used the same idea and coded in a different way.

2nd. Rework? Can you explain me where is your touch? because adaptation is not required to work on another chronicle.

 

------------

 

On topic:

 

Better to make a passive skill for each class, in this way can be managed more easily and avoid writing crappy code.

 

Your heavy idea:

 

<mul val="0.1" order="0x30" stat="pDef">
            <using kind="Heavy"/>
</mul>

 

And much more, e.g: for weapons:

 

<mul val="0.5" order="0x30" stat="accCombat">
          <and>
            <using kind="Ancient,Sword,Bow,Dual Fist,Blunt,Big Blunt,Big Sword,Pole,Dual Sword"/>
              <not>
                <using kind="Dagger,Dual Dagger"/>
              </not>
          </and>
</mul>

 

Anyone else HATE the idea of not using HEAVY armor on any class? You need to change your class to see the texture, crap. Penalties are much better.

Link to comment
Share on other sites

yeah i agree, but even penaltys sucks, stats need to be that modified, that using light or robe will be better than heavy.

Link to comment
Share on other sites

yeah i agree, but even penaltys sucks, stats need to be that modified, that using light or robe will be better than heavy.

 

There are no problems.

 

For instance if you take Archer Class, you restrict both armors (Heavy and Robe) using "NOT" tags for Light.

 

<mul val="0.1" order="0x30" stat="pDef">
        <and>
          <using kind="Heavy,Magic"/>
            <not>
              <using kind="Light"/>
            </not>
        </and>
</mul>

Link to comment
Share on other sites

  • 2 weeks later...

why not use class restriction code for every armor?

 

	<item id="9417" name="Dynasty Breast Plate - Shield Master">
	<cond msgId="1518">
		<player class_id_restriction="90, 91, 99, 106" />
	</cond>

Link to comment
Share on other sites

why not use class restriction code for every armor?

 

	<item id="9417" name="Dynasty Breast Plate - Shield Master">
	<cond msgId="1518">
		<player class_id_restriction="90, 91, 99, 106" />
	</cond>

Because if someone start to adapt this line in all  Heavy Armor's ,will it takes a lot of hours to adapt it ... this code is 2 min work to put it in your pack .
Link to comment
Share on other sites

Hello again, here is anti-heavy system.

 

Previous shares had problems, errors and more things.

 

Code :

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 45)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -558,7 +558,26 @@
	public static int HOPZONE_DUALBOXES_ALLOWED;
     public static boolean ALLOW_HOPZONE_GAME_SERVER_REPORT;
     
+    public static boolean ENABLE_ANTI_HEAVY;
+    	
     //--------------------------------------------------
	// Server
	//--------------------------------------------------
@@ -1462,6 +1481,38 @@
                 }
                 HOPZONE_DUALBOXES_ALLOWED = Integer.parseInt(mods.getProperty("HopzoneDualboxesAllowed", "1"));
                 ALLOW_HOPZONE_GAME_SERVER_REPORT = Boolean.parseBoolean(mods.getProperty("AllowHopzoneGameServerReport", "false"));

+                ENABLE_ANTI_HEAVY = Boolean.parseBoolean(mods.getProperty("EnableAntiHeavySystem", "True"));
+                   			
             }
             catch (Exception e)
             {

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: config/mods.properties
===================================================================
--- config/mods.properties	(revision 44)
+++ config/mods.properties	(working copy)
@@ -5,7 +5,7 @@
+
+# Enable or Disable anti-heavy system.
+# Dagger, tyrant, and bow classes won't be able to equip heavy type armours.
+EnableAntiHeavySystem = True
\ No newline at end of file

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(revision 44)
+++ java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java	(working copy)
@@ -31,6 +31,7 @@
import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
import net.sf.l2j.gameserver.network.serverpackets.ShowCalculator;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
+import net.sf.l2j.gameserver.templates.item.L2ArmorType;
import net.sf.l2j.gameserver.templates.item.L2Item;
import net.sf.l2j.gameserver.templates.item.L2Weapon;
import net.sf.l2j.gameserver.templates.item.L2WeaponType;
@@ -116,6 +117,17 @@
			return;
		}

+		if (Config.ENABLE_ANTI_HEAVY && item.getItemType() == L2ArmorType.HEAVY) {
+			if (activeChar.getClassId().getId() == 48 || activeChar.getClassId().getId() == 114 || activeChar.getClassId().getId() == 109
+				|| activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 36
+				|| activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 24 || activeChar.getClassId().getId() == 101
+				|| activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 8
+				|| activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 9) {
+				activeChar.sendMessage("Your class can't equip heavy type armors.");
+				return;
+			}
+		}
+		
		if (!Config.KARMA_PLAYER_CAN_TELEPORT && activeChar.getKarma() > 0)
		{
			switch (_itemId)

 

I would be greatful, if someone give feedback.

 

Coded on aCis, credits are DarthVader's and mine for the addaption - rework.

It's awesome I'll try use it you are of the best here crystalia ;D
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.

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.

 Share



×
×
  • 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