Jump to content

[Share] Blessed Enchant Failed? Now, goes to safe.


Recommended Posts

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.

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

 Share



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