Jump to content

Recommended Posts

Posted

Hello Mxc,

Here is a share that already shared in the past by Realtek but never worked


With this Modification you can select different Maximum Enchant at Normal Scrolls,

at Blessed Scrolls and at Crystal Scrolls


How it work?

-You select if you want to enable the system or not

-You choose the maximum enchant for Normal Scrolls

-You choose the maximum enchant for Blessed Scrolls

-You choose the maximum enchant for Crystal Scrolls


Here is the Code:

Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 159)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -319,7 +319,15 @@
    public static String    GM_ADMIN_MENU_STYLE;
    public static boolean   JAIL_IS_PVP;
    public static boolean   JAIL_DISABLE_CHAT;
    public static boolean   JAIL_SET_PARA;
+    public static int       ENCHANT_MAX_WEAPON_CRYSTAL;
+    public static int       ENCHANT_MAX_ARMOR_CRYSTAL;
+    public static int       ENCHANT_MAX_JEWERLY_CRYSTAL;
+    public static int       ENCHANT_MAX_WEAPON_BLESSED;
+    public static int       ENCHANT_MAX_ARMOR_BLESSED;
+    public static int       ENCHANT_MAX_JEWERLY_BLESSED;
+    public static boolean   ENCHANT_SCROLL_CRYSTAL_SYSTEM;
+    public static boolean   ENCHANT_SCROLL_BLESSED_SYSTEM;
    
    public static boolean   DISALLOW_POTION_PVP;
@@ -1606,6 +1614,14 @@
                JAIL_IS_PVP                         = Boolean.valueOf(Other.getProperty("JailIsPvp", "True"));
                JAIL_DISABLE_CHAT                   = Boolean.valueOf(Other.getProperty("JailDisableChat", "True"));
                JAIL_SET_PARA                       = Boolean.valueOf(Other.getProperty("JailParaPlayer", "False"));
+                ENCHANT_MAX_JEWERLY_CRYSTAL         = Integer.parseInt(Other.getProperty("EnchantMaxJewelryCrystal", "100"));
+                ENCHANT_MAX_ARMOR_CRYSTAL           = Integer.parseInt(Other.getProperty("EnchantMaxArmorCrystal", "100"));
+                ENCHANT_MAX_WEAPON_CRYSTAL          = Integer.parseInt(Other.getProperty("EnchantMaxWeaponCrystal", "100"));
+                ENCHANT_MAX_JEWERLY_BLESSED         = Integer.parseInt(Other.getProperty("EnchantMaxJewelryBlessed", "100"));
+                ENCHANT_MAX_ARMOR_BLESSED           = Integer.parseInt(Other.getProperty("EnchantMaxArmorBlessed", "100"));
+                ENCHANT_MAX_WEAPON_BLESSED          = Integer.parseInt(Other.getProperty("EnchantMaxWeaponBlessed", "100"));
+                ENCHANT_SCROLL_CRYSTAL_SYSTEM       = Boolean.parseBoolean(Other.getProperty("EnchantCrystalCustom", "False"));
+                ENCHANT_SCROLL_BLESSED_SYSTEM       = Boolean.parseBoolean(Other.getProperty("EnchantBlessedCustom", "False"));
                DEATH_PENALTY_CHANCE                = Integer.parseInt(Other.getProperty("DeathPenaltyChance", "20"));
            }
            catch (Exception e)
@@ -2665,6 +2681,12 @@
        else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxJewelryCrystal")) ENCHANT_MAX_JEWERLY_CRYSTAL = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxArmorCrystal")) ENCHANT_MAX_ARMOR_CRYSTAL = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxWeaponCrystal")) ENCHANT_MAX_WEAPON_CRYSTAL = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxJewelryBlessed")) ENCHANT_MAX_JEWERLY_BLESSED = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxArmorBlessed")) ENCHANT_MAX_ARMOR_BLESSED = Integer.parseInt(pValue);
+        else if (pName.equalsIgnoreCase("EnchantMaxWeaponBlessed")) ENCHANT_MAX_WEAPON_BLESSED = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
Index: Settings/General/Other.properties
===================================================================
--- Settings/General/Other.properties	(revision 167)
+++ Settings/General/Other.properties	(working copy)
@@ -102,6 +102,32 @@
EnchantMaxArmor = 25
EnchantMaxJewelry = 25

+# ====================== #
+# Crystal Scroll System  #
+# ====================== #
+# Enable Crystal Scroll System?
+# Default: False
+# Credits: Spidey*
+EnchantCrystalCustom = False
+
+# Enchant limit [Crystal Scrolls]
+EnchantMaxWeaponCrystal = 50
+EnchantMaxArmorCrystal = 50
+EnchantMaxJewelryCrystal = 50
+
+# ====================== #
+# Blessed Scroll System  #
+# ====================== #
+# Enable Blessed Scroll System?
+# Default: False
+# Credits: Spidey*
+EnchantBlessedCustom = False
+
+# Enchant limit [blessed Scrolls]
+EnchantMaxWeaponBlessed = 50
+EnchantMaxArmorBlessed = 50
+EnchantMaxJewelryBlessed = 50
+
# If EnchantSafeMax is set to for ex '8' the item will be safly enchanted to '8'
# regardless of enchant chance(default = 3 for EnchantSafeMax and default = 4 for EnchantSafeMaxFull)
# EnchantSafeMaxFull is for full body armor (upper and lower)
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java	(revision 331)
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java	(working copy)
@@ -212,6 +212,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_WEAPON_CRYSTAL;
			for (int scrollId : CRYSTAL_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -221,6 +222,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_WEAPON_BLESSED;
			for (int scrollId : BLESSED_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -241,6 +243,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_ARMOR_CRYSTAL;
			for (int scrollId : CRYSTAL_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -249,6 +252,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_ARMOR_BLESSED;
			for (int scrollId : BLESSED_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -269,6 +273,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_JEWERLY_CRYSTAL;
			for (int scrollId : CRYSTAL_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -277,6 +282,7 @@
					break;
				}
			}
+			maxEnchantLevel = Config.ENCHANT_MAX_JEWERLY_BLESSED;
			for (int scrollId : BLESSED_SCROLLS)
			{
				if (scroll.getItemId() == scrollId)
@@ -290,24 +296,135 @@
        if (item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX || (item.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL))
            chance = 100;
        
+     // Weapon
        if (item.getItem().getType2() == L2Item.TYPE2_WEAPON && item.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON)
+			for (int scrollId : ENCHANT_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        if (Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM)
        {
-        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
-        	return;
+        if (item.getItem().getType2() == L2Item.TYPE2_WEAPON && item.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON_CRYSTAL)
+			for (int scrollId : CRYSTAL_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
        }
-        
+        if (Config.ENCHANT_SCROLL_BLESSED_SYSTEM)
+        {
+        if (item.getItem().getType2() == L2Item.TYPE2_WEAPON && item.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON_BLESSED)
+			for (int scrollId : BLESSED_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        }
+        // Armor
        if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR && item.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR)
+			for (int scrollId : ENCHANT_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        if (Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM)
        {
-        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
-        	return;
+        if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR && item.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR_CRYSTAL)
+			for (int scrollId : CRYSTAL_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
        }
-        
+        if (Config.ENCHANT_SCROLL_BLESSED_SYSTEM)
+        {
+        if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR && item.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR_BLESSED)
+			for (int scrollId : BLESSED_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        }
+        // Jewerly
        if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWELRY)
+			for (int scrollId : ENCHANT_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        if (Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM)
        {
-        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
-        	return;
+        if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWERLY_CRYSTAL)
+			for (int scrollId : CRYSTAL_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
        }
+        if (Config.ENCHANT_SCROLL_BLESSED_SYSTEM)
+        {
+        if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWERLY_BLESSED)
+			for (int scrollId : BLESSED_SCROLLS)
+			{
+				if (scroll.getItemId() == scrollId)
+				{
+        	            activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+        				return;
+				}
+			}
+        }
+        else if ((!Config.ENCHANT_SCROLL_BLESSED_SYSTEM) && (!Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM))
+        {
+            if (item.getItem().getType2() == L2Item.TYPE2_WEAPON && item.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON)
+            	{
+            	        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+            	        	return;
+            	}
+        }

+        else if ((!Config.ENCHANT_SCROLL_BLESSED_SYSTEM) && (!Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM))
+        {
+        	if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR && item.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR)
+            	{
+            	        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+            	        	return;
+            	}
+        }
+        
+        else if ((!Config.ENCHANT_SCROLL_BLESSED_SYSTEM) && (!Config.ENCHANT_SCROLL_CRYSTAL_SYSTEM))
+        {
+        	if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY && item.getEnchantLevel() >= Config.ENCHANT_MAX_JEWELRY)
+            	{
+            	        	activeChar.sendMessage("You have been reached the maximum enchant. You cannot enchant more !");
+            	        	return;
+            	}
+        }
+
        if (Rnd.get(100) < chance)
        {
            synchronized(item)

_____________________________________________________________________

Tested and Working 100%

Credits: Spidey*

 

Edit: RequestEnchantItem.Java Patch Problem Fixed

Posted

Realy strange...

I think that I coded this for a user of L2J-Infinity and i posted it in the forum...

 

right ^^

 

http://www.maxcheaters.com/forum/index.php?topic=140062.0

 

 

Hello Mxc,

Here is a share that already shared in the past by Realtek but never worked

_____________________________________________________________________

Tested and Working 100%

Credits: Spidey*

 

so u should change a bit the credits ? even the other one wasn't 100% working ;)

Posted

Realy strange...

I think that I coded this for a user of L2J-Infinity and i posted it in the forum...

 

100% NO WORK..

Is your idea.. but don't work..

Here is a share that already shared in the past by Realtek but never worked

Your topic got locked :S

Posted

100% NO WORK..

Is your idea.. but don't work..

Here is a share that already shared in the past by Realtek but never worked

Your topic got locked :S

 

well i dont see alot of changes in that one...

lets see when some one test it what will happend.

good luckk..

Posted

Wonderful how easily people nowadays abuse karma for fixing 2 strings =]

The share is useless and the way it's coded is bad..

Anyway, thanks for sharing, I guess.

Posted

Wonderful how easily people nowadays abuse karma for fixing 2 strings =]

The share is useless and the way it's coded is bad..

Anyway, thanks for sharing, I guess.

Well i have to agree for karma,I think it dont need here.

But i dont agree with you,share is helpful :D

good job.

  • 6 months later...
Posted

Can anyone help me? i cant find the line  <<for (int scrollId : CRYSTAL_SCROLLS)>>

 

in java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java

 

I have gracia final l2j how can i find it?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hello guys, As you can understand I don't want to share yet many information regarding the project while it is under heavy development stage, I can understand your curiosity about  "What might be" however think it like a secret sauce from a restaurant that does not actually share the recipe from it, but of course once we have something in our hands we will provide any logical information. If you are interested that much you can always take a look in our discord: https://discord.com/invite/mightyproject Hello there, No it is not Unreal Engine 5, well for this we will need some good budget and a skilled team based on UE5. Thank you looking foward seeing you playing in our project soon, and trust me it will be mighty! https://discord.com/invite/mightyproject
    • Hello guys, There isn't much information to share yet regarding the project. We've been working on it for the past few months with the goal of creating something unique and truly different. Over the years, I've seen countless projects with the same features repeated over and over again. This time, we're aiming to build something solid and unlike anything players have seen before. Since many of you have been asking about Unreal Engine 5, I'd like to clear that up. Building something on UE5 requires a very large team and a lot of resources to accomplish properly. Right now, we can't say anything regarding UE5. Maybe in the future, who knows? Tzelal is a real life friend of mine. I've known him for many years, and he's a great guy. Right now, he's looking for people who genuinely want to be part of this project. The team is working 20+ hours a day, every single day. I'm often on calls with them, watching their progress and seeing everything they're creating. So, if anyone is wondering what's happening behind the scenes, my answer is simple, something amazing. I know many of you have been asking about features and other details, but we don't want to spoil anything just yet. There is still a lot of work to be done, and we'd rather reveal things when they're ready. Once everything is in the state we want, we'll start releasing sneak peeks. If you'd like to join the project, feel free to send Tzelal a private message so you can go through an interview. Please don't waste his time, or yours, if you're not genuinely interested. Now, I'd like to make a few things clear. No, we're not making another generic server with the same old features and the same old engine that you've seen for years. Our goal is to build something completely different, something that players haven't experienced before. And no, we're not going to give up on development. We work every day, and we keep pushing forward even when some challenges seem difficult. We're committed to making this project the best it can be. That's all for now. There will be much more to share once we're ready to show it. Thanks for your time, everyone.
    • 📢 MMORE.DEV — ONE SLOT AVAILABLE FOR A PROJECT   1 slot has opened up for long-term cooperation. We welcome anyone interested — we're looking for projects built for long-term collaboration, not one-off tasks.   🎯 We're ready to take on projects for these chronicles:   Essence Classic   Current protocols: 520, 542, 557+ One example of our developers' work — the Aden.Land team.   📋 We're also accepting preliminary discussions for the Main (GOD) branch — if you're planning a project on this chronicle, reach out in advance so we can go over the details and timeline. _______________________________________________________________________   For any questions — PM us or reach out on Telegram: https://t.me/L2scripts
    • 🔥 L2SCRIPTS BIG SALE 🔥 30-50% OFF ALL LEGACY PRODUCTS! Special offer for MaxCheaters users! Promotion runs from July 25 to August 1 inclusive _____________________________________________________    🎁 Promo details: 30-50% discount on all legacy studio products Source codes, ready-made builds, technical support — everything you've been wanting to grab at a great price. ___________________________________________________________________________   ⚡ Why you should hurry: A discount like this across the whole lineup is a rare event in our 20 years on the market This offer is strictly time-limited — exactly 7 days, no extensions Available only for MaxCheaters users Support slots are limited. ____________________________________________________ ✅ Proven quality — 20 years in the L2 market ✅ Full range of chronicles and ready-made solutions ✅ Personal support from our team ____________________________________________________   🌐 Our websites: L2-scripts.com — https://l2-scripts.com Mmore.dev — https://mmore.dev Telegram for contact: https://t.me/L2scripts ____________________________________________________   Don't miss your chance! In 7 days prices go back to normal — grab what you need at the best price in the studio's history. ➡️ Browse the product catalog: https://l2-scripts.com For any questions — PM us or check the support thread.
  • 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..