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!

[Release]Skill Point Reset NPC (Fixes Rebirth Skill point glitch)

Status
Not open for further replies.
Skilled Illusionist
Joined
Jun 20, 2008
Messages
355
Reaction score
1
Well, this is kind of, noob, but its my first npc...

It fixes the Lacking Level 1 or 2 skills glitch, or atleast it does on my server...

It resets your Skill points to 0, because the skill points you brought over from your previous life (If you will) Are not addable to your new job (After the rebirth).

This is again, my first NPC, so be easy on me ;P

Code:
/*
Made by: xxandycxx Of RageZone
Based off of Sera - First NPC on Map 0
This NPC Reset's SP.
*/

var wui = 0;

function start() {
	cm.sendOk ("Hey, Having trouble adding SP to your skills, after rebirth? Then I'm the dude to talk to! I'll reset your SP to 0, so you should be able to Add stats.");
}

function action(mode, type, selection) {
	if (mode == 0 || wui == 1) {
		cm.dispose();
	} else {
		wui = 1;
		var statup = new java.util.ArrayList();
		var p = cm.c.getPlayer();
		p.setRemainingSp(0);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLESP, java.lang.Integer.valueOf(0)));

		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
		cm.sendOk ("Have a great time!");
	}
}

Put this into Notepad, name it <NpcIDgoeshere>.js

And put it in your scripts/npc folder.
 
Last edited:
Skilled Illusionist
Loyal Member
Joined
Jun 27, 2008
Messages
391
Reaction score
12
Code:
/*
@    Author : Snow
@    Added in STAT/HP(possible) reset: Rigged
@    [b]Added in SP reset: xxandycxx[/b]
@
@    NPC = NAME
@    Map =  MAP
@    NPC MapId = MAPID
@    Function = Rebirth Player
@
*/

var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {

         
         if (mode == -1) {//ExitChat
        cm.dispose();
    
    }else if (mode == 0){//No
        cm.sendOk("Ok, talk to me when you're sure you want to be #bReborn#k.");
        cm.dispose();

    }else{            //Regular Talk
        if (mode == 1)
            status++;
        else
            status--;
        
                 if (status == 0) {
        cm.sendYesNo("Welcome, great hero. You have been through a long and challenging road, and you have become immensely strong. I can increase your power even further, and surpass your limits! You will become a level 1 #bBeginner#k, your stats will be 4/4/4/4 again and you will have 50HP/50MP, but you will have 10 extra AP each time you reborn and you keep all the skills in your #bhot keys#k. Make sure you have room for your equipment to be unequipped. Do you wish to be #rReborn#k?");
        }else if (status == 1) {
        if(cm.getChar().getLevel() < 200){
        cm.sendOk("Sorry, You have to be level 200 to rebirth.");
        cm.dispose();
        }else{
        cm.sendOk("#bGood-Job#k, you have been qualified for a #eRebirth#n.");
        }
         }else if (status == 2) {
		wui = 1;
		var statup = new java.util.ArrayList();
		var p = cm.c.getPlayer();
        cm.getChar().levelUp();
	cm.unequipEverything()
        cm.changeJob(net.sf.odinms.client.MapleJob.BEGINNER);
		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.setHp (50);
		//p.setMaxHp (50);
		//p.setMp (50);
		//p.setMaxMp (50);
[B]		p.setRemainingSp(0);[/B]
		p.setRemainingAp (totAp - 997);
		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.HP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MAXHP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MAXMP, java.lang.Integer.valueOf(50)));
[b]		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLESP, java.lang.Integer.valueOf(0)));[/B]
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLEAP, java.lang.Integer.valueOf(p.getRemainingAp())));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
        cm.sendNext("You have been reborned! Good luck on your next journey.");
	cm.setLevel(2);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LEVEL, java.lang.Integer.valueOf(1)));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
        cm.dispose();
        }            
          }
     }
Would that work?
 
Junior Spellweaver
Loyal Member
Joined
Apr 23, 2008
Messages
155
Reaction score
2
does it check if you're level 200 first? O-o
 
Skilled Illusionist
Joined
Jun 20, 2008
Messages
355
Reaction score
1
Code:
/*
@    Author : Snow
@    Added in STAT/HP(possible) reset: Rigged
@    [b]Added in SP reset: xxandycxx[/b]
@
@    NPC = NAME
@    Map =  MAP
@    NPC MapId = MAPID
@    Function = Rebirth Player
@
*/

var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {

         
         if (mode == -1) {//ExitChat
        cm.dispose();
    
    }else if (mode == 0){//No
        cm.sendOk("Ok, talk to me when you're sure you want to be #bReborn#k.");
        cm.dispose();

    }else{            //Regular Talk
        if (mode == 1)
            status++;
        else
            status--;
        
                 if (status == 0) {
        cm.sendYesNo("Welcome, great hero. You have been through a long and challenging road, and you have become immensely strong. I can increase your power even further, and surpass your limits! You will become a level 1 #bBeginner#k, your stats will be 4/4/4/4 again and you will have 50HP/50MP, but you will have 10 extra AP each time you reborn and you keep all the skills in your #bhot keys#k. Make sure you have room for your equipment to be unequipped. Do you wish to be #rReborn#k?");
        }else if (status == 1) {
        if(cm.getChar().getLevel() < 200){
        cm.sendOk("Sorry, You have to be level 200 to rebirth.");
        cm.dispose();
        }else{
        cm.sendOk("#bGood-Job#k, you have been qualified for a #eRebirth#n.");
        }
         }else if (status == 2) {
		wui = 1;
		var statup = new java.util.ArrayList();
		var p = cm.c.getPlayer();
        cm.getChar().levelUp();
	cm.unequipEverything()
        cm.changeJob(net.sf.odinms.client.MapleJob.BEGINNER);
		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.setHp (50);
		//p.setMaxHp (50);
		//p.setMp (50);
		//p.setMaxMp (50);
		p.setExp (0);
[B]		p.setRemainingSp(0);[/B]
		p.setRemainingAp (totAp - 997);
		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.HP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MAXHP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MP, java.lang.Integer.valueOf(50)));
		//statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.MAXMP, java.lang.Integer.valueOf(50)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.EXP, java.lang.Integer.valueOf(0)));
[b]		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLESP, java.lang.Integer.valueOf(0)));[/B]
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.AVAILABLEAP, java.lang.Integer.valueOf(p.getRemainingAp())));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
        cm.sendNext("You have been reborned! Good luck on your next journey.");
	cm.setLevel(2);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LEVEL, java.lang.Integer.valueOf(1)));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
        cm.dispose();
        }            
          }
     }
Would that work?

Not sure, Test it...

does it check if you're level 200 first? O-o

Err no...
 
Junior Spellweaver
Loyal Member
Joined
Apr 23, 2008
Messages
155
Reaction score
2
nope just tested xD, thestats wont carry over, and level to 201
 
Skilled Illusionist
Joined
May 12, 2008
Messages
321
Reaction score
0
Does anyone know what i have to do to get the sethp and setmp to work with NPCs? I cant seem to find the thread that helps, i remember seeing it before.
 
Skilled Illusionist
Joined
Jun 20, 2008
Messages
355
Reaction score
1
Does anyone know what i have to do to get the sethp and setmp to work with NPCs? I cant seem to find the thread that helps, i remember seeing it before.

Err, Could you be using the wrong command? x-x;

I'd look in the processers to see what you can use, thats how I figured out how to use `AVAILABLESP`
 
Experienced Elementalist
Joined
May 29, 2008
Messages
241
Reaction score
0
hmm, good release . however adding

Code:
p.setRemainingSp(0);

into the rebirth npc itself should work too.
 
Skilled Illusionist
Joined
Jun 20, 2008
Messages
355
Reaction score
1
hmm, good release . however adding

Code:
p.setRemainingSp(0);

into the rebirth npc itself should work too.

Actually No, I keep getting errors, no matter what I try with the rebirth npc, Hence, why I made a SP reset npc, instead of Trying coding it into the rebirth npc...
 
Master Summoner
Loyal Member
Joined
Mar 4, 2007
Messages
564
Reaction score
1
Rofl, Andy. How did I know I would see this on RzG?
:3
 
Last edited:
Skilled Illusionist
Joined
May 12, 2008
Messages
321
Reaction score
0
Hm.. doesn't fix the problem on my server o_o
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
This doesnt work...
I clicked on my NPC and it did nothing but w/e
 
Status
Not open for further replies.
Back
Top