Jump to content
  • 0

Enchanting over max enchant


Gxz

Question

13 answers to this question

Recommended Posts

  • 0

add this

if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            return;
        }

Link to comment
Share on other sites

  • 0

add this

if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            return;
        }

where? what file?

Link to comment
Share on other sites

  • 0

RequestEnchantItem.java

 

find this:

else // its an armor 
        {
            maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
            
            for (int scrollId : ENCHANT_SCROLLS)
                if(scroll.getItemId() == scrollId)
                {
                    chance = Config.ENCHANT_CHANCE_ARMOR;
                    enchantBreak = Config.ENCHANT_BREAK_ARMOR;
                    break;
                }
            for (int scrollId : CRYSTAL_SCROLLS)
                if(scroll.getItemId() == scrollId)
                {
                    chance = Config.ENCHANT_CHANCE_ARMOR_CRYSTAL;
                    enchantBreak = Config.ENCHANT_BREAK_ARMOR_CRYSTAL;
                    break;
                }
            for (int scrollId : BLESSED_SCROLLS)
                if(scroll.getItemId() == scrollId)
                {
                    chance = Config.ENCHANT_CHANCE_ARMOR_BLESSED;
                    enchantBreak = Config.ENCHANT_BREAK_ARMOR_BLESSED;
                    break;
                }
        }

and paste the code below

Link to comment
Share on other sites

  • 0

what pack/chronicle u use?

Hello guys, i am using l2j interlude client and the problem is that for example if max enchant is +25 and player tries by mistake to enchant to +26 the item brakes.. i want it not to brake, how can i do that?

interlude l2j server..

Link to comment
Share on other sites

  • 0

Im not sure dude, but i think that problem is here

if (Rnd.get(100) < chance)
        {
            synchronized(item)
            {
            	if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item
            	    || (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0))
            	{
            		activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            		return;
            	}

 

Since u got a check for max enchant on a wep/armor for a successful enchant, but not if wasn't successful.

So try to delete check from there and put it above. as i have said before..

 

if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            return;
        }

if (Rnd.get(100) < chance)
        {
            synchronized(item)
            {
            	if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item)
            	{
            		activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            		return;
            	}

Link to comment
Share on other sites

  • 0

Im not sure dude, but i think that problem is here

if (Rnd.get(100) < chance)
        {
            synchronized(item)
            {
            	if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item
            	    || (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0))
            	{
            		activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            		return;
            	}

 

Since u got a check for max enchant on a wep/armor for a successful enchant, but not if wasn't successful.

So try to delete check from there and put it above. as i have said before..

 

if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
        {
            activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            return;
        }

if (Rnd.get(100) < chance)
        {
            synchronized(item)
            {
            	if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item)
            	{
            		activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
            		return;
            	}

not working, someone else can help me pls? its serious problem fast pls

Link to comment
Share on other sites

  • 0

dude read all replies before posting, you didnt even read the first one, i want a fix that when people enchant over max enchant to not brake but remain as it is...

Link to comment
Share on other sites

  • 0

Yes,you have the code wrong.That's why it brokes.

this code ban a player that enchant over the max enchant, what i want is when you try to overenchant with SCROLLS to say innapopriate enchant condition or whatever

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...