• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Nexon-like stat item randomisation

Junior Spellweaver
Joined
Aug 13, 2009
Messages
124
Reaction score
123
This is a very small change, however I'm surprised that no one seems to have done this after more than a decade post odinms & titanms.
If you've played maplestory long enough, and hunting for equipment back in the pre-bb days, you'll know this. Most of the newer players just dont care anymore, since equipments are so common post-bb.
Scarcity creates value and a purpose of hunting.

Item stats dont distribute in a completely even way in the official maplestory server, it is much closer to a bell curve distribution (aka normal distribution).
LastBattle - Nexon-like stat item randomisation - RaGEZONE Forums


Red Craven [claw] for example with a base stat of 45 as specified in WZ will usually range between 38-52. Getting an attack of 38/52 will only have less than 1% of probability.
all of odin's source currently have the exact same probability of stats between 38-52.

Code:
/**
     * Gets the random gaussian distribution stats of equipment 
     * https://www.javamex.com/tutorials/random_numbers/gaussian_distribution_2.shtml
     * 
     *         [USER=2000183830]para[/USER]m defaultValue
     *         [USER=2000183830]para[/USER]m maxRange
     *         [USER=850422]return[/USER] 
     */
    private static short getRandomGaussianDistributionStatForEquipment(short defaultValue, int maxRange) {
        if (defaultValue == 0) {
            return 0;
        }
        Random r = new Random();
        
        // Vary no more than ceil of 10% of the original stat
        int iMaxRange = (int) Math.min(Math.ceil(defaultValue * 0.1), maxRange);

        final int gaussianDistributionCenter;
        if (defaultValue < 20) {
            // Allow more higher variation of stats if the default value is below 20. 
            gaussianDistributionCenter = iMaxRange;
        } else {
            gaussianDistributionCenter = iMaxRange / 2;
        }
        
        short value = (short) (Math.floor(r.nextGaussian() * gaussianDistributionCenter) + defaultValue); // 70% of the stats will fall within the mean range 
        
        /* Sample output result: Base stat of 45 attack.
        37: 1
        38: 8
        39: 18
        40: 81
        41: 216
        42: 462
        43: 790
        44: 959
        45: 944
        46: 714
        47: 466
        48: 243
        49: 70
        50: 21
        51: 4
        52: 
        3*/
        
        return value;
}

have fun. I never thought of giving this out for a while, but since seeing how detail orientated Yuuroido is, this might be something you are interested .
 
Last edited:
Newbie Spellweaver
Joined
Mar 25, 2016
Messages
86
Reaction score
26
Looks like OrionAlpha beat you.

Only thing missing from OrionAlpha is gachapon handling.
 
Interesting...
Loyal Member
Joined
Oct 25, 2008
Messages
1,372
Reaction score
604


Why would you use a switch statement, then let both Better and Great fall through to the default section, THEN check what the option value is before potentially breaking? The whole point of a switch statement is that you can have this code run in the proper section, and then break if needed, or allow it to fall through if not. Why do it this way?

Edit: idk why I even asked, the answer is going to be "because nexon does it this way"
 
Newbie Spellweaver
Joined
Mar 25, 2016
Messages
86
Reaction score
26


Why would you use a switch statement, then let both Better and Great fall through to the default section, THEN check what the option value is before potentially breaking? The whole point of a switch statement is that you can have this code run in the proper section, and then break if needed, or allow it to fall through if not. Why do it this way?

Edit: idk why I even asked, the answer is going to be "because nexon does it this way"
Dam this poop also returns an Integer. This method is wild and I just ignored it
 
Skilled Illusionist
Joined
Feb 18, 2010
Messages
320
Reaction score
112
Wow, such a simple solution that I hadn't even realized was out there! Thanks!
I'm definitely implementing something like this is my server.
 
Back
Top