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 e0a8097..24f5fbd 100644
- --- a/config/CustomMods/ProtectionMods.ini
- +++ b/config/CustomMods/ProtectionMods.ini
- @@ -75,3 +75,44 @@
- RemoveChest = True
- RemoveLeg = True
- +#=============================================================
- +# Disable Bow For Class
- +#=============================================================
- +# Enable or Disable Bow For Class
- +# classId className
- +# 88 Duelist
- +# 89 DreadNought
- +# 90 Phoenix Knight
- +# 91 Hell Knight
- +# 92 Sagittarius
- +# 93 Adventurer
- +# 94 Archmage
- +# 95 Soultaker
- +# 96 Arcana Lord
- +# 97 Cardinal
- +# 98 Hierophant
- +# 99 Eva Templar
- +# 100 Sword Muse
- +# 101 Wind Rider
- +# 102 Moonlight Sentinel
- +# 103 Mystic Muse
- +# 104 Elemental Master
- +# 105 Eva Saint
- +# 106 Shillien Templar
- +# 107 Spectral Dancer
- +# 108 Ghost Hunter
- +# 109 Ghost Sentinel
- +# 110 Storm Screamer
- +# 111 Spectral Master
- +# 112 Shillen Saint
- +# 113 Titan
- +# 114 Grand Khauatari
- +# 115 Dominator
- +# 116 Doomcryer
- +# 117 Fortune Seeker
- +# 118 Maestro
- +
- +# e.g. DisableBowForClasses = 89, 90, 91, 92, 102, 109
- +AltDisableBow = False
- +DisableBowForClasses = 89
- +
- diff --git a/java/net/sf/l2j/Config.java b/java/net/sf/l2j/Config.java
- index 99cc0ee..a47fa13 100644
- --- a/java/net/sf/l2j/Config.java
- +++ b/java/net/sf/l2j/Config.java
- @@ -150,6 +150,9 @@
- public static boolean PHX_ENCHANT_WAREHOUSE;
- public static String WELCOME_MESSAGE_ENCHANT;
- public static int WELCOME_MESSAGE_TIME_ENCHANT;
- + public static boolean ALT_DISABLE_BOW_CLASSES;
- + public static String DISABLE_BOW_CLASSES_STRING;
- + public static ArrayList<Integer> DISABLE_BOW_CLASSES = new ArrayList<>();
- // --------------------------------------------------
- // Events settings
- // --------------------------------------------------
- @@ -1135,6 +1138,14 @@
- REMOVE_WEAPON = Boolean.parseBoolean(Protection.getProperty("RemoveWeapon", "False"));
- REMOVE_CHEST = Boolean.parseBoolean(Protection.getProperty("RemoveChest", "False"));
- REMOVE_LEG = Boolean.parseBoolean(Protection.getProperty("RemoveLeg", "False"));
- + ALT_DISABLE_BOW_CLASSES = Boolean.parseBoolean(Protection.getProperty("AltDisableBow", "False"));
- + DISABLE_BOW_CLASSES_STRING = Protection.getProperty("DisableBowForClasses", "");
- + DISABLE_BOW_CLASSES = new ArrayList<>();
- + for (String class_id : DISABLE_BOW_CLASSES_STRING.split(","))
- + {
- + if(!class_id.equals(""))
- + DISABLE_BOW_CLASSES.add(Integer.parseInt(class_id));
- + }
- }
- 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 df7dd43..4f68f25 100644
- --- a/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- +++ b/java/net/sf/l2j/gameserver/network/clientpackets/UseItem.java
- @@ -14,7 +14,9 @@
- import net.sf.l2j.gameserver.model.holder.IntIntHolder;
- import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- import net.sf.l2j.gameserver.model.item.kind.Item;
- +import net.sf.l2j.gameserver.model.item.kind.Weapon;
- import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
- import net.sf.l2j.gameserver.network.serverpackets.ItemList;
- import net.sf.l2j.gameserver.network.serverpackets.PetItemList;
- @@ -69,6 +71,17 @@
- if (player.isAlikeDead() || player.isStunned() || player.isSleeping() || player.isParalyzed() || player.isAfraid())
- return;
- + if (Config.ALT_DISABLE_BOW_CLASSES)
- + {
- + if(item.getItem() instanceof Weapon && ((Weapon)item.getItem()).getItemType() == WeaponType.BOW)
- + {
- + if(Config.DISABLE_BOW_CLASSES.contains(player.getClassId().getId())){
- + player.sendMessage("This item can not be equipped by your class");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + 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
Add Comment
Please, Sign In to add comment