Jump to content

Question

2 answers to this question

Recommended Posts

  • 0
Posted

AbstractEnchantPacket.java .. εκει πρεπει να το βαλεις το code σου.
Δες και αναλογως πραξε ..

  • 0
Posted (edited)

βρήκα έναν κώδικα...αλλά δεν έχω όλες τις γραμμές του κώδικα στο pack...

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)
Edited by •DarkStar•

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


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