Jump to content

Recommended Posts

Posted

Hello, here is a simple code. When the blessed scroll failed to enchant your item then goes to safe enchant.

 

- L2jFrozen_GameServer / head-src / com / l2jfrozen / gameserver / network / clientpackets / RequestEnchantItem.java

 

 
if(blessedScroll)
{
	- 	item.setEnchantLevel(Config.BREAK_ENCHANT);
+ 	item.setEnchantLevel(Config.ENCHANT_SAFE_MAX);
	item.updateDatabase();
	}
else if(crystalScroll)
{
item.setEnchantLevel(Config.CRYSTAL_ENCHANT_MIN);

 

Coded on l2jfrozen.

 

Best Regards.

 

PS; Sorry for this way of code, but I wasn't home to make it by eclipse.

Posted

When you will start making Something yours or alone? There is no point to Share Code from othere people ....

For 1 line, you believe this code is from another guy? Jez..

 

As I said, it's simple code. Please, cool.

Posted

Config.ENCHANT_SAFE_MAX

 

That code it's incomplete . You have to add something in configs .

 

Personally , i can add it (i don't need it) , but if you post a share , post it all .

Most used projects, already have this config.

 

But, I'm gonna add the option. Thanks.

Posted

Try something more, like:

 

				if (scrollTemplate.isBlessed())
				{
					if (item.getEnchantLevel() >= 10)
					{
						activeChar.sendMessage("Failed in Blessed Enchant. The enchant value of the item became decreased by 1.");	
						item.setEnchantLevel(item.getEnchantLevel() - 1);
						item.updateDatabase();
						activeChar.sendPacket(new EnchantResult(3, 0, 0));
					}
					else if (item.getEnchantLevel() < 10)
					{
						activeChar.sendMessage("Failed in Blessed Enchant. The enchant value of the item became " + Config.ENCHANT_SAFE_MAX + ".");	
						item.setEnchantLevel(Config.ENCHANT_SAFE_MAX);
						item.updateDatabase();
						activeChar.sendPacket(new EnchantResult(3, 0, 0));
					}
				}

Posted

Try something more, like:

 

				if (scrollTemplate.isBlessed())
				{
					if (item.getEnchantLevel() >= 10)
					{
						activeChar.sendMessage("Failed in Blessed Enchant. The enchant value of the item became decreased by 1.");	
						item.setEnchantLevel(item.getEnchantLevel() - 1);
						item.updateDatabase();
						activeChar.sendPacket(new EnchantResult(3, 0, 0));
					}
					else if (item.getEnchantLevel() < 10)
					{
						activeChar.sendMessage("Failed in Blessed Enchant. The enchant value of the item became " + Config.ENCHANT_SAFE_MAX + ".");	
						item.setEnchantLevel(Config.ENCHANT_SAFE_MAX);
						item.updateDatabase();
						activeChar.sendPacket(new EnchantResult(3, 0, 0));
					}
				}

 

That's used on L2jFrozen , so already shared .

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
Reply to this topic...

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