Jump to content

Recommended Posts

Posted (edited)

hello,

i was seaching 5 min ago something and i found a code that removes karma with an item and i thought that it was something that removing pk amount with your pvp amount.

so i did some modifies and i did that ;D

 

so create in instance a file called L2PkTraderInstance

/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
package com.l2jfrozen.gameserver.model.actor.instance;

import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;

/**
+ * Author: te0x
+ */
public class L2PkTraderInstance extends L2NpcInstance
{
	public L2PkTraderInstance(int objectID, L2NpcTemplate template)
	{
		super(objectID, template);
	}
	
	@Override
	public void onBypassFeedback(L2PcInstance player, String command)
	{
		if (command.startsWith("CleanPK"))
		{
            if(player.getPkKills() <= Config.PK_TRADER)
            {
                    player.sendMessage("You must have at least " + Config.PK_TRADER+ " pks to clean em");
                    return;
            }
            else if(player.getPvpKills() <= Config.PVPS_CLEAN_PK)
            {
                    player.sendMessage("You must have at least " + Config.PVPS_CLEAN_PK+ " pvps to clean " + Config.PK_TRADER+ " pk!");
                    return;
            }
		else
				player.setPkKills(player.getPkKills() - Config.PK_TRADER);
				player.setPvpKills(player.getPvpKills() - Config.PVPS_CLEAN_PK);
				player.sendMessage("You have successfully removed "+ Config.PK_TRADER+" pk kill!");	
				player.broadcastUserInfo();
		}
		
		super.onBypassFeedback(player, command);
	}
	
	@Override
	public void showChatWindow(L2PcInstance player)
	{
		player.sendPacket(ActionFailed.STATIC_PACKET);
		
		NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		
		html.setFile("data/html/PKCleaner/" + getTemplate().getNpcId() + ".htm");		
		html.replace("%objectId%", String.valueOf(getObjectId()));
		html.replace("%name%", player.getName());				
		player.sendPacket(html);
	}

}

now in configs

public static boolean SCROLL_STACKABLE;
+ public static int PVPS_CLEAN_PK;
+ public static int PK_TRADER;

SCROLL_STACKABLE = Boolean.parseBoolean(L2JFrozenSettings.getProperty("ScrollStackable", "False"));
+  PVPS_CLEAN_PK = Integer.parseInt(L2JFrozenSettings.getProperty("PvpNeedToRemovePk", "15"));
+  PK_TRADER = Integer.parseInt(L2JFrozenSettings.getProperty("PkRemoveby", "15"));

DP part

create a file with ur npc id and add this. Don't forget the type must be L2PkTrader


+<html><title>PK Cleaner</title>
+<html>
+<body>
+<center>
+<img src="L2UI_CH3.herotower_deco" width=256 height=32>
+</center>
+<center>
+<br>
+<font color="FF0000">PK Cleaner</font><br>
+<font color="00FF00">Hello, %name%<br>
+I'm the PK Cleaner, I'll Change your karma to 0, it costs 1 Coin of Luck.<br>
+</font><br>
+</center>
+<center>
+<button value="Clean" action="bypass -h npc_%objectId%_CleanPK" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal">
+<img src="L2UI_CH3.herotower_deco" width=256 height=32><br>
+</center>
+</body></html>
\ No newline at end of file

Configs/functions/l2jfrozen

 

# How many pvps wants to delete so u can clean up pks

PvpNeedToRemovePk = 5
# How many pks will be cleaned
PkRemoveby = 1

 

thats all ;D

Edited by te0x

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

    • Hi, could someone please share a C1 L2 Off cheat code for local play?
    • I’ve worked with a web designer Tacoma before, and it really reminded me how much smoother projects run when design and development stay in sync. Your setup looks solid, and pairing clean UI work with steady backend support can save a ton of back‑and‑forth later. If you ever decide to push harder on conversions or need outside perspective on structure, that mix helped me spot gaps early on.
    • If you’re juggling mixed payment methods and tricky setups, I’ve found that easing the pressure on the subscription side can make the whole flow smoother. I started using Subscription Revenue Growth for handling my own recurring payments, upgrades, and all that messy churn stuff, and it took a big weight off. Pairing something stable for subs with your gateway setup can keep cashflow from going off the rails.
    • L2Avalon launches February 20 High Five project (Salvation client) focused on classic world progression — not instance spam and not “twink” metas. What is L2Avalon? L2Avalon is built around real Lineage 2 gameplay: farming spots, open world conflict, raids, epics, economy and competition. No Kamael Reduced instanced content **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net Balance & Economy Every class is tuned to be viable in PvE and PvP Off-meta classes get buffed instead of adding power-creep garbage Adena-based economy Farming matters: boosted Drop/Spoil for each stage of progression Rates & Settings Dynamic XP: 50x (Lv 1–40) → 1x (Lv 78+) Staged progression with new content unlocking weekly Adena / Drop / Spoil: 3x / 5x / 5x NPC Buffer: 2 hours (Premium: 3 hours) Box limit: 2+1 windows per PC MP potion: 1000 MP, 10s cooldown Free2Play System (earn Donate Coins by playing) You don’t have to donate to progress. Donate Coins drop in-game, so everything is achievable through playtime and activity. Where Donate Coins drop: Mobs Lv 76+, Raid Bosses Lv 70+, Epic Bosses Auto-farm (controlled) Limit: only 1 window can use auto-farm at the same time Daily time: 1 hour/day without Premium Extra tickets: purchasable with PC Bang points (earned by being online) Disabled zones: CC / IT / FOG / VARKA / KETRA Equipment Changes Reworked set bonuses Reworked SA system Enchanted set bonuses Enchanted shirt bonuses Fake Epic jewelry (weakened alternative) Skills (High Five mechanics) New skills added Old skills updated New enchant branches + updated existing ones Subclass skills Clan skills Daily Activities (solo-friendly) Events / Missions / Instances Stages Soon — stage schedule and weekly unlocks will be published February 20 — we start. **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net
  • 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