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!

Use npc to fix negative exp, no need edit .java

Newbie Spellweaver
Joined
Jul 30, 2008
Messages
16
Reaction score
0
Here is the edited one, thanks to those guy that encourage me. The reason i release it because there is alot of people using repack and dont have @exp command. The formatting of the java script is like this without indent and outdent is that it is hard to set here.

* Changes- Remove the add level and add ap, it set exp to 0 when it is negative.

* Any Kind soul can teach me how to format the script nicely here, as i paste from my netbean it look ok but here all the formating change.

The code do work for goodness say for those saying what syntax error. I do make the mistake of forgeting 2 semicolon.

Hi all, this may be a bit outdated release for some of you,
but someone may need this especially those using repack
that dont have the @exp command.

This npc script that let u reset stats as well as fix negative exp
(Check if exp is negative, if negative set to 0). Prompt you
dont have negative exp if that person is trying to fix negative exp.

Feel free to edit this. This is my first npc script that i have done.
This actually my 2101.js for heena and place her in my fm. You
can copy the whole code and put in other npc that you like.

Code:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc> 
                       Matthias Butz <matze@odinms.de>
                       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
======>Heena npcid 2001<======
*/



function start() {
	cm.sendSimple ("\r\n#L0#Reset your Stats!#l\r\n#L1#Fix your negative EXP!");
}

function action(mode, type, selection) {
	cm.dispose();
        
	if (selection == 0) {
                          var p = cm.c.getPlayer();
		var statup = new java.util.ArrayList();
		var totAp = p.getRemainingAp() + p.getStr() + p.getDex() + p.getInt() + p.getLuk();
		p.setStr(4);
		p.setDex(4);
		p.setInt(4);
		p.setLuk(4);
		p.setRemainingAp (totAp);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.STR, java.lang.Integer.valueOf(4)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.DEX, java.lang.Integer.valueOf(4)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LUK, java.lang.Integer.valueOf(4)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.INT, java.lang.Integer.valueOf(4)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLEAP, java.lang.Integer.valueOf(p.getRemainingAp())));
                statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.EXP, java.lang.Integer.valueOf(0)));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
		cm.dispose;
	} else if (selection == 1) {
                var p = cm.c.getPlayer();
                var exp = p.getExp();
                if( exp < 0) {
                	var statup = new java.util.ArrayList();                         
                	statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.EXP, java.lang.Integer.valueOf(0)));
                	p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
                	cm.dispose();
                }else{
                cm.sendOk("You Dont have negative exp");
                cm.dispose();
                }
                 
        }else{
                cm.dispose();
	}
}
 
Last edited:
Newbie Spellweaver
Joined
Jul 8, 2008
Messages
73
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

This will never work, why? }else{ should be } else { and it's in Quotes. not in
Code:
 format.
 
Experienced Elementalist
Joined
Jul 18, 2008
Messages
232
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

Why does this reset your stats? 100% Failed release.
 
Newbie Spellweaver
Joined
Jul 8, 2008
Messages
73
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

This won't work. I agree with thisisakevin. 100% FAIL
 
Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

Lol java is supposed to be organized but this is a total mess.
 
Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

*Added to the great big book of phailures*
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

This is so unorganized :p
Also 100% fail as kevin said
 
Newbie Spellweaver
Joined
Jun 21, 2008
Messages
95
Reaction score
3
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

Well, the effort counts right?
 
Newbie Spellweaver
Joined
Jul 8, 2008
Messages
73
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

No. O_O
 
Supreme Arcanarch
Loyal Member
Joined
Jul 21, 2008
Messages
969
Reaction score
1
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

It won't even work
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

This will never work, why? }else{ should be } else { and it's in Quotes. not in
Code:
 format.[/QUOTE]

You obviously don't know that java is NOT space/line oriented. It doesn't matter if everything is on one line, or if there's 3 lines inbetween each line. It doesn't matter if it's } else { or }else{ or }
else
  {.

And he forgot some semicolons, lulz
 
Junior Spellweaver
Joined
Sep 2, 2008
Messages
130
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

i have the negative fix part o_O anyone needs? Lol! guys, at least he tried right? :)
 
Elite Diviner
Joined
Apr 24, 2008
Messages
416
Reaction score
2
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

the (exp < 0 or something like that should be exp > -1 if i am not wrong check out mine, mine is even more simple this has been released twice 1 by me and 1 by Mooblar if i am u i rather use the @exp command
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

lol semi-colons.

Seriously this is the only important part
PHP:
statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLEAP, java.lang.Integer.valueOf(p.getRemainingAp())));
statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.EXP, java.lang.Integer.valueOf(0)));
p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
 
Junior Spellweaver
Joined
Sep 2, 2008
Messages
130
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

Cant we just use
PHP:
if (exp < 0) {
     cm.getPlayer().gainExp(-exp, false, false);
     cm.dispose();
}

for the exp fix?
Sorry if it's wrong.. i'm lousy at these things..
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

hmmm maybe it'll be better if it was gainExp(exp,false,false) but I guess if you're exp is below 1.13b, that'll work. You want to gain the absolute value of teh exp you have right now, which is negative.
 
Junior Spellweaver
Joined
Sep 2, 2008
Messages
130
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

o_O i'm kindda gettin blurr now.. =X
 
Newbie Spellweaver
Joined
Jun 11, 2008
Messages
48
Reaction score
0
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

now now ppl...
at least give some encouraging words to let him try to improve better in coding..
not just shoot him and kill him...
how are we suppose to get good coders like this... lol
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [RELEASE] Use npc to fix negative exp, no need edit .java

hmmm maybe it'll be better if it was gainExp(exp,false,false) but I guess if you're exp is below 1.13b, that'll work. You want to gain the absolute value of teh exp you have right now, which is negative.

Math.abs(exp)
 
Back
Top