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] Rebirth NPC with AP Reset

Status
Not open for further replies.
Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
Just a small release for some people who might need it but do not know how to do it.. Rebirth and ap reset all in one, saves time from making an ap reset npc. Here is the rebirth script with ap reset.
Code:
/*
@    Author : Snow
@
@    NPC = NAME
@    Map =  MAP
@    NPC MapId = MAPID
@    Function = Rebirth Player
@
*/
//Some credits to xazerrx of RaGeZone for adding ap reset

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("Hi, I'm Mr. Pickall. I can bring you back to your mother's womb for a #eRebirth#n. Do you wish to do it?");
        }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("#bCongratulations!#k, you have been qualified for a #eRebirth#n. Make sure you have #renough space#k to unequip your items or else I'll just level you to 201.");
        }
         }else if (status == 2) {
		wui = 1;
		var statup = new java.util.ArrayList();
		var p = cm.c.getPlayer();
                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 - 16);
        cm.getChar().levelUp();
        cm.unequipEverything()
        cm.changeJob(net.sf.odinms.client.MapleJob.BEGINNER);
        cm.sendNext("You have bee 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)));
                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())));
		p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
        cm.dispose();
        }            
          }
     }
 
Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
If you don't need it then don't use it.. you don't have to start flaming.
 
Initiate Mage
Joined
Aug 8, 2008
Messages
3
Reaction score
0
Do we just run this code into our databases? or do we have to like put it into a .JAVA file.
 
Divine Celestial
Loyal Member
Joined
Apr 6, 2008
Messages
858
Reaction score
0
You have to put into a .java file, though dont know which one lol.
 
Mythic Archon
Loyal Member
Joined
May 11, 2008
Messages
722
Reaction score
50
Sorry for double post delete please.
 
Status
Not open for further replies.
Back
Top