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

    • https://prnt.sc/Bkkc0ShGXv9m https://prnt.sc/-JFLvZXsn27A
    • Hello guys want to sell adena in L2 Reborn Signature x1  Stock =14kk good price 
    • Hi guys, I have the following problem, I want to set up two servers on the same dedicated server and I can't.   L2jacis 409 Linux Server. The first gameserver has the following configuration: # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 190.25.103.103 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7777 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 1 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server1 Login = server1 Password = server1 I configured the second gameserver like this:   # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 0.0.0.0 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7788 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 2 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server2 Login = server2 Password = server2 apart from having tested 0.0.0.0 on the second gameserver I also tried 127.0.0.1 In both cases I see the two servers in the login when I log in, but I try to enter the one with the lowest ping and it kicks me out. The other server always appears with ping 9999 and I try to enter but it doesn't do anything and it freezes the login so I have to log in again. The hexids are in their respective folders. For server 1, it has its hexid inside the gameserver config folder, and I checked that the hexid id is the same id, for example id 1 in the gameserver is also id1 for server 1, and hexid 2 has its hexid 2 for server 2. The server ports are open and listening when I turn on both gameservers. I really don't know what could be wrong. If you could give me some help I would appreciate it. Excuse my English.
    • We have both old channels from 2006-2009 with the 3rd verification function enabled, and new ones.   For availability, please contact us below: Link - Telegram Link - Facebook WhatsApp - Click here to go to WhatsApp chat
    • You can contact me on skype: niedziolek50
  • Topics

×
×
  • Create New...