Jump to content

Recommended Posts

Posted

Hi i wanted to share this "addon"

its nothing special

since you know Armors giving stats when all parts enchanted over+6 and this simple patch allows you to give stats when the Armor is enchanted also to +12 and +16

 

here we go:

Index: java/com/l2jserver/gameserver/datatables/ArmorSetsTable.java
===================================================================
--- java/com/l2jserver/gameserver/datatables/ArmorSetsTable.java	(revision 5101)
+++ java/com/l2jserver/gameserver/datatables/ArmorSetsTable.java	(working copy)
@@ -60,7 +60,7 @@
		try
		{
			con = L2DatabaseFactory.getInstance().getConnection();
-			PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM armorsets");
+			PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill, shield, shield_skill_id, enchant6skill, enchant12skill, enchant16skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM armorsets");
			ResultSet rset = statement.executeQuery();

			while (rset.next())
@@ -74,12 +74,14 @@
				int shield = rset.getInt("shield");
				int shield_skill_id = rset.getInt("shield_skill_id");
				int enchant6skill = rset.getInt("enchant6skill");
+				int enchant12skill = rset.getInt("enchant12skill");
+				int enchant16skill = rset.getInt("enchant16skill");
				int mw_legs = rset.getInt("mw_legs");
				int mw_head = rset.getInt("mw_head");
				int mw_gloves = rset.getInt("mw_gloves");
				int mw_feet = rset.getInt("mw_feet");
				int mw_shield = rset.getInt("mw_shield");
-				_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skills, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
+				_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skills, shield, shield_skill_id, enchant6skill, enchant12skill, enchant16skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
			}

			rset.close();
@@ -101,7 +103,7 @@
			{
				int cSets = _armorSets.size();
				con = L2DatabaseFactory.getInstance().getConnection();
-				PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM custom_armorsets");
+				PreparedStatement statement = con.prepareStatement("SELECT chest, legs, head, gloves, feet, skill, shield, shield_skill_id, enchant6skill, enchant12skill, enchant16skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield FROM custom_armorsets");
				ResultSet rset = statement.executeQuery();
				while (rset.next())
				{
@@ -114,12 +116,14 @@
					int shield = rset.getInt("shield");
					int shield_skill_id = rset.getInt("shield_skill_id");
					int enchant6skill = rset.getInt("enchant6skill");
+					int enchant12skill = rset.getInt("enchant12skill");
+					int enchant16skill = rset.getInt("enchant16skill");
					int mw_legs = rset.getInt("mw_legs");
					int mw_head = rset.getInt("mw_head");
					int mw_gloves = rset.getInt("mw_gloves");
					int mw_feet = rset.getInt("mw_feet");
					int mw_shield = rset.getInt("mw_shield");
-					_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skills, shield, shield_skill_id, enchant6skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
+					_armorSets.put(chest, new L2ArmorSet(chest, legs, head, gloves, feet, skills, shield, shield_skill_id, enchant6skill, enchant12skill, enchant16skill, mw_legs, mw_head, mw_gloves, mw_feet, mw_shield));
				}

				rset.close();
Index: java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java
===================================================================
--- java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java	(revision 5101)
+++ java/com/l2jserver/gameserver/model/itemcontainer/Inventory.java	(working copy)
@@ -552,6 +537,40 @@
								_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+armorSet.getEnchant6skillId()+".");
						}
					}
+					if (armorSet.isEnchanted12(player)) // has all parts of set enchanted to 12 or more
+					{
+						final int skillId12 = armorSet.getEnchant12skillId();
+						
+						if (skillId12 > 0)
+						{
+							L2Skill skille = SkillTable.getInstance().getInfo(skillId12,1);
+							
+							if (skille != null)
+							{
+								player.addSkill(skille, false);
+								update = true;
+							}
+							else
+								_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+armorSet.getEnchant12skillId()+".");
+						}
+					}
+					if (armorSet.isEnchanted16(player)) // has all parts of set enchanted to 16 or more
+					{
+						final int skillId16 = armorSet.getEnchant16skillId();
+						
+						if (skillId16 > 0)
+						{
+							L2Skill skille = SkillTable.getInstance().getInfo(skillId16,1);
+							
+							if (skille != null)
+							{
+								player.addSkill(skille, false);
+								update = true;
+							}
+							else
+								_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+armorSet.getEnchant16skillId()+".");
+						}
+					}
				}
			}
			else if (armorSet.containShield(item.getItemId()))
@@ -579,7 +598,6 @@
			}
		}

-		@Override
		public void notifyUnequiped(int slot, L2ItemInstance item, Inventory inventory)
		{
			if (!(inventory.getOwner() instanceof L2PcInstance))
@@ -593,6 +611,8 @@
			String[] skills = null;
			int shieldSkill = 0; // shield skill
			int skillId6 = 0; // enchant +6 skill
+			int skillId12 = 0; // enchant +12 skill
+			int skillId16 = 0; // enchant +16 skill

			if (slot == PAPERDOLL_CHEST)
			{
@@ -604,6 +624,8 @@
				skills = armorSet.getSkills();
				shieldSkill = armorSet.getShieldSkillId();
				skillId6 = armorSet.getEnchant6skillId();
+				skillId12 = armorSet.getEnchant12skillId();
+				skillId16 = armorSet.getEnchant16skillId();
			}
			else
			{
@@ -621,6 +643,8 @@
					skills = armorSet.getSkills();
					shieldSkill = armorSet.getShieldSkillId();
					skillId6 = armorSet.getEnchant6skillId();
+					skillId12 = armorSet.getEnchant12skillId();
+					skillId16 = armorSet.getEnchant16skillId();
				}
				else if (armorSet.containShield(item.getItemId())) // removed shield
				{
@@ -679,6 +703,24 @@
						_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+skillId6+".");
				}

+				if (skillId12 != 0)
+				{
+					L2Skill skill = SkillTable.getInstance().getInfo(skillId12,1);
+					if (skill != null)
+						player.removeSkill(skill, false, skill.isPassive());
+					else
+						_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+skillId12+".");
+				}
+				
+				if (skillId16 != 0)
+				{
+					L2Skill skill = SkillTable.getInstance().getInfo(skillId16,1);
+					if (skill != null)
+						player.removeSkill(skill, false, skill.isPassive());
+					else
+						_log.warning("Inventory.ArmorSetListener: Incorrect skill: "+skillId16+".");
+				}
+				
				player.checkItemRestriction();
				player.sendSkillList();
			}

Index: java/com/l2jserver/gameserver/model/L2ArmorSet.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2ArmorSet.java	(revision 5101)
+++ java/com/l2jserver/gameserver/model/L2ArmorSet.java	(working copy)
@@ -39,8 +39,10 @@
	private final int _shieldSkillId;

	private final int _enchant6Skill;
+	private final int _enchant12Skill;
+	private final int _enchant16Skill;

-	public L2ArmorSet(int chest, int legs, int head, int gloves, int feet, String[] skills, int shield, int shield_skill_id, int enchant6skill, int mw_legs, int mw_head, int mw_gloves, int mw_feet, int mw_shield)
+	public L2ArmorSet(int chest, int legs, int head, int gloves, int feet, String[] skills, int shield, int shield_skill_id, int enchant6skill, int enchant12skill, int enchant16skill, int mw_legs, int mw_head, int mw_gloves, int mw_feet, int mw_shield)
	{
		_chest = chest;
		_legs = legs;
@@ -58,6 +60,8 @@
		_shieldSkillId = shield_skill_id;

		_enchant6Skill = enchant6skill;
+		_enchant12Skill = enchant12skill;
+		_enchant16Skill = enchant16skill;
	}

	/**
@@ -162,9 +166,21 @@
		return _enchant6Skill;
	}

+	public int getEnchant12skillId()
+	{
+		return _enchant12Skill;
+	}
+	
+	public int getEnchant16skillId()
+	{
+		return _enchant16Skill;
+	}
+	
	public boolean isEnchanted6(L2PcInstance player)
	{
@@ -193,4 +209,58 @@

		return true;
	}
+	public boolean isEnchanted12(L2PcInstance player)
+	{
+		// Player don't have full set
+		if (!containAll(player))
+			return false;
+		
+		Inventory inv = player.getInventory();
+		
+		L2ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+		L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+		L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+		L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+		L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
+		
+		if (chestItem == null || chestItem.getEnchantLevel() < 12)
+			return false;
+		if (_legs != 0 && (legsItem == null || legsItem.getEnchantLevel() < 12))
+			return false;
+		if (_gloves != 0 && (glovesItem == null || glovesItem.getEnchantLevel() < 12))
+			return false;
+		if (_head != 0 && (headItem == null || headItem.getEnchantLevel() < 12))
+			return false;
+		if (_feet != 0 && (feetItem == null || feetItem.getEnchantLevel() < 12))
+			return false;
+		
+		return true;
+	}
+	public boolean isEnchanted16(L2PcInstance player)
+	{
+		// Player don't have full set
+		if (!containAll(player))
+			return false;
+		
+		Inventory inv = player.getInventory();
+		
+		L2ItemInstance chestItem = inv.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+		L2ItemInstance legsItem = inv.getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+		L2ItemInstance headItem = inv.getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+		L2ItemInstance glovesItem = inv.getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+		L2ItemInstance feetItem = inv.getPaperdollItem(Inventory.PAPERDOLL_FEET);
+		
+		if (chestItem == null || chestItem.getEnchantLevel() < 16)
+			return false;
+		if (_legs != 0 && (legsItem == null || legsItem.getEnchantLevel() < 16))
+			return false;
+		if (_gloves != 0 && (glovesItem == null || glovesItem.getEnchantLevel() < 16))
+			return false;
+		if (_head != 0 && (headItem == null || headItem.getEnchantLevel() < 16))
+			return false;
+		if (_feet != 0 && (feetItem == null || feetItem.getEnchantLevel() < 16))
+			return false;
+		
+		return true;
+	}
}

 

 

after this you have to add 2 new column at "armorsets" table

 `enchant12skill` smallint(5) unsigned NOT NULL DEFAULT '0',
`enchant16skill` smallint(5) unsigned NOT NULL DEFAULT '0',

 

it explains it self...you have to add the id of the skill that give the stats (\gameserver\data\stats\skills) to the column enchant12skill or enchant16skill of the armor you want

 

or example:

 

<skill id="1234" levels="1" name="Example Stats for the Armorstats">
	<set name="magicLvl" val="1" />
	<set name="target" val="TARGET_SELF" />
	<set name="skillType" val="BUFF" />
	<set name="operateType" val="OP_PASSIVE" />
	<for>
		<add order="0x40" stat="pDef" val="100">
			<using kind="Heavy" />
		</add>
		<add order="0x40" stat="mDef" val="100">
			<using kind="Heavy" />
		</add>
	</for>
</skill>

 

if you care about credits they goes to me

 

  • 4 years later...
Posted

why you undig such old and crappy topics? :D

because for pvp server this custom code can be useful so if someone can adapt it it will be good 

Posted

why you undig such old and crappy topics? :D

 

because for pvp server this custom code can be useful so if someone can adapt it it will be good 

Why is it that the model has not gotten an adaptation and has not found a more current version, but could have been adapted?

  • 4 weeks later...
Posted

Why is it that the model has not gotten an adaptation and has not found a more current version, but could have been adapted?

  :-X  :-X  :-X Up , adapted for L2JFrozen plis?  :-X

  • 5 weeks later...
Posted

my last post was "Posted 29 November 2016 - 10:25 PM" but still nothing ? what the fuck is wrong with this pro forum that everything is so easy ? maybe no one cares if there are not money involved ?

:dat:  :dat:

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

    • You should buy it then I’ll make a discount  
    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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