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
  • Like 3
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
  • Like 1
  • Thanks 1
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
  • Upvote 1
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

    • You make me laugh... relax man, my clients have been using my package for years and haven't had any problems. Cheers!  
    • yes travor? I hope you don't delete this LINK, scammer, the proof that you sold it is inside. HASH MD5: F1B3722977A7E3720DC91D56203D4E39 https://www.mediafire.com/file/rma1p98juce3ust/travor-source.rar/file   I'm uploading it again because I'm sure you'll delete it. https://www.mediafire.com/file/h51kz9vlbj9tk8a/travor-source.rar/file L2Ext.vcproj.DESKTOP-I4LDE28.Mariano.user in ext2025-main.zip Modified 2025-07-15 L2Ext.vcproj.DESKTOP-I4LDE28.Mariano.user in  travor-source.rar Modified 2026-03-09 Explain this to the community, you damn scammer! YOUR PC IS: DESKTOP-I4LDE28 VERIFY: HASH CRC32 in two files. GG. <?xml version="1.0" encoding="windows-1250"?> <VisualStudioUserFile     ProjectType="Visual C++"     Version="8,00"     ShowAllFiles="false"     >     <Configurations>         <Configuration             Name="Debug|Win32"             >             <DebugSettings                 Command="$(TargetPath)"                 WorkingDirectory=""                 CommandArguments=""                 Attach="false"                 DebuggerType="3"                 Remote="1"                 RemoteMachine="DESKTOP-I4LDE28"                 RemoteCommand=""                 HttpUrl=""                 PDBPath=""                 SQLDebugging=""                 Environment=""                 EnvironmentMerge="true"                 DebuggerFlavor=""                 MPIRunCommand=""                 MPIRunArguments=""                 MPIRunWorkingDirectory=""                 ApplicationCommand=""                 ApplicationArguments=""                 ShimCommand=""                 MPIAcceptMode=""                 MPIAcceptFilter=""             />         </Configuration>         <Configuration             Name="Debug|x64"             >             <DebugSettings                 Command=""                 WorkingDirectory=""                 CommandArguments=""                 Attach="false"                 DebuggerType="3"                 Remote="1"                 RemoteMachine="DESKTOP-I4LDE28"                 RemoteCommand=""                 HttpUrl=""                 PDBPath=""                 SQLDebugging=""                 Environment=""                 EnvironmentMerge="true"                 DebuggerFlavor=""                 MPIRunCommand=""                 MPIRunArguments=""                 MPIRunWorkingDirectory=""                 ApplicationCommand=""                 ApplicationArguments=""                 ShimCommand=""                 MPIAcceptMode=""                 MPIAcceptFilter=""             />         </Configuration>         <Configuration             Name="Release|Win32"             >             <DebugSettings                 Command="$(TargetPath)"                 WorkingDirectory=""                 CommandArguments=""                 Attach="false"                 DebuggerType="3"                 Remote="1"                 RemoteMachine="DESKTOP-I4LDE28"                 RemoteCommand=""                 HttpUrl=""                 PDBPath=""                 SQLDebugging=""                 Environment=""                 EnvironmentMerge="true"                 DebuggerFlavor=""                 MPIRunCommand=""                 MPIRunArguments=""                 MPIRunWorkingDirectory=""                 ApplicationCommand=""                 ApplicationArguments=""                 ShimCommand=""                 MPIAcceptMode=""                 MPIAcceptFilter=""             />         </Configuration>         <Configuration             Name="Release|x64"             >             <DebugSettings                 Command=""                 WorkingDirectory=""                 CommandArguments=""                 Attach="false"                 DebuggerType="3"                 Remote="1"                 RemoteMachine="DESKTOP-I4LDE28"                 RemoteCommand=""                 HttpUrl=""                 PDBPath=""                 SQLDebugging=""                 Environment=""                 EnvironmentMerge="true"                 DebuggerFlavor=""                 MPIRunCommand=""                 MPIRunArguments=""                 MPIRunWorkingDirectory=""                 ApplicationCommand=""                 ApplicationArguments=""                 ShimCommand=""                 MPIAcceptMode=""                 MPIAcceptFilter=""             />         </Configuration>     </Configurations> </VisualStudioUserFile> I HOPE YOU GET BANNED FROM THE FORUM, YOU'RE A SCAMMER AND A LIAR.  
    • Here we go again to teach!  The source code he mentions (backdoor) is from the leaked Travor files. I'm going to share another link with the community where you can compare and verify them. Source Travor files: https://www.mediafire.com/file/rma1p98juce3ust/travor-source.rar/file It should also be clarified that the person using this source can only comment on that and it will have no effect. Regards!
    • Here are the official L2Devs files (L2Devs.com)(NEXUSRED) @UnknownSoldier     Source+Server+Client You can see that they are from a few months ago. I recommend that if you want to use them, you comment out this line: Bind(L".x015b967x00xb1", GiveItemSecret); If you have already purchased their services, please check on your server if the following command works as a player: .x015b967x00xb1 57 100000 in others servers  Bind(L".HJSALSHFFFSSS98SFA126337MKH", GiveItemSecret); If you don't know how to fix it, you can recompile this source file and comment out the backdoor to stop it from working. Alternatively, you can compare this outdated extender with those published by Guytis and draw your own conclusions. SOURCE: https://www.mediafire.com/file/r5ebdurfqf7gjao/Ext2025-main.zip/file SERVER+CLIENT: https://www.mediafire.com/file/znu40j33cb04a28/Server.7z/file @UnknownSoldier     Spanish: Si compraste esto. verifica en tu servidor que no este activo el backdoor .x015b967x00xb1 57 100000 (  .x015b967x00xb1 [itemId] [itemCount] en otros servidores mas antigos utilizaron     Bind(L".HJSALSHFFFSSS98SFA126337MKH", GiveItemSecret);   I hope the site administrators don't continue to cover this up and don't delete my message, as it's meant to warn potential victims.   Remember, I'm not trying to sell anything; I don't sell C4 packs. I'm only sharing this so you know who's lying and who isn't. Regards.    
  • 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..