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

    • I created a system of FAKES to improve my GeoEngine, but I'm having problems with blocks. I've tried everything to fix it, but a block going from the inside out bugs the player's movement and freezes them. However, the reverse doesn't cause this bug. If I'm outside and click inside, the path is traced normally, but if it's reversed, it bugs at the fence. I've created several debugs and read all kinds of GeoEngine versions, but I haven't had any success. Can someone give me some insight into graphical data?   When fakes spawn, they are given possible routes, but they don't follow them. If there's a target, instead of following the correctly drawn path, it simply uses a straight line.  
    • The legendary L2Elixir you remember from 2008 is officially back — remastered, refreshed, and reborn! Our x3 Interlude server launched on 28 November, and the community is growing every single day.   🔥 Fresh start 🔥 Active players joining daily 🔥 Long-term project — Licensed for over 5 years from PlayINERA. 🔥 True 2008 nostalgia with modern stability & polish   If you were part of the original Elixir family, this is your chance to relive the magic. If you’re new — welcome to a classic Lineage II experience built with passion, not profit.   Join the battles. Join the nostalgia. Join L2Elixir Reborn. Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • still available?  java version? client  salvation?  accept smarguart¡?
    • 🎉 L2NeverPain StuckSub - GRAND OPENING 12 December 2025🎉 After beta, testing, mistakes, laughs and a lot of PvP, the moment has finally come. L2NeverPain StuckSub is officially opening its gates on 12 December 2025.   ⚔️What to expect: ✦Main Class +2 Stuck Sub system ✦Balanced PvP & custom party farm areas ✦Custom events, bosses and strong rewards ✦Competitive clan scene with castle rewards   📌Until the opening: ✦Create your clans and register them in the Clan-Register channel ✦Invite your friends / old parties / CPs ✦Stay tuned for more information (rates, events, siege times, etc.)   Get your setups ready, prepare your macros and your Discord/voice. On 12 December 2025 20:00 GMT+2, we write the first chapter of NeverPain together. 🔥 https://l2neverpain.com/ https://discord.gg/kNP3UXgkmN
  • Topics

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