Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/config/CustomMods/ProtectionMods.ini b/config/CustomMods/ProtectionMods.ini
- index c476345..a877b86 100644
- --- a/config/CustomMods/ProtectionMods.ini
- +++ b/config/CustomMods/ProtectionMods.ini
- @@ -53,3 +53,16 @@
- # Recomended is True ( Official = False )
- PvPSumon = False
- +#=============================================================
- +# Anti Hervy System
- +#=============================================================
- +# Enable or Disable anti-heavy system.
- +# Dagger, tyrant, and bow classes won't be able to equip heavy type armours.
- +EnableAntiHeavySystem = True
- +
- +#Screen Message Anti Hervy Class user
- +ScreenAntiHervyMessageText = Your Class Can't Equip Heavy Type Armors!
- +
- +# Show screen AntiHervy message for x seconds when character
- +ScreenAntiHervyMessageTime = 4
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index ffaa2f8..055f23e 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -85,6 +85,9 @@
- /** Clan Hall function */
- public static boolean PVP_SAME_IP;
- public static boolean PVP_SUMON;
- + public static boolean ENABLE_ANTI_HEAVY;
- + public static String WELCOME_MESSAGE_ANTIHERVY;
- + public static int WELCOME_MESSAGE_TIME_ANTIHERVY;
- public static long CH_TELE_FEE_RATIO;
- public static int CH_TELE1_FEE;
- public static int CH_TELE2_FEE;
- @@ -1123,6 +1126,9 @@
- SHOUT_RESTRICTION_VALUE = Integer.parseInt(Protection.getProperty("ShoutRestrictionValue", "0"));
- PVP_SAME_IP = Boolean.parseBoolean(Protection.getProperty("PvPSameIP", "False"));
- PVP_SUMON = Boolean.parseBoolean(Protection.getProperty("PvPSumon", "False"));
- + ENABLE_ANTI_HEAVY = Boolean.parseBoolean(Protection.getProperty("EnableAntiHeavySystem", "True"));
- + WELCOME_MESSAGE_ANTIHERVY = Protection.getProperty("ScreenAntiHervyMessageText", "Your Class Can't Equip Heavy Type Armors!");
- + WELCOME_MESSAGE_TIME_ANTIHERVY = Integer.parseInt(Protection.getProperty("ScreenAntiHervyMessageTime", "6")) * 1000;
- }
- private static final void loadOff()
- diff --git a/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java b/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- index f3eb170..df7dd43 100644
- --- a/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- +++ b/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- @@ -3,6 +3,7 @@
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.enums.Paperdoll;
- import net.sf.l2j.gameserver.enums.items.ActionType;
- +import net.sf.l2j.gameserver.enums.items.ArmorType;
- import net.sf.l2j.gameserver.enums.items.EtcItemType;
- import net.sf.l2j.gameserver.enums.items.WeaponType;
- import net.sf.l2j.gameserver.enums.skills.SkillType;
- @@ -14,6 +15,7 @@
- import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- import net.sf.l2j.gameserver.model.item.kind.Item;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- import net.sf.l2j.gameserver.network.serverpackets.ItemList;
- import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
- import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
- @@ -67,7 +69,16 @@
- if (player.isAlikeDead() || player.isStunned() || player.isSleeping() || player.isParalyzed() || player.isAfraid())
- return;
- -
- + if (Config.ENABLE_ANTI_HEAVY && item.getItemType() == ArmorType.HEAVY) {
- + if (player.getClassId().getId() == 48 || player.getClassId().getId() == 114 || player.getClassId().getId() == 109
- + || player.getClassId().getId() == 37 || player.getClassId().getId() == 108 || player.getClassId().getId() == 36
- + || player.getClassId().getId() == 102 || player.getClassId().getId() == 24 || player.getClassId().getId() == 101
- + || player.getClassId().getId() == 23 || player.getClassId().getId() == 93 || player.getClassId().getId() == 8
- + || player.getClassId().getId() == 92 || player.getClassId().getId() == 9) {
- + player.sendPacket(new ExShowScreenMessage(Config.WELCOME_MESSAGE_ANTIHERVY, Config.WELCOME_MESSAGE_TIME_ANTIHERVY));
- + return;
- + }
- + }
- if (!Config.KARMA_PLAYER_CAN_TELEPORT && player.getKarma() > 0)
- {
- final IntIntHolder[] sHolders = item.getItem().getSkills();
Add Comment
Please, Sign In to add comment