Jump to content
  • 0

Question

Posted

Hi guys can help me? How fix this code? I saw on forum another code, but he doesn't work. I him liitle bit fixed but still don't work. What i should to do? I tried add if (_isCrystal) or if (_bisBlessed) but nothing.

what i need to do for fix max enchant?

package net.sf.l2j.gameserver.network.clientpackets;

import java.util.HashMap;
import java.util.Map;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
import net.sf.l2j.gameserver.model.item.kind.Item;
import net.sf.l2j.gameserver.model.item.kind.Weapon;
import net.sf.l2j.gameserver.model.item.type.CrystalType;
import net.sf.l2j.gameserver.model.item.type.WeaponType;

public abstract class AbstractEnchantPacket extends L2GameClientPacket
{
	public static final Map<Integer, EnchantScroll> _scrolls = new HashMap<>();
	
	public static final class EnchantScroll
	{
		protected final boolean _isWeapon;
		protected final CrystalType _grade;
		private final boolean _isBlessed;
		private final boolean _isCrystal;
		
		public EnchantScroll(boolean wep, boolean bless, boolean crystal, CrystalType type)
		{
			_isWeapon = wep;
			_grade = type;
			_isBlessed = bless;
			_isCrystal = crystal;
		}
		
		/**
		 * @param enchantItem : The item to enchant.
		 * @return true if support item can be used for this item
		 */
		public final boolean isValid(ItemInstance enchantItem)
		{
			if (enchantItem == null)
				return false;
			
			// checking scroll type and configured maximum enchant level
			switch (enchantItem.getItem().getType2())
			{
				case Item.TYPE2_WEAPON:
					if (_isWeapon || (Config.ENCHANT_MAX_WEAPON > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON))
					return false;
					break;
				
					if (isWeapon)
					if (_isWeapon || (Config.ENCHANT_MAX_BLESSED_WEAPON > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_BLESSED_WEAPON))
					return false;
					break;
					
					if (_isWeapon || (Config.ENCHANT_MAX_CRYSTAL_WEAPON > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_CRYSTAL_WEAPON))
					return false;
					break;		
					
					case Item.TYPE2_SHIELD_ARMOR:
	                if (_isWeapon || (Config.ENCHANT_MAX_ARMOR > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR))
	                return false;
	                break;

	                if (_isWeapon || (Config.ENCHANT_MAX_BLESSED_ARMOR > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_BLESSED_ARMOR))
	                return false;
	                break;
	                
	                if (_isWeapon || (Config.ENCHANT_MAX_CRYSTAL_ARMOR > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_CRYSTAL_ARMOR))
	                return false;
	                break;
	                    
	                case Item.TYPE2_ACCESSORY:
	                if (_isWeapon || (Config.ENCHANT_MAX_JEWELS > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_JEWELS))
	                return false;
	                break;

	                if (_isWeapon || (Config.ENCHANT_MAX_BLESSED_JEWELS > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_BLESSED_JEWELS))
	                return false;
	                break;
	                
	                if (_isWeapon || (Config.ENCHANT_MAX_CRYSTAL_JEWELS > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_CRYSTAL_JEWELS))
	        		return false;
	        		break;
	        				
	                default:
	        		return false;
	        	}

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

    • Hlep i need pack full last van GF 
    • Dear friends! We are constantly growing and developing, and we are finally ready to offer you the opportunity to integrate advertising across all SOCNET projects! Our service provides the opportunity to place ads on the website socnet.store, in our SMM panel socnet.pro, in Telegram bots socnet.shop and socnet.cc (celebrity bot), as well as in another new (currently secret) project. Each platform provides detailed analytics and information about available ad banners. The document below contains all detailed information in two languages — Russian and English. Here you will find answers to frequently asked questions about exact ad placement locations, integration costs, purchasing process, restrictions, and many other details. The document also contains a table with the current advertising placement queue in our projects. Document with detailed information: https://docs.google.com/document/d/1u4ro3fLkjfyvcp1Eu64rkgQy2Xl5lj87_1W25cVsqPM/edit?usp=sharing Thank you for your attention and support! Sincerely, the SOCNET team. Active project links: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends! We are constantly growing and developing, and we are finally ready to offer you the opportunity to integrate advertising across all SOCNET projects! Our service provides the opportunity to place ads on the website socnet.store, in our SMM panel socnet.pro, in Telegram bots socnet.shop and socnet.cc (celebrity bot), as well as in another new (currently secret) project. Each platform provides detailed analytics and information about available ad banners. The document below contains all detailed information in two languages — Russian and English. Here you will find answers to frequently asked questions about exact ad placement locations, integration costs, purchasing process, restrictions, and many other details. The document also contains a table with the current advertising placement queue in our projects. Document with detailed information: https://docs.google.com/document/d/1u4ro3fLkjfyvcp1Eu64rkgQy2Xl5lj87_1W25cVsqPM/edit?usp=sharing Thank you for your attention and support! Sincerely, the SOCNET team. Active project links: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear friends! We are constantly growing and developing, and we are finally ready to offer you the opportunity to integrate advertising across all SOCNET projects! Our service provides the opportunity to place ads on the website socnet.store, in our SMM panel socnet.pro, in Telegram bots socnet.shop and socnet.cc (celebrity bot), as well as in another new (currently secret) project. Each platform provides detailed analytics and information about available ad banners. The document below contains all detailed information in two languages — Russian and English. Here you will find answers to frequently asked questions about exact ad placement locations, integration costs, purchasing process, restrictions, and many other details. The document also contains a table with the current advertising placement queue in our projects. Document with detailed information: https://docs.google.com/document/d/1u4ro3fLkjfyvcp1Eu64rkgQy2Xl5lj87_1W25cVsqPM/edit?usp=sharing Thank you for your attention and support! Sincerely, the SOCNET team. Active project links: Digital Goods Store (Website): Go Store Telegram Bot: Go – convenient access to the store through Telegram messenger. Telegram Bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing goods and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) during October! You can also use the promo code for your first purchase: SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — simply post your username after registration on our website using the following format: "SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a ticket titled "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram Channel: https://t.me/accsforyou_shop ➡ WhatsApp Channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord Server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock