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!

[NPC]How to make a proItem NPC (estimated MSI)

Newbie Spellweaver
Joined
Nov 8, 2010
Messages
40
Reaction score
2
Okay everyone probably knows what a proItem is. It's basically an item that you can write up with custom stats without editing the true properties itself.

I was thinking about putting a srebirth NPC without a lot of netbeans coding or wz editing (why waste a WZ :p), when I stumbled across a NPC command in npcconversationmanager.

cm.makeProItem(int, hardcore int)
The int = the ID of item you are making (please choose an equip. Who knows what will happen if you pick an etc)
and hardcore int = stats (including WA, MA, jump, etc.)

Well the number you input to hardcore INT will effect WA, and WA is worth so much more than a regular stat, so I am GUESSING/ESTIMATING that 10,000 of each stat + 10,000 WA and 10,000 MA will be around a MSI.

I may be way off, I may be right on. I don't know the true ratio to WA:Stat, but I mean knocking off 20k from every stat will compensate for the huge income of attack from WA or MA, right? Plus don't forget all that defense you're getting. Anyways. Here we go.

I customly added NPC functions in my netbeans, so this is what you'll have to do.

You want your NPC to reset stats to 4, but you don't want any AP left over like how cm.resetStats(); does, so I just made a new NPC function called cm.reset();

This resets your stats to 4 without leftover AP.

Code:
        public void reset() {
        getPlayer().setStr(4);
        getPlayer().setDex(4);
        getPlayer().setLuk(4);
        getPlayer().setInt(4);
        getPlayer().updateSingleStat(MapleStat.STR, 4);
        getPlayer().updateSingleStat(MapleStat.DEX, 4);
        getPlayer().updateSingleStat(MapleStat.LUK, 4);
        getPlayer().updateSingleStat(MapleStat.INT, 4);
    }

Now that you have the command, you can use it in the form of cm.reset();

And second of all, you need the script. I custom coded this for my server, so credits go to me please. . .​

Code:
var status = 0;
var selected;
var fee;

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

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("A little indecisive, eh? Come back when you've made your mind.");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
			cm.sendNext("Hello #h #, I'm the #rmsi#k npc of #dMidnightMS#k. You will need #b30#k of every stat and 10 #rgolden maple leaves#k. You can get stats by leveling, and #rgolden maple leaves#k by the npc #dSilent#k near the front entrance of the FM.");
		} else if (status == 1) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
				cm.dispose();
			} else
				cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		} else if (status == 2) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough items or stats.");
				cm.dispose();
		} else
				if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999 && cm.getPlayer().getLuk() > 29999 && cm.itemQuantity(4000313) > 9) {
				cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");
				cm.makeProItem(1102024,10000);
				cm.gainItem(4000313,-10);
				cm.reset();
		} else
				if (cm.getJobId()==910) 
				cm.sendOk("Omg GM haxors.\r\n\r\nJk, good to have you on the force though.");
				cm.dispose();
		}
	}
}

If you come across problems, post here, but I highly doubt you will. I mean, if you've worked with servers long enough you can solve the issue.

Oh and don't ask why the function includes selection. It's because I'm too lazy to modify the script. It works fine the way it is.​

Why I added the GM check at the bottom? Because I love being recognized as one.


Press thanks if you like it.
 
Last edited by a moderator:
Custom Title Activated
Loyal Member
Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
I see so many mistakes >.>.
And, thread moved to the release section.
This isn't much of a guide.
 
Newbie Spellweaver
Joined
Nov 8, 2010
Messages
40
Reaction score
2
I see so many mistakes >.>.
And, thread moved to the release section.
This isn't much of a guide.


I'm no teh proest coder ever -.-' I'm just getting into the so-so complex thing.
 
Newbie Spellweaver
Joined
Oct 6, 2010
Messages
26
Reaction score
10
deja vu lol xD
You realize there's some version of this (msi, srb, proitem) on almost every single page of the release section? Lol I stopped looking after the first 5 pages.
 
Last edited:
bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,896
Reaction score
1,129
A few issues with the script. selected and fee are useless variables. They play no part in the script. This...

PHP:
} else if (status == 1) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
				cm.dispose();
			} else
				cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		} else if (status == 2) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough items or stats.");
				cm.dispose();
		} else
				if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999 && cm.getPlayer().getLuk() > 29999 && cm.itemQuantity(4000313) > 9) {
				cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");

is kinda pointless. You don't need to check in each status for the same thing, and you don't need to check for the opposite of what you already checked for, because if you checked for them having something, and they didn't have it, it's false. If they do have it, it's true. It can't change. It's either they have it or they don't. It's much easier to just do this...

PHP:
} else if (status == 1) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
				cm.dispose();
			} else
				cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		} else if (status == 2) {
				cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");

Lastly, I believe you can just do something like this...

PHP:
totalStats = cm.getPlayer().getStr() + cm.getPlayer().getDex() + cm.getPlayer().getInt() + cm.getPlayer().getLuk();

Instead of continuously typing it all out. I don't usually do this, but this script would be more efficient.

PHP:
status = 0;
var totalStats;

function start(){
	cm.sendNext("Hello #h #, I'm the #rmsi#k npc of #dMidnightMS#k. You will need #b30#k of every stat and 10 #rgolden maple leaves#k. You can get stats by leveling, and #rgolden maple leaves#k by the npc #dSilent#k near the front entrance of the FM.");
}

function action(mode, type, selection){
	if (mode != 1){
		if (mode == 0){
			cm.sendOk("A little indecisive, eh? Come back when you've made your mind.");
		}
		cm.dispose();
		return;
	}else{
		status++;
	}
	if (status == 1){
		totalStats = cm.getPlayer().getStr() + cm.getPlayer().getDex() + cm.getPlayer().getInt() + cm.getPlayer().getLuk(); // might need to be fixed
		if (totalStats < 119996 && cm.haveItem(4000313) < 10){ // 29999 each stat
			cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
			cm.dispose();
		}else{
			cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		}
	}else if (status == 2){
		if (cm.getJobId()==910){
			cm.sendOk("Omg GM haxors.\r\n\r\nJk, good to have you on the force though.");
		}else{
			cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");
			cm.makeProItem(1102024,10000);
			cm.gainItem(4000313,-10);
			cm.reset();
		}
		cm.dispose();
	}
}

You also didn't include the makeProItem method. I'm confused as to why this was moved to the Release section, but not my call :)
 
Last edited:
Experienced Elementalist
Joined
Mar 26, 2010
Messages
250
Reaction score
62
A few issues with the script. selected and fee are useless variables. They play no part in the script. This...

PHP:
} else if (status == 1) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
				cm.dispose();
			} else
				cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		} else if (status == 2) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough items or stats.");
				cm.dispose();
		} else
				if (cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999 && cm.getPlayer().getLuk() > 29999 && cm.itemQuantity(4000313) > 9) {
				cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");

is kinda pointless. You don't need to check in each status for the same thing, and you don't need to check for the opposite of what you already checked for, because if you checked for them having something, and they didn't have it, it's false. If they do have it, it's true. It can't change. It's either they have it or they don't. It's much easier to just do this...

PHP:
} else if (status == 1) {
				if (!cm.getPlayer().getStr() > 29999 && !cm.getPlayer().getDex() > 29999 && !cm.getPlayer().getInt() > 29999 && !cm.getPlayer().getLuk() > 29999 && !cm.itemQuantity(4000313) > 9) {
				cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
				cm.dispose();
			} else
				cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		} else if (status == 2) {
				cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");

Lastly, I believe you can just do something like this...

PHP:
totalStats = cm.getPlayer().getStr() + cm.getPlayer().getDex() + cm.getPlayer().getInt() + cm.getPlayer().getLuk();

Instead of continuously typing it all out. I don't usually do this, but this script would be more efficient.

PHP:
status = 0;
var totalStats;

function start(){
	cm.sendNext("Hello #h #, I'm the #rmsi#k npc of #dMidnightMS#k. You will need #b30#k of every stat and 10 #rgolden maple leaves#k. You can get stats by leveling, and #rgolden maple leaves#k by the npc #dSilent#k near the front entrance of the FM.");
}

function action(mode, type, selection){
	if (mode != 1){
		if (mode == 0){
			cm.sendOk("A little indecisive, eh? Come back when you've made your mind.");
		}
		cm.dispose();
		return;
	}else{
		status++;
	}
	if (status == 1){
		totalStats = cm.getPlayer().getStr() + cm.getPlayer().getDex() + cm.getPlayer().getInt() + cm.getPlayer().getLuk(); // might need to be fixed
		if (totalStats < 119996 && cm.haveItem(4000313) < 10){ // 29999 each stat
			cm.sendOk("You don't have enough stats, or you are lacking 10 #rgolden maple leaves#k.");
			cm.dispose();
		}else{
			cm.sendYesNo("All right, are you ready to make your #rMSI#k? \r\n#eIt will cost you a stat reset and 10 #rgolden maple leaves#k.");
		}
	}else if (status == 2){
		if (cm.getJobId()==910){
			cm.sendOk("Omg GM haxors.\r\n\r\nJk, good to have you on the force though.");
		}else{
			cm.sendOk("There! Check in your #requips#k inventory, and a #eblack gaia cape#n will be there. \r\n\r\nYou will see that your item has #e10,000#n stats for every stat, however, weapon magic and weapon attack are included, and those give a lot of damage.\r\n\r\nEnjoy #dMidnightMS#k");
			cm.makeProItem(1102024,10000);
			cm.gainItem(4000313,-10);
			cm.reset();
		}
		cm.dispose();
	}
}

You also didn't include the makeProItem method. I'm confused as to why this was moved to the Release section, but not my call :)

You are good at posting posts that posters are to lazy to post. I don't know where you get the time or motivation to fix badly indented and broken releases.
 
Newbie Spellweaver
Joined
Nov 8, 2010
Messages
40
Reaction score
2
You are good at posting posts that posters are to lazy to post. I don't know where you get the time or motivation to fix badly indented and broken releases.



Is that a good or bad thing.
 
Last edited:
return null;
Loyal Member
Joined
Dec 21, 2008
Messages
805
Reaction score
130
Why do you check it like this:
!cm.getPlayer().getStr() > 29999
It's kinda weird imo.
 
Newbie Spellweaver
Joined
Nov 8, 2010
Messages
40
Reaction score
2
oh well. I do things weird anyway. The script works, and at the end I even said I was too lazy to fix up the useless parts :p. It's only for you to take and modify to perfection.
 
Back
Top