Jump to content

Recommended Posts

Posted (edited)

So I decided to share this code. I am not using it personally but it has been tested and its fully working.

 

Some of the lines have been tweaked for better in game response.

 

The code is fully editable through html/xml as all of it is situated in the datapack.

 

If you have any problems let me know.

	

    ### Eclipse Workspace Patch 1.0
    #P L2J_DataPack
    Index: dist/game/data/scripts/custom/LevelUpReward/rewards.xsd
    ===================================================================
    --- dist/game/data/scripts/custom/LevelUpReward/rewards.xsd (revision 0)
    +++ dist/game/data/scripts/custom/LevelUpReward/rewards.xsd     (working copy)
    @@ -0,0 +1,32 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    +       <xs:element name="list">
    +               <xs:complexType>
    +                       <xs:sequence minOccurs="1" maxOccurs="1">
    +                               <xs:element name="rewards" minOccurs="1" maxOccurs="unbounded">
    +                                       <xs:complexType>
    +                                               <xs:sequence minOccurs="1" maxOccurs="unbounded">
    +                                                       <xs:element name="item">
    +                                                               <xs:complexType>
    +                                                                       <xs:attribute name="id" type="xs:integer"></xs:attribute>
    +                                                                       <xs:attribute name="count" type="xs:long"></xs:attribute>
    +                                                               </xs:complexType>
    +                                                       </xs:element>
    +                                               </xs:sequence>
    +                                               <xs:attribute name="level" use="required">
    +                                                       <xs:simpleType>
    +                                                               <xs:restriction base="xs:integer">
    +                                                                       <xs:minInclusive value="0" />
    +                                                                       <xs:maxInclusive value="85" />
    +                                                               </xs:restriction>
    +                                                       </xs:simpleType>
    +                                               </xs:attribute>
    +                                               <xs:attribute name="message" use="optional"></xs:attribute>
    +                                               <xs:attribute name="htmlFile" use="optional"></xs:attribute>
    +                    </xs:complexType>
    +                               </xs:element>
    +                       </xs:sequence>
    +                       <xs:attribute name="rewardAll" use="required" type="xs:boolean"></xs:attribute>
    +               </xs:complexType>
    +       </xs:element>
    +</xs:schema>
    \ No newline at end of file
    Index: dist/game/data/scripts/custom/LevelUpReward/LevelUpReward.java
    ===================================================================
    --- dist/game/data/scripts/custom/LevelUpReward/LevelUpReward.java      (revision 0)
    +++ dist/game/data/scripts/custom/LevelUpReward/LevelUpReward.java      (working copy)
    @@ -0,0 +1,186 @@
    +/*
    + * Copyright (C) 2004-2014 L2J DataPack
    + *
    + * This file is part of L2J DataPack.
    + *
    + * L2J DataPack 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.
    + *
    + * L2J DataPack 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 custom.LevelUpReward;
    +
    +import java.util.ArrayList;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.w3c.dom.Node;
    +
    +import com.l2jserver.gameserver.engines.DocumentParser;
    +import com.l2jserver.gameserver.model.PlayerVariables;
    +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
    +import com.l2jserver.gameserver.model.holders.ItemHolder;
    +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
    +import com.l2jserver.gameserver.scripting.scriptengine.events.PlayerLevelChangeEvent;
    +import com.l2jserver.gameserver.scripting.scriptengine.impl.L2Script;
    +
    +/**
    + * This is a simple custom mod which allows you to give players some items when they level up.<br>
    + * Note: rewardAll attribute if set to true means if player is level 50 and has not yet recieved reward for level 45 he will recieve it.<br
    + * If rewardAll is set to false and new reward was added for level 45 and he is level 50 he will not recieve it.
    + * @author xban1x
    + */
    +public final class LevelUpReward extends L2Script
    +{
    +       // Misc
    +       private static final String HTML_PATH = "data/scripts/custom/LevelUpReward/";
    +       protected static boolean rewardAll = false;
    +       protected static final Map<Integer, LevelData> REWARDS = new HashMap<>();
    +      
    +       private LevelUpReward(String name, String descr)
    +       {
    +               super(name, descr);
    +               addPlayerLevelNotify(null);
    +               new LevelUpRewardData();
    +       }
    +      
    +       @Override
    +       public void onPlayerLevelChange(PlayerLevelChangeEvent event)
    +       {
    +               final L2PcInstance player = event.getPlayer();
    +               if (player == null)
    +               {
    +                       return;
    +               }
    +               final int newLevel = event.getNewLevel();
    +               for (int oldLevel = (rewardAll) ? 1 : (event.getOldLevel() + 1); oldLevel <= newLevel; oldLevel++)
    +               {
    +                       if (!REWARDS.containsKey(oldLevel))
    +                       {
    +                               continue;
    +                       }
    +                       final PlayerVariables vars = player.getVariables();
    +                       if (vars.getBool("LEVEL_UP_REWARD_" + oldLevel, false))
    +                       {
    +                               continue;
    +                       }
    +                       final LevelData rewards = REWARDS.get(oldLevel);
    +                       for (ItemHolder item : rewards.getItems())
    +                       {
    +                               player.addItem("Quest", item, player, true);
    +                       }
    +                       vars.set("LEVEL_UP_REWARD_" + oldLevel, true);
    +                       if (rewards.getMessage() != "")
    +                       {
    +                               player.sendMessage(rewards.getMessage());
    +                       }
    +                       if (rewards.getHtmlFile() != "")
    +                       {
    +                               final NpcHtmlMessage html = new NpcHtmlMessage(player.getObjectId());
    +                               html.setFile(player.getHtmlPrefix(), HTML_PATH + rewards.getHtmlFile());
    +                               player.sendPacket(html);
    +                       }
    +               }
    +       }
    +      
    +       protected final class LevelUpRewardData extends DocumentParser
    +       {
    +               public LevelUpRewardData()
    +               {
    +                       load();
    +               }
    +              
    +               @Override
    +               public void load()
    +               {
    +                       parseDatapackFile(HTML_PATH + "rewards.xml");
    +               }
    +              
    +               @Override
    +               protected void parseDocument()
    +               {
    +                       for (Node n = getCurrentDocument().getFirstChild(); n != null; n = n.getNextSibling())
    +                       {
    +                               if ("list".equals(n.getNodeName()))
    +                               {
    +                                       for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
    +                                       {
    +                                               if ("rewards".equals(d.getNodeName()))
    +                                               {
    +                                                       LevelData data = new LevelData();
    +                                                       for (Node e = d.getFirstChild(); e != null; e = e.getNextSibling())
    +                                                       {
    +                                                               if ("item".equals(e.getNodeName()))
    +                                                               {
    +                                                                       data.addItem(parseInteger(e.getAttributes(), "id"), parseLong(e.getAttributes(), "count"));
    +                                                               }
    +                                                       }
    +                                                       data.setMessage(parseString(d.getAttributes(), "message"));
    +                                                       data.setHtmlFile(parseString(d.getAttributes(), "htmlFile"));
    +                                                       REWARDS.put(parseInteger(d.getAttributes(), "level"), data);
    +                                               }
    +                                       }
    +                                       rewardAll = parseBoolean(n.getAttributes(), "rewardAll");
    +                               }
    +                       }
    +               }
    +       }
    +      
    +       protected final class LevelData
    +       {
    +               private String html;
    +               private final List<ItemHolder> items;
    +               private String message;
    +              
    +               public LevelData()
    +               {
    +                       html = "";
    +                       items = new ArrayList<>();
    +                       message = "";
    +               }
    +              
    +               public void addItem(int itemId, long itemCount)
    +               {
    +                       items.add(new ItemHolder(itemId, itemCount));
    +               }
    +              
    +               public void setHtmlFile(String htmlFile)
    +               {
    +                       html = htmlFile;
    +               }
    +              
    +               public void setMessage(String message)
    +               {
    +                       this.message = message;
    +               }
    +              
    +               public String getHtmlFile()
    +               {
    +                       return html;
    +               }
    +              
    +               public List<ItemHolder> getItems()
    +               {
    +                       return items;
    +               }
    +              
    +               public String getMessage()
    +               {
    +                       return message;
    +               }
    +       }
    +      
    +       public static void main(String[] args)
    +       {
    +               new LevelUpReward(LevelUpReward.class.getSimpleName(), "custom");
    +       }
    +}
    Index: dist/game/data/scripts.cfg
    ===================================================================
    --- dist/game/data/scripts.cfg  (revision 9774)
    +++ dist/game/data/scripts.cfg  (working copy)
    @@ -755,6 +755,7 @@
     quests/Q10505_JewelOfValakas/Q10505_JewelOfValakas.java
     
     # Custom
    +custom/LevelUpReward/LevelUpReward.java
     custom/Nottingale/Nottingale.java
     custom/EchoCrystals/EchoCrystals.java
     custom/ShadowWeapons/ShadowWeapons.java
    Index: dist/game/data/scripts/custom/LevelUpReward/rewards.xml
    ===================================================================
    --- dist/game/data/scripts/custom/LevelUpReward/rewards.xml     (revision 0)
    +++ dist/game/data/scripts/custom/LevelUpReward/rewards.xml     (working copy)
    @@ -0,0 +1,12 @@
    +<?xml version="1.0" encoding="UTF-8"?>
    +<list rewardAll="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="rewards.xsd" >
    +       <rewards level="5" htmlFile="Reward_5.html">
    +               <item id="1060" count="1" />
    +       </rewards>
    +       <rewards level="10" message="Congratulations for level up">
    +               <item id="57" count="10000" />
    +       </rewards>
    +       <rewards level="15" message="Congratulations for level up">
    +               <item id="57" count="10000" />
    +       </rewards>
    +       <rewards level="20" message="Congratulations for level up">
    +               <item id="57" count="10000" />
    +       </rewards>
    +</list>
    \ No newline at end of file
    Index: dist/game/data/scripts/custom/LevelUpReward/Reward_5.html
    ===================================================================
    --- dist/game/data/scripts/custom/LevelUpReward/Reward_5.html   (revision 0)
    +++ dist/game/data/scripts/custom/LevelUpReward/Reward_5.html   (working copy)
    @@ -0,0 +1,4 @@
    +<html><body>
    +Congratulations, you have gained another level!
    +Check your inventory you will see some interesting rewards!
    +</body></html>
    \ No newline at end of file


Credits - xban1x main author

Edited by Extreamer
Posted

If we don't share, people say the forum is dead blah blah, If we do share then people are like, why are you sharing so much.

 

I don't get it.

He means that the community is growning because everyone is sharing.

Posted

If we don't share, people say the forum is dead blah blah, If we do share then people are like, why are you sharing so much.

 

I don't get it.

share but share wisely sharing useless craps is like not sharing something at all

Posted

share but share wisely sharing useless craps is like not sharing something at all

 

Well I thought that the code is decent enough to be shared.

 

In that case sorry I misunderstood your point viral, all because of the smiley haha.

 

The code itself is not hard to add , and its really easy to manipulate it. Of course I am not going to share 2 liners, 1 liners and what not.

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

    • ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ L2DEVS — Premium L2OFF Extender for Lineage 2 Interlude 100+ Systems | Production Ready | 6+ Years Live Tested https://l2devs.com ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ L2Devs is a premium L2OFF extender built from years of real server experience. It extends the original Interlude core with 100+ configurable systems — PvP mechanics, event engines, economy control, anti-bot protection — without touching the original server source code. Every system is designed for real production: high concurrency, crash-safe routines, reduced DB load, deep configurability through external config files. No bloat. No experimental features. Only what actually works on live servers. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔥 WHAT'S NEW — 2026 RELEASE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [NEW] Character Marketplace — Full in-game character trading. List, browse and buy characters directly from the server. Admin controls, price limits and anti-abuse validation included. [NEW] Auto Farm System — 100% functional in-game auto farm with configurable zones, skill usage and item pickup. Fully operator-controlled. [NEW] .bonus Command — Real-time bonus status viewer. Players check active rates, buffs and event bonuses at any moment with a single command. [NEW] Last Man Standing (LMS) — New event mode, last player standing wins. Configurable teams, areas and rewards. [NEW] Kill The Boss (KTB) — Team-based event, eliminate the raid boss. Full config: spawn, rewards and team balance. [NEW] Fake Hero System — Award hero status visually without affecting rankings. Configurable duration and effects. [NEW] Visual Weapons & Armor — Display alternate skins client-side without impacting actual stats. [IMPROVED] Anti-Bot Captcha v4 — Completely rebuilt from scratch. Smarter, lighter, harder to bypass. [IMPROVED] Advanced Balance System — Per-class, per-skill and per-scenario control. Fine-tune damage and healing for any situation. [FIXED] Nick Change Service — Completely reworked. Validation, history logging, edge-case fixes. Production-ready. [REWORKED] PvP Auto Announce — Rebuilt for kills, streaks and milestones. Fully configurable messages and thresholds. [REWORKED] Happy Hour Event — Flexible scheduling, rate multipliers, configurable announces. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚙️ GENERAL SYSTEMS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Cached Extended IOBuffer (8192kb) - Offline Shops & Buffers (restore after restart with fixed location) - Offline Buffer System - ALT+B Augmentation House - Shift+Click Drop/Spoil List - Auto Learn Skills - Scheme Buffer - Global Trade Chat - Global Vote Reward System (Hopzone, Topzone, custom) - Achievements System - Custom Subclass (Accumulative stats) - Change Name / Title Color - Change Gender / Race (Skin) - VIP System (chat, autoloot, extended features) - .menu Command (fully configurable) - Pet Sales via Multisell - Item Bid Auctioner for Clan Halls - Show Mob Level / NPC Clan Flag - Spawn Protection System - Min Level Trade - Use Any Dyes - No Drop on Death (configurable) - Auto Potion System (by Item ID, HP/MP %, reuse delay) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚔️ PVP & OLYMPIAD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - PvP Auto Announce System (rebuilt) - PvP / PK / War Reward - Epic Items Rank - Raid Boss Points Rank - Global PvP Rankings - Anti Abuse Validations - Olympiad Season Rank Pages - Restore Stats on Fight Start - Olympiad Second Time System - Last 10 Minutes Entry - Third Class Summons Control - Castle Announce & Standby Time - Champion System with Rewards - Damage Cap System - Item % Steal by Zone - Last Hit Announce (Raid/Boss) - Disable SSQ after Castle Siege ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎯 EVENT ENGINE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Team vs Team (TvT) - Capture The Flag (CTF) - Death Match (DM) - Last Man Standing (LMS) — NEW - Kill The Boss (KTB) — NEW - Destroy The Base (DTB) - Korean Style Events - Castle Siege Events - Happy Hour Event (reworked) - Win/Loss Rewards - Custom Team Titles & Colors - Kill Counter in Title - Firework Effects - Reset Buffs on Finish - Balance Bishops - Disconnect Recovery - Open Door / Wall System - AFK Time Control ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 💎 DROPS, ENCHANT & ITEMS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Fully Configurable Drop System (min/max level, all mobs, RBs, individual) - Armor Enchant Bonus System (+7/+8/+9 extra bonuses) - Enchant Stats System (full control per enchant level) - Blessed Enchant Rates (armor & weapons) - Enchant Restrictions & Protections - Spellbook Drop Enable/Disable - Custom Cancel Effects (min/max configurable) - Raid Boss HP % Announce - No Sell / No Private Buy Items ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔒 SECURITY & PERFORMANCE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - Anti-Bot & Captcha v4 (2026) — rebuilt from scratch - Anti-Exploit & Anti-Abuse (multi-layer) - Safe Enchant & Item Handling - Crash-Safe Routines - Optimized Thread Usage - Reduced Database Load - Improved Packet Handling - High Concurrency Design (tested 2000+ connections) - Tested on Live Servers 6+ Years ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔄 HOT RELOAD — NO RESTART NEEDED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ EnterWorld HTML | Donate Shop | Offline Buffer | Champion NPC | AntiBot | VIP System | Auction System | AutoLoot | Castle Siege Manager | Character Lock | Clan PvP Status | Auto Learn | Skill Data | Door Data | Deco Data | Multisell / Drop List | Custom Config Files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 💰 PRICING — LAUNCH OFFER ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔥 FULL PACK — $299 USD only cryptos (regular price $450 — save 33%)    + $30 USD/month (updates & support) Includes: ✔ Compiled extender (L2OFF Interlude) ✔ Full configuration files ✔ All 100+ systems active ✔ Client dashboard access ✔ IP change at no extra cost ✔ Monthly updates & improvements ✔ Priority support via Discord/Telegram ✔ Tested on live servers 6+ years   SOURCE CODE — $1499 USD only cryptos   ⚠️ Launch offer is limited time. Price returns to $450 after offer ends. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📬 CONTACT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Website: https://l2devs.com Discord & Telegram: available on the website Questions? Open a ticket or contact us on Discord. We respond fast. L2Devs — Built for servers that take quality seriously. Unique features, everything else is just a copy. Regards. The H5 and Classic versions will be available very soon!
    • “ONE FACE — AND THE WHOLE KYC FAILS.” ▪ Sometimes the task looks simple, but in reality everything comes down to the details. ▪ A client recently wrote to us. He needed a **North Carolina DL** to pass live verification on Sumsub. He already had the source file — all that was required was to carefully **replace the face in the photo**, without touching any other data. ▪ At first glance — a routine edit. But there’s a catch: such documents are often checked **via photo upload + live verification**. ▪  That’s why it’s critical not just to insert a new face, but to preserve: — texture and grain of the original photograph — lighting of the card — geometry / perspective of the photo inside the document — overall image balance ▪ Even the smallest mismatch can give away the edit. ▪ We prepared a clean version of the document, the client used it for his verification — and **it passed successfully**. ▪ Sometimes it’s not the complexity of the document that matters, but **how precisely the photo inside it is handled**. ▪ ️ If you have a similar task — write to us in private messages and briefly describe the situation. We’ll advise what can be done and which options will work best. *All data is presented with the client’s consent.* › TG: https://t.me/mustang_service ( https:// t.me/ mustang_service ) › Channel: https://t.me/+JPpJCETg-xM1NjNl ( https:// t.me/ +JPpJCETg-xM1NjNl ) #case #documents #verification #edit #kyc
    • why? why would you help him in private? tomorrow someone else will have the same request, are you going to help them all in private, instead of sharing obvious info publicly? 1. 'Lucera' - yes, they have what you described, but you would have to pay for that. 2. 'a lot of classic chronicles...' - also right, the only difference is kamaels and more features in higher version, but that's not a clean interlude, you would have to implement/remove a lot of things. there's actually no 'ready to use' free option (clean interlude but classic) and most people are going to try to sell you some garbage. so what can you do? try classic version before 3.0, you can take mobius files to test everything - maybe you like it as it is and no additional changes would be required, but if you not - the only way is you would have to implement what is missing and remove what is additional.
    • this is the first time i hear that anyone struggles with something that works correctly... your "solution" is basically a bug. and you forgot the most important thing: if you do something like that - which is changing right behaviour with wrong - it must be possible to turn it on/off
  • 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..