Jump to content

Recommended Posts

Posted

where do you save the player's level after its done;

It does not require to save the Level. It is working like //setlevel command. You do not have to touch db. ;)

  • 5 months later...
Posted

I adopted it for latest L2J BETA 6253 and 9998 but when i use it nothing happens, i dont even get console errors.

package custom.DeLevelManager;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.model.skills.L2Skill;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.UserInfo;

/**
 * @author `Heroin
 * Made For Maxcheaters.com
 */
public class DeLevelManager extends Quest
{
	private static final int npcid = 36650; // npc id
	private static final int MinLevel = 10; // Minimum Level, (e.g if you set 10, players wont be able to be level 9).
	private static final int ItemConsumeId = 57; // Item Consume id
	private int levels ; // Item Consume id
	private static final int ItemConsumeNumEveryLevel = 100; // Item ItemConsumeNumEveryLevel
	private static String htm = "data/scripts/custom/DeLevelManager/1.htm"; //html location
	private static String ItemName = ItemTable.getInstance().createDummyItem(ItemConsumeId).getItemName();
	
	public DeLevelManager(int questId, String name, String descr)
	{
		super(questId, name, descr);
		addFirstTalkId(npcid);
		addTalkId(npcid);
		addStartNpc(npcid);
	}
	
	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		if (event.startsWith("dlvl"))
		{
			Dlvl(event, npc, player, event);
		}

		return "";
	}
	
	private void Dlvl(String event, L2Npc npc, L2PcInstance player, String command)
	{
		
		try
		{
			String val = command.substring(5);
			int pointer = Integer.parseInt(val);
			int k = player.getLevel();
			levels = k - pointer;
			if (player.getInventory().getItemByItemId(ItemConsumeId) == null)
			{
				player.sendMessage("You don't have enough items!");
				return;
			}
			if (val == null)
			{
				player.sendMessage("Something went wrong!");
				return;
			}
			if (pointer < 10)
			{
				player.sendMessage("Incorrect Level Number!");
				return;
			}
			if (pointer < MinLevel)
			{
				player.sendMessage("Incorrect Level Number!");
				return;
			}
			if (player.getLevel() <= pointer)
			{
				player.sendMessage("Your level is already lower.");
				return;
			}
			if (player.getInventory().getItemByItemId(ItemConsumeId).getCount() < ItemConsumeNumEveryLevel*levels)
			{
				
				player.sendMessage("You don't have enough items!");
				return;
			}
			if (player.getInventory().getItemByItemId(ItemConsumeId).getCount() >= ItemConsumeNumEveryLevel)
			{
				k = player.getLevel();
				final byte lvl = Byte.parseByte(pointer + "");	
				player.getStat().setLevel(lvl);
				player.sendMessage("Congratulations! You are now "+pointer+" level.");
				for(L2Skill sk : player.getAllSkills())
				{
					player.removeSkill(sk);
				}
				player.broadcastStatusUpdate();
				player.broadcastUserInfo();
				player.sendPacket(new UserInfo(player));
				player.sendPacket(new ExBrExtraUserInfo(player));
				player.giveAvailableAutoGetSkills();
				player.giveAvailableSkills(true, true);
				player.sendSkillList();
				levels = k - pointer;
				player.destroyItemByItemId("DlvlManager", ItemConsumeId, ItemConsumeNumEveryLevel*levels, player, true);
			}
		}
		catch (Exception e)
		{
			player.sendMessage("Something went wrong try again.");
		}
	}
	
	
	
	@Override
	public String onFirstTalk(L2Npc npc, L2PcInstance player)
	{
		final int npcId = npc.getId();
		if (player.getQuestState(getName()) == null)
		{
			newQuestState(player);
		}
		if (npcId == npcid)
		{
			String html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), htm);
			html = html.replaceAll("%player%", player.getName());
			html = html.replaceAll("%itemname%", ItemName);
			html = html.replaceAll("%price%", ""+ItemConsumeNumEveryLevel+"");
			
			NpcHtmlMessage npcHtml = new NpcHtmlMessage(0);
			npcHtml.setHtml(html);
			player.sendPacket(npcHtml);
		}
		return "";
	}
	
	public static void main(final String[] args)
	{
		new DeLevelManager(-1, DeLevelManager.class.getSimpleName(), "custom");
		System.out.println("De Level Manager by `Heroin has been loaded successfully!");
	}
}
  • 2 weeks later...
Posted

I am trying to use this NPC on aCis. Modified a little the imports, changed some lines, also the NPC html view, it loads without problem, but after I spawn it and I try to talk, I get the message shown as servernews :). Can anybody give me a clue on how to make it work ?

Thank you in advance !

  • 3 weeks later...
  • 7 months later...
Posted (edited)

Hi there for one more time, i made this npc today because i can see there are lots of npc like this but there is not any like this i made today. It is just an NPC where player can choose what level would like to be. Price is being regulated automatically like that: Number_of_levels_decreased * Configurable_price.

 

E.g: Player is 85 level, he chooses to be 70. His payment would be 15(levels) * code_price.

 

Preview (HTM Dialog):

 

shot00001ti.png

 

How to install:

 

1. Create a new java file on data/scripts/custom/DeLevelManager/DeLevelManager.java

 

Paste this code:

package custom.DeLevelManager;
import com.l2jserver.gameserver.cache.HtmCache;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.model.L2Skill;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.network.serverpackets.ExBrExtraUserInfo;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.UserInfo;

/**
 * @author `Heroin
 * Made For Maxcheaters.com
 */
public class DeLevelManager extends Quest
{
	private static final int npcid = 36650; // npc id
	private static final int MinLevel = 10; // Minimum Level, (e.g if you set 10, players wont be able to be level 9).
	private static final int ItemConsumeId = 57; // Item Consume id
	private int levels ; // Item Consume id
	private static final int ItemConsumeNumEveryLevel = 100; // Item ItemConsumeNumEveryLevel
	private static String htm = "data/scripts/custom/DeLevelManager/1.htm"; //html location
	private static String ItemName = ItemTable.getInstance().createDummyItem(ItemConsumeId).getItemName();
	
	public DeLevelManager(int questId, String name, String descr)
	{
		super(questId, name, descr);
		addFirstTalkId(npcid);
		addTalkId(npcid);
		addStartNpc(npcid);
	}
	
	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		if (event.startsWith("dlvl"))
		{
			Dlvl(event, npc, player, event);
		}

		return "";
	}
	
	private void Dlvl(String event, L2Npc npc, L2PcInstance player, String command)
	{
		
		try
		{
			String val = command.substring(5);
			int pointer = Integer.parseInt(val);
			int k = player.getLevel();
			levels = k - pointer;
			if (player.getInventory().getItemByItemId(ItemConsumeId) == null)
			{
				player.sendMessage("You don't have enough items!");
				return;
			}
			if (val == null)
			{
				player.sendMessage("Something went wrong!");
				return;
			}
			if (pointer < 10)
			{
				player.sendMessage("Incorrect Level Number!");
				return;
			}
			if (pointer < MinLevel)
			{
				player.sendMessage("Incorrect Level Number!");
				return;
			}
			if (player.getLevel() <= pointer)
			{
				player.sendMessage("Your level is already lower.");
				return;
			}
			if (player.getInventory().getItemByItemId(ItemConsumeId).getCount() < ItemConsumeNumEveryLevel*levels)
			{
				
				player.sendMessage("You don't have enough items!");
				return;
			}
			if (player.getInventory().getItemByItemId(ItemConsumeId).getCount() >= ItemConsumeNumEveryLevel)
			{
				k = player.getLevel();
				final byte lvl = Byte.parseByte(pointer + "");	
				player.getStat().setLevel(lvl);
				player.sendMessage("Congratulations! You are now "+pointer+" level.");
				for(L2Skill sk : player.getAllSkills())
				{
					player.removeSkill(sk);
				}
				player.broadcastStatusUpdate();
				player.broadcastUserInfo();
				player.sendPacket(new UserInfo(player));
				player.sendPacket(new ExBrExtraUserInfo(player));
				player.giveAvailableAutoGetSkills();
				player.giveAvailableSkills(true, true);
				player.sendSkillList();
				levels = k - pointer;
				player.destroyItemByItemId("DlvlManager", ItemConsumeId, ItemConsumeNumEveryLevel*levels, player, true);
			}
		}
		catch (Exception e)
		{
			player.sendMessage("Something went wrong try again.");
		}
	}
	
	
	
	@Override
	public String onFirstTalk(L2Npc npc, L2PcInstance player)
	{
		final int npcId = npc.getNpcId();
		if (player.getQuestState(getName()) == null)
		{
			newQuestState(player);
		}
		if (npcId == npcid)
		{
			String html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), htm);
			html = html.replaceAll("%player%", player.getName());
			html = html.replaceAll("%itemname%", ItemName);
			html = html.replaceAll("%price%", ""+ItemConsumeNumEveryLevel+"");
			
			NpcHtmlMessage npcHtml = new NpcHtmlMessage(0);
			npcHtml.setHtml(html);
			player.sendPacket(npcHtml);
		}
		return "";
	}
	
	public static void main(final String[] args)
	{
		new DeLevelManager(-1, DeLevelManager.class.getSimpleName(), "custom");
		System.out.println("De Level Manager by `Heroin has been loaded successfully!");
	}
}
2.Create a new htm file on data/scripts/custom/HeroManager/1.htm

Paste this code on it.

 

<html>
<title>%player%</title>
<body><center>
<img src="L2UI_CH3.herotower_deco" width=256 height=32></center><br>
Hello there, if you want to low your current level, you came to right place!<br>
You have just to choose the <font color=FF0000>number</font> of level you would like to be.<br>
In exchange, i am going to take you <font color=LEVEL>%price% %itemname%</font> for <font color=LEVEL>each level
</font> you decrease.<br>
Remember: You can't choose a number higher than your current level.<br>

<table width=270><tr>
<td><button value="Change my level to: " action="bypass -h Quest DeLevelManager dlvl $lv" width=180 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
<td><edit var="lv" width=50></td>
</tr></table>


<br><br><br><br>
<center>
<img src="L2UI_CH3.herotower_deco" width=256 height=32></center>
</body></html>
3. Add script on scripts.cfg file:

custom/DeLevelManager/DeLevelManager.java
4. Run this query on your database or install the NPC by yourself.

INSERT INTO `custom_npc` VALUES ('36650', '13173', 'DeLevelManager', '1', 'MaxCheaters.com', '1', 'LineageNPC.clear_npc', '8.00', '19.00', '85', 'male', 'L2Npc', null, null, null, null, null, '40', '43', '30', '21', '20', '20', '0', '0', null, null, null, null, '230', '1', '0', '333', '0', '0', '0', '60.00000', '120.00000', '1', '1', '0', '0');
How to Modify:

 

Check Variables on code:

private static final int npcid = 36650; // npc id
private static final int MinLevel = 10; // Minimum Level, (e.g if you set 10, players wont be able to be level 9).
private static final int ItemConsumeId = 57; // Item Consume id
private int levels ; // Item Consume id
private static final int ItemConsumeNumEveryLevel = 100; // Item ItemConsumeNumEveryLevel
private static String htm = "data/scripts/custom/DeLevelManager/1.htm"; //html location
Credits & Idea: `Heroin

 

Hello everybody i need help. i don´t understand why you create a new folder that called Olympiamanager . We have tried it but it doesn´t work we have an npc with a quest but the html dialog doesn´t work . Can anybody explain? Sry i mean Heromanager, thanks for help

Edited by rockabill
  • 6 months later...
Posted (edited)

Hello cheaters. I tried to adapt it for latest aCis, but my skills are really poor and I stucked. I fixed the imports and 80% of the errors are gone, but there are 4 more, I cannot fix. Here they are:

				player.sendPacket(new ExBrExtraUserInfo(player));
				player.giveAvailableAutoGetSkills();
				player.giveAvailableSkills(true, true);
				player
String html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), htm);
Edited by raF
  • 11 months later...
  • 2 weeks later...
Posted

I tested and it works but it have a few problems. It does decrease your level but it does not decrease your EXP/SP.  So after you decrease level you won't be able to level up again because you can't gain no more EXP/SP.

Also the path for the 1.htm  is right on the java file but you tell us to add at another folder, it should be at the same folder as the java file.

 

I was able to fix the EXP/SP problem but if someone add this to a live server it will bug the characters.

  • 2 years later...
Posted

Can someone help me to adjust this DeLevel NPC to the Latest Release of L2jserver???
At this moment i have tried all i can think off, and cant get rid of these 4 errors...
As far as i have been trying to fix it, comparing it to other files like this one, i think my problem is in these lines...



    private static String ItemName = ItemTable.getInstance().getItemByItemId(ItemConsumeId).getItemName();

 

 

            for(SkillData sk : player.getAllSkills())

 

 

                player.removeSkill(sk);

 

 

    if (npcId = npcid)

 

 

If someone could help me would be awesome...
Thanks in advance =9

 

 

 

Posted
18 minutes ago, unfor6iven said:

Can someone help me to adjust this DeLevel NPC to the Latest Release of L2jserver???
At this moment i have tried all i can think off, and cant get rid of these 4 errors...
As far as i have been trying to fix it, comparing it to other files like this one, i think my problem is in these lines...



    private static String ItemName = ItemTable.getInstance().getItemByItemId(ItemConsumeId).getItemName();

 

 

            for(SkillData sk : player.getAllSkills())

 

 

                player.removeSkill(sk);

 

 

    if (npcId = npcid)

 

 

If someone could help me would be awesome...
Thanks in advance =9

 

 

 

 

I fixed the errors you are facing. Check main post, at the bottom :)

P.S: I did not test it but the chance of having errors is low.

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

    • ⚔️ WELCOME TO L2EPICFAIL ⚔️ Server developed by gamers, for gamers! ❄️ WINTER SEASON #8 ❄️ OPEN BETA — 15 NOVEMBER 2026 GRAND OPENING — 20 NOVEMBER 2026, 18:30 GMT+0 Website: https://l2epic.fail/ Discord: https://discord.gg/6hwhrkrHBG ━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚔️ SERVER FEATURES & RATES EXP — 10x SP — 9x Adena — 6x Drop — 3x Spoil — 3x Seal Stones — 3x Epic Raid Boss Drop — 1x Regular Raid Boss — EXP 5x / SP 5x / Drop 4x Quest Drop — 1x (selected quests 2–3x) Quest Rewards — 1x (Adena / EXP / SP 3x) ━━━━━━━━━━━━━━━━━━━━━━━━━━ ★ PREMIUM ACCOUNT EXP +20% SP +20% Adena +20% Drop +20% Spoil +20% Quest Rewards +20% Available through voting, Epic Coins or donations. World Chat — 60 messages per day using "&" Buff Book usable outside towns. Premium applies to all characters on the account. ━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ SPECIAL FEATURES Classic Interface Active Anticheat Vote System Daily Missions Attendance Rewards Masterwork Items Brooches & Diamonds Kamaloka Autofarm Epic Auctioneer Epic Market Price Search No Carrier Protection Raid Rank System PvP Events ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🐉 EPIC BOSSES & RESPAWNS All times GMT+0. Spawn windows visible through .epic. QUEEN ANT — LVL 80 Every day except Wednesday and Sunday 18:00–18:30 Maximum C-grade equipment Boosted HP / Drop Chance 49% CORE — LVL 80 Monday and Friday 20:00–20:15 Maximum B-grade equipment Boosted HP / Drop Chance 60% Core Ring: +1 STR, +1 DEX ORFEN — LVL 80 Tuesday, Thursday and Saturday 20:00–20:15 Maximum B-grade equipment Boosted HP / Drop Chance 60% Orfen Earring: +1 WIT, +1 INT ZAKEN — LVL 80 Monday and Friday 19:00–19:30 Maximum A-grade equipment Automatic PvP Zone BAIUM Every Sunday 18:00–19:00 Automatic PvP Zone / Regular HP FRINTEZZA Tuesday and Thursday 19:00–20:00 Minimum 2 parties / Maximum 5 parties Minimum character level 74 Automatic PvP Zone ANTHARAS Every two weeks on Saturday 19:00–19:30 Automatic PvP Zone VALAKAS Every two weeks on Saturday 19:00–19:30 Automatic PvP Zone Antharas and Valakas spawn on alternating weeks. Epic Bosses drop Epic Medals equal to their level × 10. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🏆 RAID RANK Clans earn Raid Rank points by killing Raid Bosses level 30+. Raid Bosses level 75+ award 150 points. Rankings reset every Monday morning. Weekly Rewards: 1st Place — 50 RRR Coins 2nd Place — 40 RRR Coins 3rd Place — 30 RRR Coins 4th Place — 20 RRR Coins 5th Place — 13 RRR Coins RRR Coins can be exchanged for Epic Jewelry. ━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚒️ ENCHANT SYSTEM Safe Enchant — +3 Maximum Enchant — +16 Regular Enchant Chance — 60% Blessed Enchant Chance — 66% Enchant chances progressively decrease after +10. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 💎 BROOCHES & DIAMONDS Maximum Level — +10 Brooch Compound Chance — 25% Diamond Compound Chance — 35% Requires two items of the same type and level. On failure, one item remains in inventory. Disabled during Olympiad. ━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ MASTERWORK ITEMS Masterwork Crafting Chance — 2% A-grade — Armors & Jewelry S-grade — Weapons, Armors & Jewelry ━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚔️ REGULAR RAID BOSSES All regular Raid Bosses have boosted HP. Slightly increased M.Def to give fighters an advantage. Respawn — 24–30 hours Epic Medal Drops — Equal to Raid Boss level Raid Boss status can be checked on the map. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🏅 OLYMPIAD Weekly Period Thursday–Saturday, 16:00–22:00 GMT+0 Maximum Equipment Enchant — +7 (progressive) Minimum Non-Class Participants — 5 Minimum Class-Based Participants — 10 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 📜 CLASS TRANSFER 1st Class — 50k Adena 2nd Class — 500k Adena 3rd Class — 25kk Adena + 700 Halisha Marks Halisha Marks are tradeable and drop in Shrine of Loyalty. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 👑 NOBLESSE QUEST Retail-style Noblesse Quest with boosted quest drops. Alternative Method — No Barakiel Kill Required Collect 100 Noble Ants Feeler from Wailing of Splendor in Valley of Saints. Drop Chance — 4% Barakiel Respawn — 10–14 hours Barakiel's Chest provides 10 Noble Ants Feeler when the relevant quest is active. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 📖 SUBCLASS QUEST Minimum Main Class Level — 75 Start the Reorin Quest in Giran. Obtain the required item from Cabrio's Chest first. Collect items from Hallate, Kernon and Golkonda. Return to Reorin and complete the remaining quest requirements. Maximum Subclasses — 5 Cabrio Respawn — 6–8 hours Tower of Insolence Raid Bosses — 8–10 hours ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔮 SKILLS & AUGMENTS Mass Sweep — All Bounty Hunters level 40+ Block Buff — All characters, toggle Escape — 20 seconds, no Scroll of Escape required Automatic Skill Learning Skill Loss After 16 Levels of Delevel Maximum Buffs — 24 + 4 with books Augmentation Skill Chances: Normal Life Stone — 4% Mid-grade Life Stone — 5% High-grade Life Stone — 7% Top-grade Life Stone — 6% Fast Augmentation by double-clicking Life Stones. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🛒 GM SHOP Weapons, Armors and Jewelry — Up to C-grade Soulshots / Spiritshots — Up to C-grade Mana Potions — 500 MP / 5 seconds ━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ NPC BUFFER All Buffs, Songs and Dances Third Class Buffs and Resists Buff Duration — 1 Hour Buff Book available to every character. ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🌍 GLOBAL GATEKEEPER All Towns Catacombs and Necropolises Tower of Insolence — Floors 3 / 5 / 7 / 10 ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🛡️ CLANS & PVP Maximum Main Clan Members — 80 Maximum Alliance Clans — 3 Clan Leave / Dismiss Penalty — 12 Hours Epic PvP Zone Limit — 4 CPs / 36 Players Clan skills apply to all members without requiring titles. ━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚙️ AUTOFARM Available to Everyone After the First Week Maximum 1 Active Window per HWID Maximum 1 Hour at a Time Requires Autofarm Tickets purchased with Epic Coins and Adena. Activate using .autofarm Disabled While PvP Flagged Third-Party Bot Software Is Prohibited ━━━━━━━━━━━━━━━━━━━━━━━━━━ 📌 ADDITIONAL FEATURES Maximum 3 Windows per HWID Only 1 Window Allowed in PvP Zones Teleport Protection — 20 Seconds Weight Limit — 10x Stackable Enchant Scrolls and Life Stones Blue Champions — 5x HP Minimum Trade Level — 40 Minimum Chat Level — 20 Arrows and Spellbook Drops Disabled Blacksmith of Mammon and Merchant of Mammon in Towns Alt+Click Buff Removal 19-Level Party EXP Difference No Carrier Disconnect Protection Payback System ━━━━━━━━━━━━━━━━━━━━━━━━━━
    • They're just jealous because I'm better at prompting than all of them combined. There's all working on L2jPromptius and can't even manage to open a single private server with it in like 10 years, and now they're nervous because I'm sharing tools they've been gatekeeping from the community so they can't profit anymore. Truly shameless behavior from them  They're losing business opportunities with every free share, they literally live from the game, just a bunch of unemployed dudes 
    • I don't understand the hate at all? Why are people getting mad at 911reg for sharing an already free tool but improved? Right now the competition is not in dev ability but in creativity and vision. 
  • 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..