Jump to content

Recommended Posts

Posted (edited)

As title says, mines event generating box's each box has chance when u click on it if it's a coin u win if it's a torch u lose.

I didnt include the .mines command handler (aka chat handler) to the share most of u have ur own.

 

Requirements: Your own chat handler + menu handlers <-- i made a share for that.

If u use my menu handler add this to UsermenuHandler.java

else if(command.startsWith("_menuMinesSelect")){
			MinesEventHandler.getInstance().parseCmd(command, activeChar);
		}

Overview 1

Overview 2

Overview 3

Overview 4

 

MinesEventHandler.java

Mines.java

MinesEvent.java

MinesManager.java

minesMW.html

 

pastebin pass : maxcheaters

Edited by LordPanic
Posted (edited)

First of all an offtopic reply:

You did remind me the base version of my coupon manager 🤪

 

 

 

Now, lets focus on your idea.

 

Not bad at all, something new/fresh that in my pov, can be used and run with a simple npc that would ask for a price to play a new round. 

I'm also expecting a better reward when i got 2/3 or 3/3 success hits. The reward can simply be multiplied in that case (if the id,qnt have to be constants).

 

Now lets focus on your code.

You have to care about your bypasses. There are missing important checks for numerous suspicion actions.

The code inside of your if statement if(command.startsWith("_menuMinesSelect")){ ... } does not have any protection and it can be easily bypassed and request full rewards with a 50% chance at all. The reward action should be handled when the 'change icon' action take place. Atm, you have 2 different cases while the imporant one is located at the bypass that i mentioned. As it is now, it looks like that you can succeed the box without reward but also, the opossite.

 

You did care about the ConcurrentException inside of MinesManager but you didnt at the MinesEvent (which is created with an arraylist)

 

You have to debug your code for any possible mistake that you 'forgot' to fix up on the creation state. For example, something is wrong here:

 

case 0:
	Broadcast.announceToOnlinePlayers("[EVENT] ~ [Mines] Registrations closed.", true);

	if(MinesEvent.getInstance().getTotalPlayers() < 1) {
		Broadcast.announceToOnlinePlayers("[EVENT] ~ [Mines] Cancelled due to luck of participants.", true);
	}else {
		MinesEvent.getInstance().start();
	}
	setStarted(false);
	break;

 

You checking the total players count to decide if you have to start the event or abandon it but just after your decision, there is:

 

 setStarted(false);

 

Not a big deal at all but i think you got my point. I'm not seeing somewhere this boolean how and when is taking place but probably, is on the file you are not posting.

 

isStarted()

 

 

Generally, take care about naming policy (with proper lower/upper case and all), delete useless lines 

if(command.startsWith("_menuMinesSelect")){
            String selected = ""; // Where this variable is taking place?
            String cmdContent = st.nextToken(); // Where also this variable taking place?
            int position = Integer.valueOf(st.nextToken());
            int chance = Integer.valueOf(st.nextToken());
            Mines newMine =  MinesManager.getInstance().getMine(activeChar.getObjectId());
 
            if(chance > 50)
                newMine.soloRewards(activeChar);
 
            newMine.selectedBox(position);
            newMine.minesWindow(activeChar);

 

Read the java 8 features and get into stream . The addition of the Stream was one of the major features added to Java 8. Don't miss it.

 

For example, this code:

    public class MineBox{
        public int position;
        public int chance;
        public boolean selected;
        public String content;
    }
 
    public void feedList(){
        for(int i=0; i < 30; i++){
            MineBox bx = new MineBox();
            bx.position = i;
            bx.chance = Rnd.get(100);
            bx.selected = false;
            _boxs.add(bx);
        }
    }

 

Can be improved to this one:

 

public class MineBox
{
	public final int position;
	public final int chance = Rnd.get(100);
	public boolean selected = false;
	public String content;
	
	public MineBox(int pos) 
	{
		position = pos;
		_boxs.add(this);
	}
}

public final void feedList()
{
	IntStream.of(30).forEach(MineBox::new);
}

 

The only real problem impacting the stability is the ConcurrentException. Use ConcurrentHashMap.newKeySet() to handle it properly. All the other changes are about readability, performance and optimization.

 

I like you and i admire your effort. Keep sharing :yeih:

Edited by melron
Posted (edited)

@melronThanks a lot for ur usefull tips ! I fixed most of the things u mentioned. I also added a win streak condition on soloRewards method it's up to u guys to add different rewards depending on the win streak 😄

 

About the setStarted,isStarted i use them on my chat handler to avoid ppl registering while event is running or not open for registrations.

 

Edit: Since i made a few changes for the multiplier, check the updated versions of Mines.java and MinesEvent.java:

Bonus Multiplier vid

Edited by LordPanic
Posted (edited)
 
Modification if you 
want to edit item by properties.
Config.java


+	public static int MINA_REWARD_ID;
+	public static int MINA_REWARD_COUNT;
	
+   MINA_REWARD_ID = players.parseIntIntList("MinaReward", "57");
+   MINA_REWARD_COUNT = players.getProperty("RewardCount", 500000);



+# Minas Event Custom reward
+MinaReward = 57
+RewardCount = 50000



net.sf.l2j.gameserver.util.Broadcast;
+ net.sf.l2j.Config;

     original 
	 
    //add the item to give for reward
    private final static int _rewardItemID = 0;
    //add the quantity of reward items
    private final static int _itemQuantity = 0;
	
	modificada 
	
    //add the item to give for reward
-	private final static int _rewardItemID = 0;
+   private final static int _rewardItemID = {Config.CHANGESEX_COIN_ID};
    //add the quantity of reward items
-   private final static int _itemQuantity = 0;
+   private final static int _itemQuantity = {Config.CHANGESEX_COIN_ID};

 

Edited by LucasDesigner

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

    • Very nice and passionate effort. Good luck.
    • SX.ORG is a global proxy platform offering residential, mobile and datacenter IPs for SEO, web scraping, ad verification and multi-account management. It provides flexible IP rotation, precise geo-targeting, HTTP(S)/SOCKS5 support, API access and pay-as-you-go pricing based only on the traffic you use.
    • L2-IMBA — SEASON 2  Custom PvP / PvE Interlude · Every Class Playable BETA — LIVE NOW GRAND START — 11 September 2026, 20:00 GMT+2 https://l2-imba.com · https://discord.com/invite/jmhVpj8ySv ═══════════════════════════════════════ RATES & CORE SETTINGS ═══════════════════════════════════════ Chronicle — Interlude XP / SP — x45, level-adjusted curve Adena — x1 Max level — 90 Subclass — 1, to level 80 Starting hub — Giran Skills — Auto-learn, post-80 via custom trainers Loot — Auto-loot with low-value filtering Buffs — Extended duration, expanded slots, saved schemes Client limit — NO DUAL-BOXING, one client per player Automation — Built-in auto-farm with daily time limit Offline — Trading and crafting enabled Current beta configuration. Final values confirmed at launch sign-off. ═══════════════════════════════════════ All 31 third classes are developed to level 90 through five specialized trainers — there are no dead classes here. Tanks, daggers, archers, warriors, summoners, healers, buffers and crafters all have real post-80 progression and a role worth playing. Full PvE progression through ten farm zones, thirty-five themed encounters and eighteen tracked raids, feeding into gear-equalized Team vs Team and open-world PvP. This isn't a stat patch with a new name. L2-IMBA keeps the combat, classes and world of Interlude and builds a new endgame on top of it — new equipment branches, custom class development past level 80, purpose-built farm ecosystems, boss progression, crafting, and augmentation, all connected into one progression loop. Level and develop your class → choose an armor identity → clear themed farm content → collect materials and boss resources → craft and upgrade without abandoning your build → compete in equalized and open-world PvP → reach God's equipment. ═══════════════════════════════════════ ROLE MASTERY ARMOR ═══════════════════════════════════════ Starting at Dynasty, armor becomes a real build choice instead of a mandatory set everyone wears. Each armor type offers three role masteries plus a flexible Universal path — twelve paths per tier, sixty full-set configurations across the progression. The chest piece selects your mastery; a matching five-piece set activates it. HEAVY   Juggernaut — frontline wall, shield synergy, reflection   Spellbreaker — anti-magic fortress, spell disruption   Slayer — heavy armor turned offensive, vampiric sustain LIGHT   Bowmaster — ranged pressure, kiting, accuracy   Assassin — positional burst, blow reliability, dagger lethals   Berserker — high-risk carry, power rises as HP falls ROBE   Arcanist — rapid-fire critical casting   Invoker — high-impact nuking and debuffs   Oracle — dedicated healing and support Upgrade recipes preserve your chosen path through every tier: Dynasty → Zariche → Valakas → Cursed → God's The system is gear-driven, not class-locked. Build creatively. ═══════════════════════════════════════ LEVEL 90 CLASS DEVELOPMENT ═══════════════════════════════════════ Max level extended to 90. Five specialized trainers — Archer, Tank, Rogue, Warrior, Mystic — cover all 31 third classes in post-80 progression, with 470+ learning entries. Every race gets a custom passive from level one. Tanks get distinct Human/Elf/Dark Elf identities. Duelist gains a two-handed greatsword path. Fortune Seeker becomes a real fighter without losing its spoil identity. Maestro gets a durable frontline route. Summoners, cubics and servitors get deeper combat logic rather than stat scaling. This is backed by server-side combat work — dedicated handling for debuff proficiency, PvE skill damage, blows, lethals, bow reuse, vampirism and reflection. ═══════════════════════════════════════ THE FARMING WORLD ═══════════════════════════════════════ Ten dedicated farm destinations via Global Gatekeeper: Farm Coins 1 & 2, Holy, Fire/Water, Wind, Earth, Unholy, Golden, Chaotic and Night zones. Seven themed enemy families — Undead, Demon, Angel, Beast, Bug, Water, Fire — each with four stages and a mini-boss. Thirty-five distinct encounters, each with its own resource identity feeding crafting. Eighteen tracked raids — twelve Farm Raid Bosses and six Custom Epic Raid Bosses. Plus a scheduled group-based Party Zone with dynamically managed normal and rare spawns. ═══════════════════════════════════════ CRAFTING & ENDGAME ═══════════════════════════════════════ SOUL FORGE — recycle old weapons into tier resources, convert boss and farm materials, craft Legendary components. Old gear becomes input, not warehouse clutter. CURATED AUGMENTATION — data-driven Top-Grade and Legendary profiles with meaningful stat, active and passive pools. Active effects are categorized so the same effect can't be stacked through equipment swapping. EXTENDED ENCHANT — Custom Crystal and Legendary stages. On the Legendary route, a failed enchant does not destroy the item or reduce its enchant level. Long-term progression, not an all-or-nothing gamble. TREASURE CHESTS — Rare, Immortal, Epic and Legendary tiers feeding gear growth, crafting and augmentation. ═══════════════════════════════════════ PvP ═══════════════════════════════════════ Gear-equalized Team vs Team on a recurring schedule — your equipment is snapshotted and restored, so the fight is about play, not who farmed longest. Open-world PvP with rewards and ranks alongside it. ═══════════════════════════════════════ QUALITY OF LIFE ═══════════════════════════════════════ - No dual-boxing — one client per player, enforced - Built-in auto-farm with a daily time limit — no third-party software needed, and third-party automation is bannable - Auto-learn skills, auto-loot with low-value drop filtering - Extended-duration buffs, expanded slots, saved schemes - Offline trading and crafting - Global Gatekeeper, global class change - Offline combat automation disabled ═══════════════════════════════════════ BY THE NUMBERS ═══════════════════════════════════════ 380+ custom item definitions · 110+ weapons and shields · 210+ armor and wearables · 250+ custom skill definitions · 2,700+ custom monster placements · 90+ shop and exchange catalogs · 1,100+ offers ═══════════════════════════════════════ BETA ═══════════════════════════════════════ Core systems, progression identities and content routes are in place. Exact item bonuses, mastery values, skill strength, reuse times, augment pools, enchant chances, drop rates and crafting costs remain subject to testing. Beta changes will refine balance without removing the defining role of each mastery or the overall progression structure. All beta characters are wiped at full launch. Beta testers keep their rewards. ═══════════════════════════════════════ OPEN BETA — 4 SEPTEMBER 2026 · 18:00 GMT+2 Website: https://l2-imba.com Wiki: https://l2-imba.com/wiki Register: https://l2-imba.com/account Download: https://l2-imba.com/start-playing Discord:  https://discord.com/invite/jmhVpj8ySv
    • 🛡️ 100% Safe on your personal Gmail. Zero VPN required and works globally. Grab yours directly on klouditem.com!
  • 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..