- Joined
- Apr 10, 2008
- Messages
- 4,094
- Reaction score
- 1,271
So Kevin wanted me to do this for MoopleDEV, and I did this. This is fully GMS - Like (almost, gotta work on the event of NLC ride) text, features, etc, etc.
The Ticket Gate (1052007).
Copy this as a text, save as 1052007.js
to your NPC scripts.
Now to portals. Save each one in the name
of it .js in the 'portal' in scripts.
Back to Kerning City (Depart_ToKerning).
Ride to Kerning Square (subway_in2).
And now, add those to your MapleCharacter.
Credits: BloodAngel13: Shortening all of this.
Havefun
.
Going to make NLC ride soon.
:
The Ticket Gate (1052007).
Copy this as a text, save as 1052007.js
to your NPC scripts.
PHP:
/* @Author Gilbert.
Name: Kerning subway portal.
Map(s): Kerning City Subway (103000100).
Info: Portal to enter subway.
*/
var tickets = Array(4031036, 4031037, 4031038);
var maps = Array(103000900, 103000903, 103000906);
var mapnames = Array("Construction Site B1", "Construction Site B2", "Construction Site B3");
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}
else {
if (mode == 0) {
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendSimple("Please select your desired destination.\r\n#b#L0##eSubway Line 1 Area 1 #r(caution: Striges, Wraiths etc.)#n#b#l\r\n#L1#Kerning Square Shopping Center (ride subway)#l\r\n\r\n#L2#Construction Site#l\r\n#L3#New Leaf City#l#k");
} else if (status == 1) {
if (selection == 0) {
cm.warp(103000101);
cm.dispose();
} else if (selection == 1) {
cm.getPlayer().timedRide(103000300, 103000310, "The next stop is at Kerning Square Station. The exit is on your left.", 10000);
cm.dispose();
} else if (selection == 2) {
if (!cm.haveItem(4031711) && !cm.haveItem(4031036) && !cm.haveItem(4031037)) {
cm.sendOk("Here's the ticket reader. You are not allowed in without the ticket.");
cm.dispose();
} else {
menu = "Here's the ticket reader. You will be brought in immediately. Which ticket would you like to use?";
for (i = 0; i < tickets.length; i++) {
if (cm.haveItem(tickets[i])) {
menu += "\r\n#b#L" + i +"##b" + mapnames[i] + "#k#l\r\n";
}
}
cm.sendSimple(menu);
}
} else if (selection == 3) {
cm.sendOk("RING THE BELLZ");
cm.dispose();
} else if (status == 2) {
if (selection < 3) {
cm.gainItem(tickets[selection], -1);
cm.warp(maps[selection]);
cm.dispose();
}
}
}
}
Now to portals. Save each one in the name
of it .js in the 'portal' in scripts.
Back to Kerning City (Depart_ToKerning).
PHP:
/*
Original name: Depart_ToKerning.
Map(s): Kerning Square Station (103000310).
Duties: Takes you back to kerning from kerning square.
*/
function enter(pi) {
pi.getPlayer().timedRide(103000300, 103000100, "The next stop is at Kerning Subway Station. The exit is on your left.", 10000);
return true;
}
Ride to Kerning Square (subway_in2).
PHP:
/*
Original name: subway_in2.
Map(s): Kerning Subway Station (103000100).
Duties: Opens the ticket reader gate NPC.
*/
function enter(pi) {
pi.openNpc(1052007);
return true;
}
And now, add those to your MapleCharacter.
Credits: BloodAngel13: Shortening all of this.
PHP:
public void timedRide(int startMap, final int endMap, String message, int clockTime) {
client.getPlayer().changeMap(client.getChannelServer().getMapFactory().getMap(startMap));
getMap().broadcastMessage(MaplePacketCreator.getClock(clockTime));
getMap().broadcastMessage(MaplePacketCreator.earnTitleMessage(message));
dropMessage(6, message);
TimerManager.getInstance().schedule(new Runnable() {
public void run() {
client.getPlayer().changeMap(client.getChannelServer().getMapFactory().getMap(endMap));
}
}, clockTime);
}
Havefun
Going to make NLC ride soon.
Last edited by a moderator:

