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•

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
Answer this question...

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