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

    • Since ur interested on the latest client(s) Your best bet is l2jmobius.  Their free repo is more than enough to get you started. They also offer a subscription of 100$ in order to access the latest sources. A big + is the community there is pretty active and helpful.
    • Hey chatgpt. Make me a website for my private l2jserver called l2karma. Make no mistakes.
    • Server Description L2 Karma is a permanent Interlude 1x server built on L2J with retail-like mechanics and a long-term vision — not a seasonal reset or wipe server. We focus on competitive longevity, fair play, and a community where every player matters. Core Features ✔ True x1 Experience (XP / SP / Adena / Drop / Spoil) ✔ Retail mechanics — no forced progression shortcuts ✔ Single-box only (1 client per player — no multi-boxing advantage) ✔ No Pay-to-Win & strict anti-RMT policy ✔ Already live and active with players progressing ✔ Long-term commitment — 3-year guarantee ✔ Designed for meaningful PvP and community cohesion 📏 Server Rules No Multi-Boxing Advantage — Only one client per account is allowed. No Pay-to-Win Items or Services — VIP runes are optional and do not lock content. No Bots, Scripts, or Automation — Zero tolerance. Suspicious accounts will be banned. No Exploit Abuse — Reporting exploits immediately avoids penalties. No RMT / Real Money Trading — Strict enforcement — economy integrity matters. Fair Play Only — Harassment and racism are not allowed in chat or Discord. Respect Admin Decisions — Official rulings are final to keep the server stable. 📥 How to Join 🔗 Website: https://l2karma.org 🔗 Discord: https://discord.gg/VV9RAfmnth Chronicle: Interlude Rates: x1 (Classic) Box Limit: Single Box 🧠 What Makes Us Different ✔ Permanent World — No resets ever ✔ Designed for players tired of wipe-cycle servers ✔ Community-centric growth — not rinse-and-repeat launches ✔ Competitive but fair environment ✔ Events, structured seasons, and ongoing content support
    • A widespread proxy service, operating through hijacked devices, has been shut down in a cross-industry effort led by Google. The network, known as IPIDEA, functioned by secretly converting millions of personal devices into proxies for malicious actors. The Mechanism of the Scheme The operation distributed hidden code within seemingly legitimate free apps and VPN services. Once installed, this code enrolled the user’s device into a pool of residential IP addresses. These addresses were then sold anonymously, primarily to cybercriminal and state-sponsored groups, to mask the origin of attacks, fraud, and espionage. Key impacts of the network included: Facilitating operations for more than 550 identified threat actors. Exposing unsuspecting device owners to potential legal and security risks by associating their IP addresses with criminal traffic. The Takedown Strategy Google and its partners disrupted the service by: Seizing core operational domains. Using Google Play Protect to detect and remove malicious applications. Coordinating with infrastructure providers to prevent the network from reestablishing itself. The action highlights the necessity of continuous user awareness, developer diligence in code reviews, and proactive industry cooperation to maintain cybersecurity. Front Companies Associated with IPIDEA IPIDEA masked its activities under various brand names, such as: Proxy Brands: 360 Proxy, 922 Proxy, Luna Proxy, IP2World, ABC Proxy. VPN Brands: Door VPN, Radish VPN, Galleon VPN. SDK Brands: PacketSDK, HexSDK (the toolkits used to embed proxy code).   Choosing Ethical Proxy Services Alternatives For lawful purposes like market research, ad verification, or data aggregation, selecting a transparent and consensual provider is essential. Reputable services obtain explicit user permission for their networks and enforce strict compliance measures. Examples of Established Providers: Bright Data: A leading, consent-based residential proxy network. Oxylabs: Provides large-scale proxy solutions for enterprise needs. MoMoProxy: Maintains a large pool of residential IPs for tasks like web scraping.   Only $850/1TB.  https://momoproxy.com   Identifying a Legitimate Provider: A trustworthy service will typically demonstrate: Informed Consent: Networks are built with the clear agreement of participants. Robust Compliance: Proactive systems to prevent abuse and respect website terms. Operational Transparency: Public-facing policies, identifiable corporate structure, and genuine customer support. Conduct thorough due diligence. Opt for providers that are clear about their IP sources and maintain strong anti-abuse policies, ensuring your legitimate activities do not inadvertently support harmful operations.
  • 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..