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!

Stat Giver

Newbie Spellweaver
Joined
Jun 21, 2008
Messages
95
Reaction score
3
This NPC basically resets your stats when you click her, checks if you have a GM hat in your INVENTORY, sets your AP to 0 and asks you if you want a stat reset, 5k, 10k, or 15k stats. PLEASE include credits in the script if you are including on using this in a repack.

**UPDATES**
Sept 04:Made it so you don't get a reset unless you ask.

Code:
/*
Stat Giver
Coded by GMBerserk of BerserkMS
*/

var wui = 0;

function start() {
	cm.sendOk ("Welcome to BerserkMS, #b#h ##k! Do you want to increase your stats?");
}

function action(mode, type, selection) {
	if (mode == 0 || wui == 1) {
		cm.dispose();
	} else {
		wui = 1;
    cm.sendSimple ("What would you like to do?? \r\n#L0#Stat Reset \r\n#L1#5k Stats \r\n#L2#10k Stats \r\n#L3#15k Stats"); }
	if (selection == 0 && cm.haveItem(1002140, 1)) {
        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 = 0);
		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();
	} else if (selection == 1 && cm.haveItem(1002140, 1)) {
		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(5);
		p.setDex(5);
		p.setInt(5);
		p.setLuk(5);
		p.setRemainingAp (totAp = 0);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.STR, java.lang.Integer.valueOf(5000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.DEX, java.lang.Integer.valueOf(5000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LUK, java.lang.Integer.valueOf(5000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.INT, java.lang.Integer.valueOf(5000)));
		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();
	} else if (selection == 2 && cm.haveItem(1002140, 1)) {
        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(10000);
		p.setDex(10000);
		p.setInt(10000);
		p.setLuk(10000);
		p.setRemainingAp (totAp = 0);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.STR, java.lang.Integer.valueOf(10000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.DEX, java.lang.Integer.valueOf(10000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LUK, java.lang.Integer.valueOf(10000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.INT, java.lang.Integer.valueOf(10000)));
		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();
	} else if (selection == 3 && cm.haveItem(1002140, 1)) {
        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(15000);
		p.setDex(15000);
		p.setInt(15000);
		p.setLuk(15000);
		p.setRemainingAp (totAp = 0);
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.STR, java.lang.Integer.valueOf(15000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.DEX, java.lang.Integer.valueOf(15000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.LUK, java.lang.Integer.valueOf(15000)));
		statup.add (new net.sf.odinms.tools.Pair(net.sf.odinms.client.MapleStat.INT, java.lang.Integer.valueOf(15000)));
		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();
  }
}


Replace BerserkMS with your server name :)
oh, and tell me if there are any bugs you encounter and I will try to fix them.
Thanks.
 
Last edited:
Divine Celestial
Loyal Member
Joined
Apr 6, 2008
Messages
858
Reaction score
0
Re: [RELEASE]Stat Giver

So, this guy reset your stat and give you stat?
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
Re: [RELEASE]Stat Giver

it dose'nt ask you at the beging, it's a OK, unless u exit chat, u are forced to have stats resets.

and, the "#L0#Stat Reset#l" option, it's already resets, it was "extra".

and to check if it's a GM, you could only put "cm.getChar().isGM() == true/false"

anything more than that, it's ok i guess. ^^
 
Experienced Elementalist
Joined
Jul 1, 2008
Messages
270
Reaction score
0
Re: [RELEASE]Stat Giver

If you can make this into a quest, that would be great. Otherwise, nice release
 
Newbie Spellweaver
Joined
Jun 21, 2008
Messages
95
Reaction score
3
Re: [RELEASE]Stat Giver

it dose'nt ask you at the beging, it's a OK, unless u exit chat, u are forced to have stats resets.

and, the "#L0#Stat Reset#l" option, it's already resets, it was "extra".

and to check if it's a GM, you could only put "cm.getChar().isGM() == true/false"

anything more than that, it's ok i guess. ^^
No, i don't make it check if you're a GM, i make it check if you have a GM hat, good for servers who give out GM hats for donation items(mine)
 
Custom Title Activated
Loyal Member
Joined
Jul 22, 2008
Messages
1,188
Reaction score
0
Re: [RELEASE]Stat Giver

No GM Hat No Stat Giver?
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [RELEASE]Stat Giver

it dose'nt ask you at the beging, it's a OK, unless u exit chat, u are forced to have stats resets.

and, the "#L0#Stat Reset#l" option, it's already resets, it was "extra".

and to check if it's a GM, you could only put "cm.getChar().isGM() == true/false"

anything more than that, it's ok i guess. ^^

*sigh you dont need == true/false, just use operators
 
Elite Diviner
Joined
Apr 24, 2008
Messages
416
Reaction score
2
Re: [RELEASE]Stat Giver

u can actually change the check to check if its
PHP:
if(cm.getChar().isGM()
 == null) {
or something like that so if some players will have GM Hat when they have some events i am nub in npc scripting >< correct me if i am wrong
 
Back
Top