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:

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.



  • Posts

    • From Salvation onwards I think you need a patched nwindow.dll that allows such modifications, try to see if you get what you need here: https://drive.google.com/drive/u/1/folders/1LLbQFGf8KlR-O0Iv5umfF-pwZgrDh9bd
    • hello everyone! I am wanting to save the files (Ini. - Data - ) of the EP5 Client: Salvation... But they generate the error "corrupt files"... I tried several versions of L2FileEditor without good results. I need help! Thank you!
    • Opening December 6th at 19:00 (GMT +3)! Open Beta Test from November 30th!   https://l2soe.com/   🌟 Introducing L2 Saga of Eternia: A Revolution in Lineage 2 High Five! 🌟   Dear Lineage 2 enthusiasts, Prepare to witness the future of private servers! L2 Saga of Eternia is not just another High Five project—it’s a game-changing experience designed to compete with the giants of the Lineage 2 private server scene. Built for the community, by the community, we’re here to raise the bar in quality, innovation, and longevity. What Sets Us Apart? 💎 No Wipes, Ever Say goodbye to the fear of losing your progress. Our server is built to last and will never close. Stability and consistency are our promises to you. ⚔️ Weekly New Content Our dedicated development team ensures fresh challenges, events, and updates every week. From custom quests to exclusive features, there will always be something exciting to explore. 💰 No Pay-to-Win Skill and strategy matter most here. Enjoy a balanced gameplay environment where your achievements come from effort, not your wallet. 🌍 A Massive Community With 2000+ players expected, join a vibrant and active community of like-minded adventurers ready to conquer the world of Aden. 🏆 Fair and Competitive Gameplay Our systems are designed to promote healthy competition while avoiding abusive mechanics and exploits. 🔧 Professional Development From advanced bug fixes to carefully curated content, we pride ourselves on smooth performance, no lag, and unparalleled server quality. Key Features Chronicle: High Five with unique interface Rate: Dynamic x10 rates Class Balance: Carefully fine-tuned for a fair experience PvP Focused: PvP Ranking & aura display effect for 3 Top PvPers every week Custom Events: Seasonal and permanent events to keep you engaged Additional Features:   Custom Endgame Content: Introduce unique dungeons, raids, or zones unavailable in other servers. Player-Driven Economy: Implement a strong market system and avoid overinflated drops or rewards. Epic Siege Battles: Announce special large-scale sieges and PvP events. Incentives for Streamers and Clans: Attract influencers and big clans to boost server publicity. Roadmap Transparency: Share a public roadmap of planned updates to build trust and excitemen   Here you can read all the features: https://l2soe.com/features   Video preview: Join the Revolution! This is your chance to be part of something legendary. L2 Saga of Eternia is not just a server; it’s a movement to redefine what Lineage 2 can be. Whether you’re a seasoned veteran or a newcomer to the world of Aden, we invite you to experience Lineage 2 at its finest.   Official Launch Date: December 6th 2024 Website: https://l2soe.com/ Facebook: https://www.facebook.com/l2soe Discord: https://discord.com/invite/l2eternia   Let’s build the ultimate Lineage 2 experience together. See you in-game! 🎮
    • That's like a tutorial on how to run l2 on MacOS Xd but good job for the investigation. 
  • Topics

×
×
  • Create New...