Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

I cant figure this out. Multi Level Source Dev v116

Newbie Spellweaver
Joined
Aug 12, 2012
Messages
11
Reaction score
0
I Know this has to do something with adding a 'While' Statment But im just not catching on correctly :junglejane:

I need to add in "Multi Leveling" for my server. Anyone Got a clue?

My GainEXP Method in MapleCharacter
Code:
 public void gainExp(final int total, final boolean show, final boolean inChat, final boolean white) {
        try {
            int prevexp = getExp();
            int needed = getNeededExp();
            if (total > 0) {
                stats.checkEquipLevels(this, total); //gms like
            }
            if ((level >= 200 || (GameConstants.isKOC(job) && level >= 200)) && !isIntern()) {
                setExp(0);
                //if (exp + total > needed) {
                //    setExp(needed);
                //} else {
                //    exp += total;
                //}
            } else {
                boolean leveled = false;
                long tot = exp + total;
                if (tot >= needed) {
                    exp += total;
                    levelUp();
                    leveled = true;
                    if ((level >= 200 || (GameConstants.isKOC(job) && level >= 200)) && !isIntern()) {
                        setExp(0);
                    } else {
                        needed = getNeededExp();
                        if (exp >= needed) {
                            setExp(needed - 1);
                        }
                    }
                } else {
                    exp += total;
                }
                if (total > 0) {
                    familyRep(prevexp, needed, leveled);
                }
            }
            if (total != 0) {
                if (exp < 0) { // After adding, and negative
                    if (total > 0) {
                        setExp(needed);
                    } else if (total < 0) {
                        setExp(0);
                    }
                }
                updateSingleStat(MapleStat.EXP, getExp());
                if (show) { // still show the expgain even if it's not there
                    client.getSession().write(InfoPacket.GainEXP_Others(total, inChat, white));
                }
            }
        } catch (Exception e) {
            FileoutputUtil.outputFileError(FileoutputUtil.ScriptEx_Log, e); //all jobs throw errors :(
        }
    }
 
Newbie Spellweaver
Joined
Feb 8, 2013
Messages
19
Reaction score
5
I'm pretty sure it was released somewhere.. Oh wait it was here it is...
Go into MapleCharacter.java and replace you're gainEXP method with this.

PHP:
public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
       int equip = (gain / 10) * pendantExp;
        int total = gain + equip;
        int needed = GameConstants.getExpNeededForLevel(level);
        if ((level >= 200 || (GameConstants.isCygnus(getJob().getId()) && level >= 120))) {
            setExp(0);
        } else {
            long tot = exp.get() + total;
            if (tot >= needed) {
                exp.addAndGet(total);
                levelUp();
                if ((level >= 200 || (GameConstants.isCygnus(getJob().getId()) && level >= 120))) {
                    setExp(0);
                } else {
                    needed = GameConstants.getExpNeededForLevel(level);
                    if (exp.get() >= needed) {
                if (gmLevel >= 0 && ServerConstants.MULTI_LEVEL) {
                while (exp.get() >= GameConstants.getExpNeededForLevel(level)) {
                    levelUp();
                }  }
                        setExp(needed - 1);
                    }
                }
            } else {
                exp.addAndGet(total);
            }
            updateSingleStat(MapleStat.EXP, exp.get());
        }
        if (show && gain != 0) {
            announce(MaplePacketCreator.getShowExpGain(gain, equip, inChat, white));
        }

    }


And add this into you're ServerConstants.java

PHP:
//MULTI-LEVEL

    public static final boolean MULTI_LEVEL = true;


It was released by "lordpeter" for ChickenMS Source but since ChickenMS is "Lithium Based" it should also work for SourceDEV which is also "Lithium Based" or well really "TetraSEA" based. Anyways I remember searching for this and it works for me so it should work for you aswell. But next time don't open a "Help" thread when you can easily search up you're problem with the "Search" button..
 
Upvote 0
Newbie Spellweaver
Joined
Aug 12, 2012
Messages
11
Reaction score
0
Well When i tried this it did not work for my server thats why i posted a help thread. let me try this again :) Thank you


EDIT:

IT just gives me a booty load of errors tat cant be fixed with the light bulb thing or common sense
Capture.JPG - I cant figure this out. Multi Level Source Dev v116 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Have Fun!
Joined
Nov 2, 2008
Messages
481
Reaction score
70
ChickenMS is actually Moople based, not lithium. So it may not be compatible.

-Sent from my mobile-
 
Upvote 0
Back
Top