• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Add-On]GMS-like Maple Upgrade System.

Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
This is (as close as I can get it, because I don't know exactly how the NPC looked or acted at all, never saw it) my version of GMS's Maple Leaf Upgrade System to level 64 weapons. I'll add the Equipment one to this post too, I'm taking a little break. Hunting down all the ID's and re-creating the Array's a third time(first time I've ever used an array) took quite some time. Oh, if there's too many brackets sorry. This is part of my multifunction NPC, so it's it's own function in there and required a buttload of brackets. Anybody that wants to attempt to shorten the script is welcome to. Anywho, here ya go.

PHP:
/**
 *
 * @author Sharky
 */
var status = -1;
var level35 = [[1452016], [1472030], [1462014], [1302020], [1382009], [1492020], [1482020]];
var level64from35 = [[1452045],[1462040], [1472055], [1302064, 1402039], [1382039, 1372034], [1492022], [1498022]];
var level43 = [[1452022], [1472032], [1462019], [1332025], [1412011], [1422014], [1302030], [1442024], [1432012], [1382012], [1492021], [1482021]];
var level64 = [[1452045], [1472055], [1462040], [1332055, 1332056], [1412027, 1312032], [1422029, 1322054], [1302064, 1402039], [1442051], [1432040], [1382039, 1372034], [1492022], [1482022]];
var sel;
var sel_2;

function start(){
    cm.sendSimple("Sawp, I can upgrade your Maple Weapons for ya, for a fee. It's 2000 Maple Leaves to upgrade from a lvl 35 weapon to a lvl 64, and 1500 to upgrade from a lvl 43 weapon to a lvl 64. \r\n\t#dWhich level Maple Weapon do you want to upgrade?#b \r\n\t#L0#Level 35 Weapons#l \r\n\t#L1#Level 43 Weapons#l");
}

function action(m,t,s){
    status++;
    if(m != 1){
        cm.dispose();
        return;
    }
    if(status == 0){
        sel = s;
        if(s == 0){
            cm.sendSimple("Which type of level 35 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
        } else {
            cm.sendSimple("Which type of level 43 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Dagger#l \r\n\t#L4#Axe#l \r\n\t#L5#Mace#l \r\n\t#L6#Sword#l \r\n\t#L7#Pole Arm#l \r\n\t#L8#Spear#l \r\n\t#L9#Staff#l \r\n\t#L10#Gun#l \r\n\t#L11#Knuckle#l");
        }
    } else if (status == 1){
        if(cm.haveItem((sel == 0 ? level35[s][0] : level43[s][0]), 1)) {
            if(sel == 0){
                cm.sendYesNo("I see you have a #d#t"+ level35[s][0] +"##k. Would you like to upgrade it to a #d#t"+ level64from35[s][0] +"##k for 2000 Maple Leaves?");
            } else {
                cm.sendSimple("I see you have a #d#t"+ level43[s][0] +"##k. Would you like to upgrade it to one of the following options for 1500 Maple Leaves? \r\n\t"+ (level64[s].length < 2 ? "#L0##b#t" + level64[s][0] +"##k#l" : "#L0##b#t" + level64[s][0] +"##k#l \r\n\t#L1##b#t"+ level64[s][1] +"##k#l"));
            }
            sel_2 = sel;
            sel = s;
        } else {
            cm.sendOk("You don't seem to have a Maple Weapon in that category.");
            cm.dispose();
        }
    } else if (status == 2){
        if(cm.haveItem(4001126, (sel_2 == 0 ? 2000 : 1500))){
            cm.gainItem((sel_2 == 0 ? level35[sel][0] : level43[sel][0]), -1);
            cm.gainItem(4001126, -(sel_2 == 0 ? 2000 : 1500));
            cm.gainItem((sel_2 == 0 ? level64from35[sel][0] : level64[sel][s]));
            cm.sendOk("Thank you for upgrading your Maple Weapon from a #d#t"+ (sel_2 == 0 ? level35[sel][0] : level43[sel][0]) +"##k to a #d#t"+ (sel_2 == 0 ? level64from35[sel][0] : level64[sel][s]) +"##k. Come again!");
        } else {
            cm.sendOk("You only have #d#c4001126# #t4001126## Maple Leaves#k. Come back when you have #d"+ (sel_2 == 0 ? 2000 : 1500) +" Maple Leaves#k.");
        }
        cm.dispose();
    }
}

Oh. I commented the order of items in each Array to make it easier to edit. There Sharky, I changed your NPC to work the way I did and updated the original post. Your name is in the credits.
 
Last edited:
Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
Yeah, it was a pain in the butt Kevin. And I thought it was pretty nice lookin. Meanie. =[
 
Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
Would you rather too many arrays or a HUGE list ingame? ;p

Also, since prices are itemIDs I had to have seperate arrays for the lv35 and lv43. There's a level 64 item in each category (some have 2, e.g. daggers), so I had to switch that up too.
 
Newbie Spellweaver
Joined
Apr 7, 2008
Messages
7
Reaction score
3
Would you rather too many arrays or a HUGE list ingame? ;p

Also, since prices are itemIDs I had to have seperate arrays for the lv35 and lv43. There's a level 64 item in each category (some have 2, e.g. daggers), so I had to switch that up too.


I think I'd rather have the huge list then looking through 4 categories and having to use the command to get back in when I pick the wrong one, Chris. :x
 
Experienced Elementalist
Joined
Mar 26, 2010
Messages
250
Reaction score
62
Worst variable names ever. You know, arrays are kinda used to remove stuff like:
Code:
var thing1
var thing2
var thing3
var thing4
 
Legendary Battlemage
Loyal Member
Joined
Dec 13, 2010
Messages
649
Reaction score
140
Would you rather too many arrays or a HUGE list ingame? ;p

Also, since prices are itemIDs I had to have seperate arrays for the lv35 and lv43. There's a level 64 item in each category (some have 2, e.g. daggers), so I had to switch that up too.

Multi Dimensional arrays.. Comment by section o_o
 
Skilled Illusionist
Joined
Dec 16, 2010
Messages
304
Reaction score
164
I liked this idea a lot (although I'm fairly certain there's a very similar release), but I didn't really like your npc ;(
I made my own, and decided to post it here for you to learn from or other people to use or w/e. I hope somebody will make use of this. Runs perfectly. Enjoy.
PHP:
/**
 *
 * @author Sharky
 */
var status = -1;
var level35 = [[1452016], [1472030], [1462014], [1302020], [1382009], [1492020], [1482020]];
var level43from35 = [[1452022], [1472032], [1462019], [1302030], [1382012], [1492021], [1482021]];
var level43 = [[1452022], [1472032], [1462019], [1332025], [1412011], [1422014], [1302030], [1442024], [1432012], [1382012], [1492021], [1482021]];
var level64 = [[1452045], [1472055], [1462040], [1332055, 1332056], [1412027, 1312032], [1422029, 1322054], [1302064, 1402039], [1442051], [1432040], [1382039, 1372034], [1492022], [1482022]];
var sel;
var sel_2;

function start(){
	cm.sendSimple("Sawp, I can upgrade your Maple Weapons for ya, for a fee. It's 2000 Maple Leaves to upgrade from a lvl 35 weapon to a lvl 43, and 1500 to upgrade from a lvl 43 weapon to a lvl 64. \r\n\t#dWhich level Maple Weapon do you want to upgrade?#b \r\n\t#L0#Level 35 Weapons#l \r\n\t#L1#Level 43 Weapons#l");
}

function action(m,t,s){
	status++;
	if(m != 1){
		cm.dispose();
		return;
	}
	if(status == 0){
		sel = s;
		if(s == 0){
			cm.sendSimple("Which type of level 35 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
		} else {
			cm.sendSimple("Which type of level 43 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Dagger#l \r\n\t#L4#Axe#l \r\n\t#L5#Mace#l \r\n\t#L6#Sword#l \r\n\t#L7#Pole Arm#l \r\n\t#L8#Spear#l \r\n\t#L9#Staff#l \r\n\t#L10#Gun#l \r\n\t#L11#Knuckle#l");
		}
	} else if (status == 1){
		if(cm.haveItem((sel == 0 ? level35[s][0] : level43[s][0]), 1)) {
			if(sel == 0){
				cm.sendYesNo("I see you have a #d#t"+ level35[s][0] +"##k. Would you like to upgrade it to a #d#t"+ level43from35[s][0] +"##k for 2000 Maple Leaves?");
			} else {
				cm.sendSimple("I see you have a #d#t"+ level43[s][0] +"##k. Would you like to upgrade it to one of the following options for 1500 Maple Leaves? \r\n\t"+ (level64[s].length < 2 ? "#L0##b#t" + level64[s][0] +"##k#l" : "#L0##b#t" + level64[s][0] +"##k#l \r\n\t#L1##b#t"+ level64[s][1] +"##k#l"));
			}
			sel_2 = sel;
			sel = s;
		} else {
			cm.sendOk("You don't seem to have a Maple Weapon in that category.");
			cm.dispose();
		}
	} else if (status == 2){
		if(cm.haveItem(4001126, (sel_2 == 0 ? 2000 : 1500))){
			cm.gainItem((sel_2 == 0 ? level35[sel][0] : level43[sel][0]), -1);
			cm.gainItem(4001126, -(sel_2 == 0 ? 2000 : 1500));
			cm.gainItem((sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]));
			cm.sendOk("Thank you for upgrading your Maple Weapon from a #d#t"+ (sel_2 == 0 ? level35[sel][0] : level43[sel][0]) +"##k to a #d#t"+ (sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]) +"##k. Come again!");
		} else {
			cm.sendOk("You only have #d#c4001126# #t4001126## Maple Leaves#k. Come back when you have #d"+ (sel_2 == 0 ? 2000 : 1500) +" Maple Leaves#k.");
		}
		cm.dispose();
	}
}
 
Interesting...
Loyal Member
Joined
Oct 25, 2008
Messages
1,372
Reaction score
604
This is the main reason why the Maplestory section will never progress.

Or because most developers are arrogant, just want an e-penis, or are just plain selfish when it comes to releasing their work.

I'm pretty sure there are a TON of things out there that would help the community progress that are unreleased for these reasons.

But I guess that's just how the world works, right?
 
Legendary Battlemage
Loyal Member
Joined
Dec 13, 2010
Messages
649
Reaction score
140
I liked this idea a lot (although I'm fairly certain there's a very similar release), but I didn't really like your npc ;(
I made my own, and decided to post it here for you to learn from or other people to use or w/e. I hope somebody will make use of this. Runs perfectly. Enjoy.
PHP:
/**
 *
 * @author Sharky
 */
var status = -1;
var level35 = [[1452016], [1472030], [1462014], [1302020], [1382009], [1492020], [1482020]];
var level43from35 = [[1452022], [1472032], [1462019], [1302030], [1382012], [1492021], [1482021]];
var level43 = [[1452022], [1472032], [1462019], [1332025], [1412011], [1422014], [1302030], [1442024], [1432012], [1382012], [1492021], [1482021]];
var level64 = [[1452045], [1472055], [1462040], [1332055, 1332056], [1412027, 1312032], [1422029, 1322054], [1302064, 1402039], [1442051], [1432040], [1382039, 1372034], [1492022], [1482022]];
var sel;
var sel_2;

function start(){
	cm.sendSimple("Sawp, I can upgrade your Maple Weapons for ya, for a fee. It's 2000 Maple Leaves to upgrade from a lvl 35 weapon to a lvl 43, and 1500 to upgrade from a lvl 43 weapon to a lvl 64. \r\n\t#dWhich level Maple Weapon do you want to upgrade?#b \r\n\t#L0#Level 35 Weapons#l \r\n\t#L1#Level 43 Weapons#l");
}

function action(m,t,s){
	status++;
	if(m != 1){
		cm.dispose();
		return;
	}
	if(status == 0){
		sel = s;
		if(s == 0){
			cm.sendSimple("Which type of level 35 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
		} else {
			cm.sendSimple("Which type of level 43 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Dagger#l \r\n\t#L4#Axe#l \r\n\t#L5#Mace#l \r\n\t#L6#Sword#l \r\n\t#L7#Pole Arm#l \r\n\t#L8#Spear#l \r\n\t#L9#Staff#l \r\n\t#L10#Gun#l \r\n\t#L11#Knuckle#l");
		}
	} else if (status == 1){
		if(cm.haveItem((sel == 0 ? level35[s][0] : level43[s][0]), 1)) {
			if(sel == 0){
				cm.sendYesNo("I see you have a #d#t"+ level35[s][0] +"##k. Would you like to upgrade it to a #d#t"+ level43from35[s][0] +"##k for 2000 Maple Leaves?");
			} else {
				cm.sendSimple("I see you have a #d#t"+ level43[s][0] +"##k. Would you like to upgrade it to one of the following options for 1500 Maple Leaves? \r\n\t"+ (level64[s].length < 2 ? "#L0##b#t" + level64[s][0] +"##k#l" : "#L0##b#t" + level64[s][0] +"##k#l \r\n\t#L1##b#t"+ level64[s][1] +"##k#l"));
			}
			sel_2 = sel;
			sel = s;
		} else {
			cm.sendOk("You don't seem to have a Maple Weapon in that category.");
			cm.dispose();
		}
	} else if (status == 2){
		if(cm.haveItem(4001126, (sel_2 == 0 ? 2000 : 1500))){
			cm.gainItem((sel_2 == 0 ? level35[sel][0] : level43[sel][0]), -1);
			cm.gainItem(4001126, -(sel_2 == 0 ? 2000 : 1500));
			cm.gainItem((sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]));
			cm.sendOk("Thank you for upgrading your Maple Weapon from a #d#t"+ (sel_2 == 0 ? level35[sel][0] : level43[sel][0]) +"##k to a #d#t"+ (sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]) +"##k. Come again!");
		} else {
			cm.sendOk("You only have #d#c4001126# #t4001126## Maple Leaves#k. Come back when you have #d"+ (sel_2 == 0 ? 2000 : 1500) +" Maple Leaves#k.");
		}
		cm.dispose();
	}
}


Atta boy :)
 
Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
I liked this idea a lot (although I'm fairly certain there's a very similar release), but I didn't really like your npc ;(
I made my own, and decided to post it here for you to learn from or other people to use or w/e. I hope somebody will make use of this. Runs perfectly. Enjoy.
PHP:
/**
 *
 * @author Sharky
 */
var status = -1;
var level35 = [[1452016], [1472030], [1462014], [1302020], [1382009], [1492020], [1482020]];
var level43from35 = [[1452022], [1472032], [1462019], [1302030], [1382012], [1492021], [1482021]];
var level43 = [[1452022], [1472032], [1462019], [1332025], [1412011], [1422014], [1302030], [1442024], [1432012], [1382012], [1492021], [1482021]];
var level64 = [[1452045], [1472055], [1462040], [1332055, 1332056], [1412027, 1312032], [1422029, 1322054], [1302064, 1402039], [1442051], [1432040], [1382039, 1372034], [1492022], [1482022]];
var sel;
var sel_2;

function start(){
    cm.sendSimple("Sawp, I can upgrade your Maple Weapons for ya, for a fee. It's 2000 Maple Leaves to upgrade from a lvl 35 weapon to a lvl 43, and 1500 to upgrade from a lvl 43 weapon to a lvl 64. \r\n\t#dWhich level Maple Weapon do you want to upgrade?#b \r\n\t#L0#Level 35 Weapons#l \r\n\t#L1#Level 43 Weapons#l");
}

function action(m,t,s){
    status++;
    if(m != 1){
        cm.dispose();
        return;
    }
    if(status == 0){
        sel = s;
        if(s == 0){
            cm.sendSimple("Which type of level 35 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
        } else {
            cm.sendSimple("Which type of level 43 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Dagger#l \r\n\t#L4#Axe#l \r\n\t#L5#Mace#l \r\n\t#L6#Sword#l \r\n\t#L7#Pole Arm#l \r\n\t#L8#Spear#l \r\n\t#L9#Staff#l \r\n\t#L10#Gun#l \r\n\t#L11#Knuckle#l");
        }
    } else if (status == 1){
        if(cm.haveItem((sel == 0 ? level35[s][0] : level43[s][0]), 1)) {
            if(sel == 0){
                cm.sendYesNo("I see you have a #d#t"+ level35[s][0] +"##k. Would you like to upgrade it to a #d#t"+ level43from35[s][0] +"##k for 2000 Maple Leaves?");
            } else {
                cm.sendSimple("I see you have a #d#t"+ level43[s][0] +"##k. Would you like to upgrade it to one of the following options for 1500 Maple Leaves? \r\n\t"+ (level64[s].length < 2 ? "#L0##b#t" + level64[s][0] +"##k#l" : "#L0##b#t" + level64[s][0] +"##k#l \r\n\t#L1##b#t"+ level64[s][1] +"##k#l"));
            }
            sel_2 = sel;
            sel = s;
        } else {
            cm.sendOk("You don't seem to have a Maple Weapon in that category.");
            cm.dispose();
        }
    } else if (status == 2){
        if(cm.haveItem(4001126, (sel_2 == 0 ? 2000 : 1500))){
            cm.gainItem((sel_2 == 0 ? level35[sel][0] : level43[sel][0]), -1);
            cm.gainItem(4001126, -(sel_2 == 0 ? 2000 : 1500));
            cm.gainItem((sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]));
            cm.sendOk("Thank you for upgrading your Maple Weapon from a #d#t"+ (sel_2 == 0 ? level35[sel][0] : level43[sel][0]) +"##k to a #d#t"+ (sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]) +"##k. Come again!");
        } else {
            cm.sendOk("You only have #d#c4001126# #t4001126## Maple Leaves#k. Come back when you have #d"+ (sel_2 == 0 ? 2000 : 1500) +" Maple Leaves#k.");
        }
        cm.dispose();
    }
}


To the guys that can't read. It was my first attempt at an Array NPC.

To sharky, your NPC doesn't do same action. The level 35 items aren't upgrading to level 43 items.

I was trying to achieve this without making the selection page a 5 minute scroll. I wasn't trying to "add to development" and I sure as hell wasn't trying to impress anybody. Yeah, it's sloppy, I get it, but it works nonetheless. And I highly doubt shortening this script up will make the future of MS Development any less dark than it already is. But, since I suppose I won't stop hearing flames and since Sharky's script is easier to edit, and cleaner, I'll update the OP with it. Thanks Sharky.
Code:
Maple Sword+ 2000 Maple Leaves = Maple Glory Sword or Maple Soul Rohen
Maple Soul Singer+ 1500 Maple Leaves = Maple Glory Sword or Maple Soul Rohen
Maple Wagner+ 1500 Maple Leaves = Maple Dark Mate or Maple Asura Dagger
Maple Staff+ 2000 Maple Leaves = Maple Shine Wand or Maple Wisdom Staff
Maple Lama Staff+ 1500 Maple Leaves = Maple Shine Wand or Maple Wisdom Staff
Maple Dragon Axe+ 1500 Maple Leaves = Maple Steel Axe or Maple Demon Axe
Maple Doom Singer+ 1500 Maple Leaves = Maple Havoc Hammer or Maple Belzet
Maple Impaler+ 1500 Maple Leaves = Maple Soul Spear
Maple Scorpio+ 1500 Maple Leaves = Maple Karstan
Maple Bow+ 2000 Maple Leaves = Maple Kandiva Bow
Maple Soul Searcher+ 1500 Maple Leaves = Maple Kandiva Bow
Maple Crow+ 2000 Maple Leaves = Maple Nishada
Maple Crossbow+ 1500 Maple Leaves = Maple Nishada
Maple Claw+ 2000 Maple Leaves = Maple Skanda
Maple Kandayo+ 1500 Maple Leaves = Maple Skanda
Maple Gun+ 2000 Maple Leaves = Maple Canon Shooter
Maple Storm Pistol+ 1500 Maple Leaves = Maple Canon Shooter
Maple Knuckle+ 2000 Maple Leaves = Maple Golden Claw
Maple Storm Finger+ 1500 Maple Leaves = Maple Golden Claw
 
Last edited:
Skilled Illusionist
Joined
Dec 16, 2010
Messages
304
Reaction score
164
Nooooooo don't update it with my script X_X bleh. That's pointless, keep yours please <3 I just posted it so maybe you could learn =/
And in my script the level 35 weapons upgrade, not sure what you were saying there, and also, it's not a huge thing of selections, I find it's very neat ._.
And GOOD JOB ON YOUR SCRIPT!
 
Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
Thanks Sharky, finally, positive feedback. Anyway, in my old script the level 35 weapons were upgrading to level 64 weapons not level 43 ones. That's all.
 
Newbie Spellweaver
Loyal Member
Joined
Mar 25, 2008
Messages
71
Reaction score
19
I would, and I understand how you did your arrays. I learned from it, trust me. I went ahead and read through it just to make sure I understood it. Instead of having say, maple sword in there twice for the level 64 1h and 2h you just put [lv641h, lvl642h], etc. It's not a very complicated way of doing it, I just didn't know it existed.
 
Newbie Spellweaver
Joined
Jan 13, 2009
Messages
16
Reaction score
0
PHP:
/**
 *
 * @author Sharky
 */
var status = -1;
var level35 = [[1452016], [1472030], [1462014], [1302020], [1382009], [1492020], [1482020]];
var level43from35 = [[1452022], [1472032], [1462019], [1302030], [1382012], [1492021], [1482021]];
var level43 = [[1452022], [1472032], [1462019], [1332025], [1412011], [1422014], [1302030], [1442024], [1432012], [1382012], [1492021], [1482021]];
var level64 = [[1452045], [1472055], [1462040], [1332055, 1332056], [1412027, 1312032], [1422029, 1322054], [1302064, 1402039], [1442051], [1432040], [1382039, 1372034], [1492022], [1482022]];
var sel;
var sel_2;
var sel_3;

function start(){
    cm.sendSimple("I create and upgrade your Maple Weapons for a fee. It's 1500 Maple Leaves to upgrade from a lvl 35 weapon to a lvl 43, and 2000 to upgrade from a lvl 43 weapon to a lvl 64. \r\n\t#dWhat would you like to do?#b \r\n\t#L0#Upgrade a level 35 weapons#l \r\n\t#L1#Upgrade a level 43 weapon#l \r\n\t#L2#Create a weapon");
}

function action(m,t,s){
    status++;
    if(m != 1){
        cm.dispose();
        return;
    }
    if(status == 0){
        sel = s;
		sel_3 = s3;
        if(s == 0){
            cm.sendSimple("Which type of level 35 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
        } else {
            cm.sendSimple("Which type of level 43 Maple Weapon do you want to upgrade?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Dagger#l \r\n\t#L4#Axe#l \r\n\t#L5#Mace#l \r\n\t#L6#Sword#l \r\n\t#L7#Pole Arm#l \r\n\t#L8#Spear#l \r\n\t#L9#Staff#l \r\n\t#L10#Gun#l \r\n\t#L11#Knuckle#l");
        } 
		if(s3 == 0){
			cm.sendSimple("Which Maple weapon would you like to create?#r \r\n\t#L0#Bow#l \r\n\t#L1#Claw#l \r\n\t#L2#Crossbow#l \r\n\t#L3#Sword#l \r\n\t#L4#Staff#l \r\n\t#L5#Gun#l \r\n\t#L6#Knuckle#l");
		}
    } else if (status == 1){
        if(cm.haveItem((sel == 0 ? level35[s][0] : level43[s][0]), 1)) {
            if(sel == 0){
                cm.sendYesNo("I see you have a #d#t"+ level35[s][0] +"##k. Would you like to upgrade it to a #d#t"+ level43from35[s][0] +"##k for 1500 Maple Leaves?");
            } else {
                cm.sendSimple("I see you have a #d#t"+ level43[s][0] +"##k. Would you like to upgrade it to one of the following options for 2000 Maple Leaves? \r\n\t"+ (level64[s].length < 2 ? "#L0##b#t" + level64[s][0] +"##k#l" : "#L0##b#t" + level64[s][0] +"##k#l \r\n\t#L1##b#t"+ level64[s][1] +"##k#l"));
            }
			sel_2 = sel;
            sel = s;
		} 
		else if(cm.haveItem(4001126, 1) {
			if(sel_3 = 0){
			cm.sendYesNo("I see you have #d#c4001126# Maple Leaves#k. Would you like to create "+ level35[s3][0] +"?");
			} else {
            cm.sendOk("Seems like you don't have enough resources.");
            cm.dispose();
			}
		} else {
		cm.sendOk("No? Okay, come back next time!");
        cm.dispose();
		}
    } else if (status == 2){
        if(cm.haveItem(4001126, (sel_2 == 0 ? 1500 : 2000))){
            cm.gainItem((sel_2 == 0 ? level35[sel][0] : level43[sel][0]), -1);
            cm.gainItem(4001126, -(sel_2 == 0 ? 1500 : 2000));
            cm.gainItem((sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]));
            cm.sendOk("Thank you for upgrading your Maple Weapon from a #d#t"+ (sel_2 == 0 ? level35[sel][0] : level43[sel][0]) +"##k to a #d#t"+ (sel_2 == 0 ? level43from35[sel][0] : level64[sel][s]) +"##k. Come again!");
		} 
		else if(cm.haveItem(4001126, 1000)) {
			cm.gainItem(4001126, -1000);
			cm.gainItem(level35[s3][0]));
			cm.sendOk("You created your Maple Weapon #d#t"+ level35[s3][0] +"#k."));
        } else {
            cm.sendOk("You only have #d#c4001126# #t4001126## Maple Leaves#k. Come back when you have #d"+ (sel_2 == 0 ? 1500 : 2000) +" Maple Leaves#k.");
        }
        cm.dispose();
    }
}

This is code I came up with. The NPC won't work though, I a bunch of different approaches but I just can't seem to get it working. What I'm trying to do is add a create a weapon for 1000 leafs. Any ideas? :S
 
Back
Top