Jump to content

Recommended Posts

Posted

In many servers you can not enchant a hero weapon

here is the code in order to enable this feature!

at net/sf/l2j/Config.java

line ~1065

    public static int ENCHANT_CHANCE_WEAPON_BLESSED;  
    public static int ENCHANT_CHANCE_ARMOR_BLESSED;  
    public static int ENCHANT_CHANCE_JEWELRY_BLESSED;
    
+    /** Enable/disable Hero Weapons Enchantment */
+    public static boolean ALLOW_HERO_ENCHANTMENT;

    // Character multipliers
    /** Multiplier for character HP regeneration */
    public static double  HP_REGEN_MULTIPLIER;

line ~1627
            	ENCHANT_CHANCE_ARMOR_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmorBlessed", "85"));   
            	ENCHANT_CHANCE_JEWELRY_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelryBlessed", "85"));
+            	ALLOW_HERO_ENCHANTMENT = Boolean.parseBoolean(otherSettings.getProperty("EnchantHeroAllow", "True"));
            	
--------------------------------------
at net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java

line ~74
        activeChar.setActiveEnchantItem(null);
        if (item == null || scroll == null) return;

-        // can't enchant rods, hero weapons and shadow items
+       // can't enchant rods, and shadow items
        if(item.getItem().getItemType() == L2WeaponType.ROD
-              || item.getItemId() >= 6611 && item.getItemId() <= 6621
              || item.isShadowItem()
) 

+        // can't enchant Hero Weapons
+        if(item.getItemId() >= 6611 && item.getItemId() <= 6621 && !Config.ALLOW_HERO_ENCHANTMENT) 
+        {
+       	activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
+            return;
+       }

        if(item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWELRY	

------------------------------------
At other.properties

+ #Allow hero weapons enchantment?
+ EnchantHeroAllow = True


 

Not something special but its a good start for me

Credits: to me

 

PS: Its not tested but it shall be fine.

If you find somethink wrong please let me know!

Posted

i know!!!!

DominiQue had just delete a line

the prob is that every time you wanna activate - disactivate it you should add -delete the line and recompile....

so i thought that it will be an interesting share....

Posted

In many servers you can not enchant a hero weapon

here is the code in order to enable this feature!

at net/sf/l2j/Config.java

line ~1065

    public static int ENCHANT_CHANCE_WEAPON_BLESSED;  
    public static int ENCHANT_CHANCE_ARMOR_BLESSED;  
    public static int ENCHANT_CHANCE_JEWELRY_BLESSED;
    
+    /** Enable/disable Hero Weapons Enchantment */
+    public static boolean ALLOW_HERO_ENCHANTMENT;

    // Character multipliers
    /** Multiplier for character HP regeneration */
    public static double  HP_REGEN_MULTIPLIER;

line ~1627
            	ENCHANT_CHANCE_ARMOR_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceArmorBlessed", "85"));   
            	ENCHANT_CHANCE_JEWELRY_BLESSED = Integer.parseInt(otherSettings.getProperty("EnchantChanceJewelryBlessed", "85"));
+            	ALLOW_HERO_ENCHANTMENT = Boolean.parseBoolean(otherSettings.getProperty("EnchantHeroAllow", "True"));
            	
--------------------------------------
at net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java

line ~74
        activeChar.setActiveEnchantItem(null);
        if (item == null || scroll == null) return;

-        // can't enchant rods, hero weapons and shadow items
+       // can't enchant rods, and shadow items
        if(item.getItem().getItemType() == L2WeaponType.ROD
-              || item.getItemId() >= 6611 && item.getItemId() <= 6621
              || item.isShadowItem()
) 

+        // can't enchant Hero Weapons
+        if(item.getItemId() >= 6611 && item.getItemId() <= 6621 && !Config.ALLOW_HERO_ENCHANTMENT) 
+        {
+       	activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
+            return;
+       }

        if(item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWELRY	

------------------------------------
At other.properties

+ #Allow hero weapons enchantment?
+ EnchantHeroAllow = True


 

Not something special but its a good start for me

Credits: to me

 

PS: Its not tested but it shall be fine.

If you find somethink wrong please let me know!

[gr]credits se esena???  axxaax ti les re se ola ta Il packs uparxei auto... sta alla dn 3erw mono me il asxoloume...

  • 2 weeks later...
Posted

kala re file den mporeis na grapsi pos einai gia iterlut prepi na divazw ta minimata egw na to katalabw kai mpedevomoyna tzampa den eitane diskolo ena etsi na ekanes (share] Allow hero weapons enchantment for int) toso aplo

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...