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

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

    • I’m coming to you with a small update — internal testing is currently underway. We’re working on catching minor issues and resolving them before the server launch 😉 In the near future, we’re planning public tests, which you’ll all be invited to. At the same time, I’ll be sharing a few Quality of Life changes coming to L2 Genesis.   Even if you’re not interested in playing right now, but you are a long-time Lineage 2 player, feel free to join our community. We would greatly appreciate your experience and feedback to help us improve and develop our project. Join the growing L2Genesis community: https://discord.gg/mcuHsQzNCm Also check our website: https://l2genesis.com/   Offline Shop System — run your shop without being online.   Buff Shop System — playing as a buffer? When you’re not in the game, sell buffs! Reworked classic interface, adapted to Interlude — shown here with the inventory menu as an example. New custom mob drop and spoil preview. DualBox Verification System — each player can only use one active account at a time. Genesis Wiki — a collection of all essential information about items, NPCs, drops, spoils, and quests.
    • https://gitlab.com/Tryskell/acis_public nai swsta, exeis kati pio updated na mas protineis? 
    • 🔥 L2Gold Enma – High Rate PvP Interlude 🔥 Interlude Chronicle • C6 Skills • Pure PvP Experience Welcome to L2Gold Enma, a high-rate PvP server designed for players who want instant action, balanced gameplay and nonstop PvP, without pointless grinding. ⚔️ Server Rates XP / SP: x1000 Adena / Drops: x10 Chronicle: Interlude Skills: C6 balanced skills Buff duration: 2 hours No weight limit 🎮 Gameplay Philosophy Fast leveling, instant PvP Clean Interlude experience No pay-to-win mechanics Focus on skill-based PvP 🛡️ Core Features Global Gatekeeper Offline shops Auto events (TvT, DM, CTF, etc.) Retail-like Olympiad with custom balance Active Raid Bosses Easy access to PvP gear 🏰 PvP & Competition Mass PvP & clan wars Meaningful castle sieges Olympiad focused on player skill Balanced classes for both solo & group PvP ⚡ Why L2Gold Enma? Interlude nostalgia with C6 skills High rates, low grind Stable server & active development Community-focused updates 💥 Join L2Gold Enma and dominate the battlefield! This is not a farm server. This is PvP   https://l2gold-enma.com/ https://discord.com/invite/Ba9cHj3HUJ
    • Hi I'm still online for this but making backup of everything in that time I didn't organize well so let me create a pack and upload to archive.org maybe. Thanks ! we can enrich togethers this if everyone add more and more old files.
  • 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..