Jump to content

Recommended Posts

Posted (edited)

Hello here is a pvp auto enchant code for acis when you kill some you have a chance to get a random item from yours by +1 

 

http://prntscr.com/i451wk

 

go to

net/sf/l2j/gameserver/model/actor/instance/player.java

 

find this 

protected int _classIndex;

and put this     

/** Pvp enchant System **/
    private int rewardConsecutiveKillCount = 0;

 

like that

	protected int _classIndex;
	
	/** Pvp enchant System **/
	private int rewardConsecutiveKillCount = 0;

next find this 

	// Add PvP point to attacker.
				setPvpKills(getPvpKills() + 1);

and paste this

rewardConsecutiveKillCount++;

like that  

	// Add PvP point to attacker.
  setPvpKills(getPvpKills() + 1);
  rewardConsecutiveKillCount++;

and under this

 rewardConsecutiveKillCount++;

paste all this 

final ItemInstance pvpwep = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
				final ItemInstance pvphead = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
				final ItemInstance pvpgloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
				final ItemInstance pvpchest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
				final ItemInstance pvplegs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
				final ItemInstance pvpfeet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
				final ItemInstance pvpneck = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
				final ItemInstance pvplf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER);
				final ItemInstance pvprf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER);
				
				if (rewardConsecutiveKillCount >= Config.PVP_COUNT_TILL_ENCHANTMENT && Config.ENABLE_PVP_ENCHANTMENT)
				{
					switch (Rnd.get(9))
					{
						case 0:
						{
							pvpwep.setEnchantLevel(pvpwep.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 1:
						{
							pvphead.setEnchantLevel(pvphead.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 2:
						{
							pvpgloves.setEnchantLevel(pvpgloves.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 3:
						{
							pvpchest.setEnchantLevel(pvpchest.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 4:
						{
							pvplegs.setEnchantLevel(pvplegs.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 5:
						{
							pvpfeet.setEnchantLevel(pvpfeet.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 6:
						{
							pvpneck.setEnchantLevel(pvpneck.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 7:
						{
							pvplf.setEnchantLevel(pvplf.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
						case 8:
						{
							pvprf.setEnchantLevel(pvprf.getEnchantLevel() + 1);
							sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) + "has been enchanted by +1 due to your pvp kills");
							rewardConsecutiveKillCount = 0;
							break;
						}
					}
				}

go to net/sf/l2j

 

find this    

public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;

and paste this like that 

public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;

    /** PvP auto enchant system */
    public static boolean ENABLE_PVP_ENCHANTMENT;
    public static int PVP_COUNT_TILL_ENCHANTMENT;

find this 

ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false);

and put this like that 

ALT_GAME_SUBCLASS_WITHOUT_QUESTS = players.getProperty("AltSubClassWithoutQuests", false);

ENABLE_PVP_ENCHANTMENT = players.getProperty("EnablePvpEnchantSystem", false);
        PVP_COUNT_TILL_ENCHANTMENT = players.getProperty("PvpCountTillEnchanment", 20);

go to config/players.properties

#=================================#
#==  by thelwhelprepaidia ==#
#==  Pvp Enchant System ==#
#=================================#
#By enabling this then every X pvp
#in a row the player will get randomly
#a part of his armor,weapon or jewel that
#is currently equiped automatically enchanted
#To enable the system set True below
EnablePvpEnchantSystem = True
#Every how many kills you want the chars to be
#awared with +1?
PvpCountTillEnchanment = 20

And you are done.

 

credits Elfocrash

Edited by ThelwHelpRePaidia
  • Like 1
Posted (edited)

good share but missing the "chance" of what you describe.

the description is first xx kills enchant 100% a random item that player wears.

also i am sure its already shared here before i think it needs credits

Edited by Nightw0lf
Posted (edited)

we all had to start from somewhere no shame on that

just enclose all the big code inside of this and it will be activated with 50% chance

if (Rnd.get(100) > 50){
  //paste the code here
}
Edited by Nightw0lf
Posted (edited)

A nice-different feature :) Good to bring back some old shares.

About the code use elfo,nightwolf update will be better ;)

also you can add 1 null check in elfos code for the item . something like that

 

L2ItemInstance itemToEnchant = activeChar.getInventory().getPaperdollItem(randomInventorySlot);
+if (itemToEnchant == null)
+  return;
itemToEnchant.setEnchantLevel(itemToEnchant.getEnchantLevel() + 1);

and update the line

sendMessage("Your " + ItemTable.getInstance().getTemplate(itemToEnchant.getItemId()).getName() + " has been enchanted by +1 due to your pvp kills");

to 

sendMessage("Your " + itemToEnchant.getItem().getName() + " has been enchanted by +1 due to your pvp kills");

 

Edited by melron
Posted

thanks for share nice code :) 

On 1/24/2018 at 3:22 PM, .Elfocrash said:

I was already shared mate. I think it could be found in the old l2jfrozen forum.

den uparxi old forum l2jfrozen exasan ta files lene. xD etsi diavasa toulaxiston

Posted
18 minutes ago, .Elfocrash said:

[GR] Exeis valei to readability kai vasika coding practices sta tessera kai ta ksekoliazeis, alla profanws einai private source opote klain.

 

Ontopic, ye pretty much simple as that.

 

mono egw exw to source

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

    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click   🚀 Promo code: MEDIUM5 (5% Discount)   ➡️ Online Store: Click ✅ ➡️ Telegram Bot: Click ✅ ➡️ SMM Panel: Click ✅   Regular customers receive additional discounts and promo codes!   Support: ➡️ Telegram: https://t.me/solomon_bog ✅ ➡️ Discord: https://discord.gg/y9AStFFsrh ✅ ➡️ WhatsApp: https://wa.me/79051904467 ✅ ➡️ Email: solomonbog@socnet.store ✅   ➡️ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners )  — Becoming a supplier   SocNet — your store for digital goods and premium subscriptions ✅
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • Buying & Selling Torn City Cash
  • Topics

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