Small Fix on NPCs and Portal. (#6)

Fixed:
* Irene, Shalon now check your mesos and only sells you (1) ticket. If you've more than (1) ticket, you can't buy another one.
* Xinga, Kerny, the Pilots, now stating correct places when you're on airplane and airports.
* The portal to get in to Ariant Castle now needs (1) Entry Pass to get in.
This commit is contained in:
Jayden Seah
2017-05-10 07:39:27 +08:00
committed by ronancpl
parent 73557f0d61
commit ab31f3d487
5 changed files with 340 additions and 0 deletions

53
9270017.js Normal file
View File

@@ -0,0 +1,53 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Xinga - Pilot
-- By ---------------------------------------------------------------------------------------------
Information
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Information
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
var status = 0;
function start() {
cm.sendYesNo("The plane will be taking off soon, will you leave now? You will have to buy the plane ticket again to come in here.");
}
function action(mode, type, selection) {
if (mode != 1) {
if (mode == 0)
cm.sendOk("Please hold on for a sec, and plane will be taking off. Thanks for your patience.");
cm.dispose();
return;
}
status++;
if (status == 1) {
cm.sendNext("The ticket is not refundable, hope to see you again!");
} else if(status == 2){
cm.warp(103000000);
cm.dispose();
}
}

86
9270018.js Normal file
View File

@@ -0,0 +1,86 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Kerny - Pilot
-- By ---------------------------------------------------------------------------------------------
Information
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Information
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
var k2s;
var airport;
var s2k;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if(mode == -1) {
cm.dispose();
return;
}
if(mode == 1) {
status++;
}
if(mode == 0) {
if (cm.getMapId() == 540010101) {
cm.sendOk("Please hold on for a sec, and we're reaching Singapore! Thanks for your patience.");
cm.dispose();
return;
} else {
cm.sendOk("Please hold on for a sec, and we're reaching Kerning City! Thanks for your patience.");
cm.dispose();
return;
}
}
if(status == 0) {
if (cm.getMapId() == 540010001) {
cm.sendYesNo("The plane is taking off soon, are you sure you want to leave now? The ticket is not refundable.");
airport = 1;
} else if (cm.getMapId() == 540010002) {
cm.sendYesNo("We're reaching Kerning City in a minute, are you sure you want to leave now? The ticket is not refundable.");
s2k = 1;
} else if (cm.getMapId() == 540010101) {
cm.sendYesNo("We're reaching Singapore in a minute, are you sure you want to leave now? The ticket is not refundable.");
k2s = 1;
}
} else if(status == 1) {
if (k2s == 1) {
cm.warp(103000000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (airport == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
} else if (s2k == 1) {
cm.warp(540010000);
cm.sendOk("Hope to see you again soon!");
cm.dispose();
}
}
}

80
9270038.js Normal file
View File

@@ -0,0 +1,80 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Shalon - Ticketing Usher
-- By ---------------------------------------------------------------------------------------------
Whoever written this script
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by whoever written this script
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
status = -1;
oldSelection = -1;
function start() {
cm.sendSimple("Hello, I am Shalon from Singapore Airport. I can assist you in getting you to Kerning City in no time. Do you want to go to Kerning City?\r\n#b#L0#I would like to buy a plane ticket to Kerning City\r\n#b#L1#Let me go in to the departure point.");
}
function action(mode, type, selection) {
status++;
if (mode <= 0){
oldSelection = -1;
cm.dispose();
}
if(status == 0){
if(selection == 0){
cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?");
}else if(selection == 1){
cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline.");
}
oldSelection = selection;
}else if(status == 1){
if(oldSelection == 0){
if (cm.getPlayer().getMeso() > 4999 && cm.getPlayer().haveItem(4031732) == false) {
cm.gainMeso(-5000);
cm.gainItem(4031732);
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
cm.dispose();
} else if (cm.getPlayer().getMeso() < 4999 || cm.getPlayer().haveItem(4031732)) {
cm.sendOk("You do not have enough mesos or you've already purchased a ticket.");
cm.dispose();
}
}else if(oldSelection == 1){
if(cm.itemQuantity(4031732) > 0){
var em = cm.getEventManager("AirPlane");
if(em.getProperty("entry") == "true"){
cm.warp(540010001);
cm.gainItem(4031732, -1);
}else{
cm.sendOk("Sorry the plane has taken off, please wait a few minutes.");
}
}else{
cm.sendOk("You need a #b#t4031732##k to get on the plane!");
}
}
cm.dispose();
}
}

80
9270041.js Normal file
View File

@@ -0,0 +1,80 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Irene - Ticketing Usher
-- By ---------------------------------------------------------------------------------------------
Whoever written this script
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by whoever written this script
2.0 - Second Version by Jayd
---------------------------------------------------------------------------------------------------
**/
status = -1;
oldSelection = -1;
function start() {
cm.sendSimple("Hello, I am Irene from Singapore Airport. I can assist you in getting you to Singapore in no time. Do you want to go to Singapore?\r\n#b#L0#I would like to buy a plane ticket to Singapore\r\n#b#L1#Let me go in to the departure point.");
}
function action(mode, type, selection) {
status++;
if (mode <= 0){
oldSelection = -1;
cm.dispose();
}
if(status == 0){
if(selection == 0){
cm.sendYesNo("The ticket will cost you 5,000 mesos. Will you purchase the ticket?");
}else if(selection == 1){
cm.sendYesNo("Would you like to go in now? You will lose your ticket once you go in! Thank you for choosing Wizet Airline.");
}
oldSelection = selection;
}else if(status == 1){
if(oldSelection == 0){
if (cm.getPlayer().getMeso() > 4999 && cm.getPlayer().haveItem(4031731) == false) {
cm.gainMeso(-5000);
cm.gainItem(4031731);
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
cm.dispose();
} else if (cm.getPlayer().getMeso() < 4999 || cm.getPlayer().haveItem(4031731)) {
cm.sendOk("You do not have enough mesos or you've already purchased a ticket.");
cm.dispose();
}
}else if(oldSelection == 1){
if(cm.itemQuantity(4031731) > 0){
var em = cm.getEventManager("AirPlane");
if(em.getProperty("entry") == "true"){
cm.warp(540010100);
cm.gainItem(4031731, -1);
}else{
cm.sendOk("Sorry the plane has taken off, please wait a few minutes.");
}
}else{
cm.sendOk("You need a #b#t4031731##k to get on the plane!");
}
}
cm.dispose();
}
}

41
ariant_castle.js Normal file
View File

@@ -0,0 +1,41 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Portal - To get into Ariant Castle
-- By ---------------------------------------------------------------------------------------------
Jayd
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Jayd
---------------------------------------------------------------------------------------------------
**/
function enter(pi) {
if (pi.getPlayer().haveItem(4031582) == true) {
pi.playPortalSound();
pi.warp(260000301);
return true;
} else {
pi.playerMessage(5, "You can enter only if you have a Entry Pass to the Palace.");
return false;
}
}