Newbie Spellweaver
- Joined
- Apr 26, 2008
- Messages
- 10
- Reaction score
- 0
These are some of the NPC I coded a while back. I thought I would just share them :winky:
Sera
Gives you the option of which town you want to start in. Also gives you the following items:
and 1 million mesos
Level Seller
Sera
Gives you the option of which town you want to start in. Also gives you the following items:
Code:
/* Sera
First NPC on Map 0
*/
var wui = 0;
function start() {
cm.sendSimple ("Welcome to the world of MapleStory. Were would you like to start your adventure? \r\n#L0##bLith Harbor#k #l\r\n#L1##bHenesys#k #l\r\n#L2##bEllinia#k #l\r\n#L3##bPerion#k #l\r\n#L4##bKerning City#k #l");
}
function action(mode, type, selection) {
cm.dispose();
if (selection == 0) {
cm.warp(104000000,0);
cm.gainMeso(1000000);
cm.gainItem(01462039,1);
cm.gainItem(1452044,1);
cm.gainItem(01472052,1);
cm.gainItem(1382036,1);
cm.gainItem(1442002,1);
cm.gainItem(1332050,1);
} else if (selection == 1) {
cm.warp(100000000,0);
cm.gainMeso(1000000);
cm.gainItem(01462039,1);
cm.gainItem(1452044,1);
cm.gainItem(01472052,1);
cm.gainItem(1382036,1);
cm.gainItem(1442002,1);
cm.gainItem(1332050,1);
} else if (selection == 2) {
cm.warp(101000000,0);
cm.gainMeso(1000000);
cm.gainItem(01462039,1);
cm.gainItem(1452044,1);
cm.gainItem(01472052,1);
cm.gainItem(1382036,1);
cm.gainItem(1442002,1);
cm.gainItem(1332050,1);
} else if (selection == 3) {
cm.warp(102000000,0);
cm.gainMeso(1000000);
cm.gainItem(01462039,1);
cm.gainItem(1452044,1);
cm.gainItem(01472052,1);
cm.gainItem(1382036,1);
cm.gainItem(1442002,1);
cm.gainItem(1332050,1);
} else if (selection == 4) {
cm.warp(103000000,0);
cm.gainMeso(1000000);
cm.gainItem(01462039,1);
cm.gainItem(1452044,1);
cm.gainItem(01472052,1);
cm.gainItem(1382036,1);
cm.gainItem(1442002,1);
cm.gainItem(1332050,1);
cm.dispose();
}
if (mode == 0 || wui == 1) {
cm.dispose();
} else {
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);
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.sendOk ("Ok,let the training begin!");
}
}
Level Seller
Code:
/*
@
@ NPC = NAME
@ Map = MAP
@ NPC MapId = MAPID
@ Function = Level Up
@
*/
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 #bLevel Up#k.");
cm.dispose();
}else{ //Regular Talk
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendYesNo("Welcome, I can help you on your journey. Would you like to #rLevel Up#k for 800 million mesos?");
}else if (status == 1) {
if (cm.getMeso() < 800000000) {
cm.sendOk("You do not have enough mesos.")
cm.dispose();
}else{
cm.sendOk("you have been qualified for a Level Up.");
}
}else if (status == 2) {
wui = 1;
var statup = new java.util.ArrayList();
var p = cm.c.getPlayer();
cm.gainExp(2121276324);
cm.gainMeso(-800000000);
cm.sendNext("You have leveled up! Good luck on your next journey.");
p.getClient().getSession().write (net.sf.odinms.tools.MaplePacketCreator.updatePlayerStats(statup));
cm.dispose();
}
}
}