Jump to content

Recommended Posts

Posted

This is for daggers and archers with this they cannot use heavy items  :)

 

option.settings

+#=============================================================
+#               Anti heavy system                            =
+#=============================================================

+# Heavy Equipment Restriction
+# IF False , Dagger Classes Won't Be Able To Use Heavy Armors
+AllowDaggersUseHeavy = False

+# IF False , Archer Classes Won't Be Able To Use Heavy Armors
+AllowArchersUseHeavy = False

+# If set this False 
+# normal players can't heal RaidBosses 
+# Default : True 
+PlayersCanHealRb = True

 

 

 

config.java

+public static boolean ALLOW_DAGGERS_WEAR_HEAVY; 
+public static boolean ALLOW_ARCHERS_WEAR_HEAVY;


+ALLOW_DAGGERS_WEAR_HEAVY = Boolean.parseBoolean(optionSettings.getProperty("AllowDaggersUseHeavy", "True"));  
+ALLOW_ARCHERS_WEAR_HEAVY = Boolean.parseBoolean(optionSettings.getProperty("AllowArchersUseHeavy", "True")); 

 

 

L2ClassMasterInstance.java

+import net.sf.l2j.gameserver.model.Inventory; 
+import net.sf.l2j.gameserver.model.actor.instance.L2ItemInstance; 
+import net.sf.l2j.gameserver.serverpackets.InventoryUpdate; 


                        html.setHtml(sb.toString()); 
                        player.sendPacket(html); 
		                         
		                        +if (!Config.ALLOW_ARCHERS_WEAR_HEAVY) 
		                        +{ 
		                        +if (player.getClassId().getId() == 9 || player.getClassId().getId() == 92 || player.getClassId().getId() == 24 || player.getClassId().getId() == 102 
                                        +||   player.getClassId().getId() == 37 || player.getClassId().getId() == 109) 
		                        +{ 
		                                +L2ItemInstance armor = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); 
		                                +if (armor != null) 
		                                +{ 
		                                        +L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(armor.getItem().getBodyPart()); 
		                                        +InventoryUpdate iu = new InventoryUpdate(); 
		                                        +for (L2ItemInstance element : unequipped) 
		                                                +iu.addModifiedItem(element); 
		                                        +sendPacket(iu); 
		                                +} 
		                                +L2ItemInstance legs = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS); 
		                                +if (legs != null) 
		                                +{ 
		                                        +L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(legs.getItem().getBodyPart()); 
		                                        +InventoryUpdate iu = new InventoryUpdate(); 
		                                        +for (L2ItemInstance element : unequipped) 
		                                                +iu.addModifiedItem(element); 
		                                        +sendPacket(iu); 
		                                +} 
	                        +} 
		                        +if (!Config.ALLOW_DAGGERS_WEAR_HEAVY) 
		                        +{ 
		                        +if (player.getClassId().getId() == 93 || player.getClassId().getId() == 108 || player.getClassId().getId() == 101 || player.getClassId().getId() == 8 
                                        +|| player.getClassId().getId() == 23 || player.getClassId().getId() == 36) 
		                        +{ 
		                                +L2ItemInstance chest = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST); 
		                                +if (chest != null) 
		                                +{ 
		                                        +L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart()); 
		                                        +InventoryUpdate iu = new InventoryUpdate(); 
		                                        +for (L2ItemInstance element : unequipped) 
		                                                +iu.addModifiedItem(element); 
	                                        +sendPacket(iu); 
		                                +} 
		                                +L2ItemInstance legs = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS); 
		                                +if (legs != null) 
		                                +{ 
		                                        +L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(legs.getItem().getBodyPart()); 
		                                        +InventoryUpdate iu = new InventoryUpdate(); 
		                                        +for (L2ItemInstance element : unequipped) 
		                                                +iu.addModifiedItem(element); 
		                                        +sendPacket(iu); 
		                                +} 
		                        +} 
		                +} 
		        +else 
		        +{ 
		               + super.onBypassFeedback(player, command); 
	                +} 
          +} 

                        sb = null; 

 

 

UseItem.java


+import net.sf.l2j.gameserver.templates.L2ArmorType;


                        if(activeChar.isCursedWeaponEquiped() && (bodyPart == L2Item.SLOT_LR_HAND || bodyPart == L2Item.SLOT_L_HAND || bodyPart == L2Item.SLOT_R_HAND)) 
                                return; 
		                         
		                        +if (!Config.ALLOW_DAGGERS_WEAR_HEAVY)  
		                        +{ 
	                               +if (activeChar.getClassId().getId() == 93 || activeChar.getClassId().getId() == 108 || activeChar.getClassId().getId() == 101 || 
                                           +activeChar.getClassId().getId() == 8 || activeChar.getClassId().getId() == 23 || activeChar.getClassId().getId() == 36)  
		                                +{  
		                             + if (item.getItemType() == L2ArmorType.HEAVY)  
		                                   +{  
		                                                +activeChar.sendMessage("You cannot use this item when you class dagger.");  
		                                                +return;  
		                                   +}  
		                                +}  
		                        +} 
		         
		                         +if (!Config.ALLOW_ARCHERS_WEAR_HEAVY)  
		                         +{ 
	                                +if (activeChar.getClassId().getId() == 9 || activeChar.getClassId().getId() == 92 || activeChar.getClassId().getId() == 24 || 
                                            +activeChar.getClassId().getId() == 102 || activeChar.getClassId().getId() == 37 || activeChar.getClassId().getId() == 109)  
		                                +{  
	                                  +if (item.getItemType() == L2ArmorType.HEAVY)  
		                                   +{  
		                                          +activeChar.sendMessage("You cannot use this item when you class archer.");  
		                                          +return;  
		                               +}  
		                                +}  
		                         +} 

                        // Don't allow weapon/shield hero equipment during Olimpia 

 

 

This my first share sorry for mistakes  :o

Posted

In many others forum,i am to lazy to try to find it,but i have seen it many times.

But thanks for share.

 

:o  in many others forums? all shares is in many others forums so?

Posted

 

Ohhhh but in you pasted shares no code in class master. I think this usefull.

what class master? your share has been shared quite a few times now the only thing you added was a Config

  • 1 year later...
Guest
This topic is now closed to further replies.
  • Posts

    • NEW SEASON START 23.01.2026 Get ready for the ultimate High Five adventure on L2Exoplanet.net!   • The last two previous Seasons are now merged into the Core Server. • The Core Server remains our main long-term world. • All future Seasonal Servers will be merged into Core after they end. • No characters or items will be lost – everything stays safe!     GRAND OPENING:  23.01.2026 at 20:00 GMT+1 BETA TEST:    16.01.2026    Client: High Five Rates: x10   Website: https://l2exoplanet.net Facebook: https://www.facebook.com/L2-Exoplanet-106811564103836 Discord: https://discord.gg/4fzhW7ZSPc         Game Rates    Experience: x10  Skill Points: x10  Adena: x5  Drop: x8  Spoil: x8  Quest: x5  Raid Boss Drop: x5  Fame: x2  Epaulette: x8  Manor: x8      Safe Enchant: +3  Maximum Enchant: +16  Normal Scroll Chance: 60%  Blessed Scroll Chance: 63%  Attribute Stone Chance: 50%  Attribute Crystal Chance: 30%      Game Settings    Multibox - 3 game clients per HWID  Autoloot  Autolearn Skills Auto Farm  NPC Buffer   Buff Slots (24+4/12)  Buff Duration (2h)  Olympiad Period 7days (new heroes appear every monday)  Seven Signs Period  Class Transfer for Adena  Max Sub-Class 3  Sub-Class Max Level 85  Essence Interface  Champions System  Vote Reward System  Dayli Reward System  PC Points Reward (500PC = 1 Donate Coin)      Epic Bosses Respawn Times     Queen Ant:  24 Hours +/- 4 Hours   Beleth: 3 Days +/- 8 Hours   Baium: 3 Days +/- 8 Hours   Antharas: 4 Days +/- 8 Hours   Valakas:  5 Days +/- 8 Hours     Instance Info     Normal Freya = 6 Players   Hard Freya = 12 Players   Frintezza = 6 Players   Zaken 83 Day = 6 Players   Zaken 60 Day = 6 Players   Zaken Nightly = 9 Players   Tiat = 6 Players   Beleth = 12 Players
    • when did i say something about mobius files besides what i've said on this post? or you're "calling me out" for saying this when someone says mobius is a better interlude alternative than acis? lol  
    • Spreading FUD disguised as "experience," mocking the project publicly, then acting shocked when called out. That's the conduct.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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