Jump to content
  • 0

Enchanting over max enchant


Question

Posted

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?

13 answers to this question

Recommended Posts

  • 0
Posted

add this

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

  • 0
Posted

add this

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

where? what file?

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

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;
            	}

  • 0
Posted

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

  • 0
Posted

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

Guest
This topic is now closed to further replies.


  • Posts

    • Αν σε ενδιαφέρει ο κόσμος των κρυπτονομισμάτων και θέλεις να συζητάς, να μαθαίνεις, αλλά και να μοιράζεσαι γνώσεις με άλλους Έλληνες χρήστες, τότε σε προσκαλούμε στο νέο μας Telegram forum αποκλειστικά για την ελληνική crypto κοινότητα!   Συζητάμε για Bitcoin, altcoins, DeFi, trading, νέες τάσεις, NFTs, τεχνική ανάλυση και ό,τι άλλο αφορά τον κόσμο των crypto. Είτε είσαι αρχάριος είτε προχωρημένος, θα βρεις κάτι που σε ενδιαφέρει και μια παρέα που μιλάει τη γλώσσα σου – κυριολεκτικά!     Σύνδεσμος πρόσβασης:    https://t.me/investfuture_crypto_gr    ή   Scan QR Code:       Έλα να γίνουμε η πιο ενεργή ελληνική κοινότητα στο χώρο των crypto!
    • Αν σε ενδιαφέρει ο κόσμος των κρυπτονομισμάτων και θέλεις να συζητάς, να μαθαίνεις, αλλά και να μοιράζεσαι γνώσεις με άλλους Έλληνες χρήστες, τότε σε προσκαλούμε στο νέο μας Telegram forum αποκλειστικά για την ελληνική crypto κοινότητα!   Συζητάμε για Bitcoin, altcoins, DeFi, trading, νέες τάσεις, NFTs, τεχνική ανάλυση και ό,τι άλλο αφορά τον κόσμο των crypto. Είτε είσαι αρχάριος είτε προχωρημένος, θα βρεις κάτι που σε ενδιαφέρει και μια παρέα που μιλάει τη γλώσσα σου – κυριολεκτικά!     Σύνδεσμος πρόσβασης:    https://t.me/investfuture_crypto_gr    ή   Scan QR Code:       Έλα να γίνουμε η πιο ενεργή ελληνική κοινότητα στο χώρο των crypto!
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Good luck with your g/o!
  • Topics

×
×
  • Create New...