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

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 .

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 .

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


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