NPCs Taxis and Crafters now checks properly
Fixed taxis that wouldn't check for mesos upon travel. Fixed crafters that wouldn't check for inventory slots available before crafting items.
This commit is contained in:
@@ -46,7 +46,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
if (status == 1) {
|
||||
cm.sendYesNo(cm.getJobId() == 0 ? "We have a special 90% discount for beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where the 24 Hr Mobile Store is. Would you like to go there for #b1,000 mesos#k?" : "The regular fee applies for all non-beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where 24 Hr Mobile Store is. Would you like to go there for #b10,000 mesos#k?");
|
||||
cost *= cm.getJobId() == 0 ? 10 : 1;
|
||||
cost /= ((cm.getJobId() == 0) ? 10 : 1);
|
||||
} else if (status == 2) {
|
||||
if (cm.getMeso() < cost)
|
||||
cm.sendNext("It looks like you don't have enough mesos. Sorry but you won't be able to use this without it.")
|
||||
|
||||
@@ -46,17 +46,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -36,17 +36,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -167,21 +167,26 @@ function action(mode, type, selection) {
|
||||
if (!complete)
|
||||
cm.sendOk("Surely you, of all people, would understand the value of having quality items? I can't do that without the items I require.");
|
||||
else {
|
||||
if (cm.canHold(item)) {
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
recvQty = 1000 - (item - 2060000) * 100;
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
recvQty = 1000 - (item - 2061000) * 100;
|
||||
else if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if (cm.canHold(recvItem, recvQty)) {
|
||||
if (mats instanceof Array) {
|
||||
for (var i = 0; i < mats.length; i++)
|
||||
cm.gainItem(mats[i], -(matQty[i] * qty));
|
||||
}else
|
||||
cm.gainItem(mats, -(matQty * qty));
|
||||
cm.gainMeso(-(cost * qty));
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2060000) * 100);
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2061000) * 100);
|
||||
else if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("A perfect item, as usual. Come and see me if you need anything else.");
|
||||
}else {
|
||||
cm.sendOk("Please make sure you have room in your inventory, and talk to me again.");
|
||||
|
||||
@@ -36,17 +36,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ function action(mode, type, selection) {
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, qty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -200,26 +200,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/* if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats[i],matQty[i] * selection)) complete=false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats,matQty * selection)) complete=false;
|
||||
|
||||
} */
|
||||
}
|
||||
if (!complete)
|
||||
cm.sendOk("I'm afraid you're missing something for the item you want. See you another time, yes?");
|
||||
|
||||
@@ -165,8 +165,14 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -186,27 +192,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!cm.haveItem(mats[i],matQty[i]*qty)) complete=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
@@ -223,10 +208,7 @@ function action(mode, type, selection) {
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("Did that come out right? Come by me again if you have anything for me to practice on.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
@@ -36,17 +36,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ function action(mode, type, selection) {
|
||||
else if (status == 3 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -205,26 +205,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!cm.haveItem(mats[i],matQty[i])) complete=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
|
||||
@@ -46,7 +46,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
if (status == 1) {
|
||||
cm.sendYesNo(cm.getJobId() == 0 ? "We have a special 90% discount for beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where the 24 Hr Mobile Store is. Would you like to go there for #b1,000 mesos#k?" : "The regular fee applies for all non-beginners. The Ant Tunnel is located deep inside in the dungeon that's placed at the center of the Victoria Island, where 24 Hr Mobile Store is. Would you like to go there for #b10,000 mesos#k?");
|
||||
cost *= cm.getJobId() == 0 ? 10 : 1;
|
||||
cost /= ((cm.getJobId() == 0) ? 10 : 1);
|
||||
} else if (status == 2) {
|
||||
if (cm.getMeso() < cost)
|
||||
cm.sendNext("It looks like you don't have enough mesos. Sorry but you won't be able to use this without it.")
|
||||
|
||||
@@ -205,8 +205,14 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -226,20 +232,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1)
|
||||
if (!cm.haveItem(mats[i]))
|
||||
complete = false;
|
||||
else
|
||||
if (!cm.haveItem(mats[i],matQty[i])) complete=false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
@@ -254,10 +246,8 @@ function action(mode, type, selection) {
|
||||
cm.gainItem(mats, -matQty * qty);
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("All done. If you need anything else... Well, I'm not going anywhere.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
@@ -161,7 +161,7 @@ function action(mode, type, selection) {
|
||||
} else if (status == 4) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, qty)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -178,18 +178,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*if (mats instanceof Array) {
|
||||
for (var i = 0; complete && i < mats.length; i++) {
|
||||
if (matQty[i] * qty == 1) {
|
||||
complete = cm.haveItem(mats[i]);
|
||||
} else {
|
||||
complete = cm.haveItem(mats[i], matQty[i] * qty);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
complete = cm.haveItem(mats, matQty * qty);
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
|
||||
@@ -36,17 +36,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ function action(mode, type, selection) {
|
||||
else if (status == 3 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -184,24 +184,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++) {
|
||||
if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
complete = false;
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats[i],matQty[i] * selection)) complete=false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats,matQty * selection)) complete=false;
|
||||
|
||||
}*/
|
||||
}
|
||||
if (!complete)
|
||||
cm.sendOk("Sorry, but I have to have those items to get this exactly right. Perhaps next time.");
|
||||
|
||||
@@ -35,17 +35,19 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[selection] + "##k? It'll cost you #b"+ (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection]) + " mesos#k.");
|
||||
selectedMap = selection;
|
||||
} else if (status == 3) {
|
||||
if (cm.getMeso() < (cm.getJobId() == 0 ? cost[selection] / 10 : cost[selection])) {
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = cost[selectedMap];
|
||||
}
|
||||
|
||||
if (cm.getMeso() < mesos) {
|
||||
cm.sendNext("You don't have enough mesos. Sorry to say this, but without them, you won't be able to ride the cab.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.getJobId() == 0) {
|
||||
mesos = -cost[selectedMap] / 10;
|
||||
} else {
|
||||
mesos = -cost[selectedMap];
|
||||
}
|
||||
cm.gainMeso(mesos);
|
||||
|
||||
cm.gainMeso(-mesos);
|
||||
cm.warp(maps[selectedMap], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ function action(mode, type, selection) {
|
||||
else if (status == 3 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -177,24 +177,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats[i],matQty[i])) complete=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!cm.haveItem(mats,matQty)) complete=false;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
|
||||
@@ -86,6 +86,7 @@ function action(mode, type, selection) {
|
||||
for (var i = 0; i < items.length; i++){
|
||||
selStr += "\r\n#L" + i + "# " + items[i] + "#l";
|
||||
}
|
||||
equip = false;
|
||||
cm.sendSimple(selStr);
|
||||
}
|
||||
else if (selectedType == 3){ //crystal refine
|
||||
@@ -176,8 +177,7 @@ function action(mode, type, selection) {
|
||||
cm.sendGetNumber(prompt,1,1,100)
|
||||
}
|
||||
else if (status == 3 && mode == 1) {
|
||||
if (equip)
|
||||
{
|
||||
if (equip) {
|
||||
selectedItem = selection;
|
||||
qty = 1;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ function action(mode, type, selection) {
|
||||
if (selectedType == 5){ //arrow refine
|
||||
var itemSet = new Array(2060000,2061000,2060001,2061001,2060002,2061002);
|
||||
var matSet = new Array(new Array (4003001,4003004),new Array (4003001,4003004),new Array (4011000,4003001,4003004),new Array (4011000,4003001,4003004),
|
||||
new Array (4011001,4003001,4003005),new Array (4011001,4003001,4003005));
|
||||
new Array (4011001,4003001,4003005),new Array (4011001,4003001,4003005));
|
||||
var matQtySet = new Array (new Array (1,1),new Array (1,1),new Array (1,3,10),new Array (1,3,10),new Array (1,5,15),new Array (1,5,15));
|
||||
var costSet = new Array (0,0,0,0,0,0);
|
||||
item = itemSet[selectedItem];
|
||||
@@ -219,59 +219,58 @@ function action(mode, type, selection) {
|
||||
cm.sendYesNo(prompt);
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if (cm.getMeso() < cost * qty)
|
||||
{
|
||||
cm.sendOk("I'm afraid you cannot afford my services.")
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) {//bow arrows
|
||||
recvQty = 1000 - (item - 2060000) * 100;
|
||||
}
|
||||
else if (item >= 2061000 && item <= 2061002) {//xbow arrows
|
||||
recvQty = 1000 - (item - 2061000) * 100;
|
||||
}
|
||||
else if (item == 4003000) {//screws
|
||||
recvQty = 15 * qty;
|
||||
}
|
||||
else {
|
||||
recvQty = qty;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++)
|
||||
{
|
||||
if (matQty[i] * qty == 1) {
|
||||
if (!cm.haveItem(mats[i]))
|
||||
{
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cm.haveItem(matQty[i]*qty))complete=false;
|
||||
|
||||
}
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("I'm afraid you don't have a slot available for the item in your inventory.");
|
||||
} else if (cm.getMeso() < cost * qty) {
|
||||
cm.sendOk("I'm afraid you cannot afford my services.");
|
||||
} else {
|
||||
var complete = true;
|
||||
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++) {
|
||||
if (!cm.haveItem(mats[i], matQty[i] * qty))
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cm.haveItem(matQty*qty))complete=false;
|
||||
|
||||
if (!cm.haveItem(mats, matQty * qty))
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!complete)
|
||||
cm.sendOk("I can't refine anything for you without the proper items.");
|
||||
else {
|
||||
if (mats instanceof Array) {
|
||||
for (var i = 0; i < mats.length; i++){
|
||||
cm.gainItem(mats[i], -matQty[i] * qty);
|
||||
|
||||
if (!complete)
|
||||
cm.sendOk("I can't refine anything for you without the proper items.");
|
||||
else {
|
||||
if (mats instanceof Array) {
|
||||
for (var i = 0; i < mats.length; i++){
|
||||
cm.gainItem(mats[i], -matQty[i] * qty);
|
||||
}
|
||||
}
|
||||
else
|
||||
cm.gainItem(mats, -matQty * qty);
|
||||
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("All done. If you need anything else, just ask.");
|
||||
}
|
||||
else
|
||||
cm.gainItem(mats, -matQty * qty);
|
||||
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2060000) * 100);
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2061000) * 100);
|
||||
else if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.sendOk("All done. If you need anything else, just ask.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ function action(mode, type, selection) {
|
||||
else if (status == 3 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -176,21 +176,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++){
|
||||
if (matQty[i] == 1){
|
||||
if (!cm.haveItem(mats[i]))
|
||||
complete = false;
|
||||
}
|
||||
else if (!cm.haveItem(mats[i],matQty[i]))
|
||||
complete=false;
|
||||
}
|
||||
}
|
||||
|
||||
else if (!cm.haveItem(mats,matQty))
|
||||
complete=false;
|
||||
*/
|
||||
}
|
||||
if (!complete)
|
||||
cm.sendOk("I only make quality goods, which I cannot do without the proper materials.");
|
||||
|
||||
@@ -47,12 +47,18 @@ function action(mode, type, selection) {
|
||||
cm.sendGetNumber("Okay, so how many do you want me to make?", 1, 1, 100);
|
||||
else if (status == 2) {
|
||||
var complete = true;
|
||||
|
||||
if (cm.getMeso() < 500000 * selection){
|
||||
cm.sendOk("I'm sorry, but I am NOT doing this for free.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (!cm.haveItem(4004004, 10 * selection))
|
||||
} else if (!cm.haveItem(4004004, 10 * selection)) {
|
||||
complete = false;
|
||||
} else if(!cm.canHold(4005004, selection)) {
|
||||
cm.sendOk("Are you having trouble with no empty slots on your inventory? Sort that out first!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (!complete)
|
||||
cm.sendOk("I need that ore to refine the Crystal. No exceptions..");
|
||||
else {
|
||||
|
||||
@@ -222,10 +222,23 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 4 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if (cm.getMeso() < cost * qty)
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
recvQty = 1000 - (item - 2060000) * 100;
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
recvQty = 1000 - (item - 2061000) * 100;
|
||||
else if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("I'm afraid you have no slots available for this transaction.");
|
||||
}
|
||||
else if (cm.getMeso() < cost * qty)
|
||||
{
|
||||
cm.sendOk("I'm afraid you cannot afford my services.")
|
||||
cm.sendOk("I'm afraid you cannot afford my services.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -262,14 +275,7 @@ function action(mode, type, selection) {
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2060000) * 100);
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2061000) * 100);
|
||||
else if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("All done. If you need anything else, you know where to find me.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
@@ -220,7 +220,7 @@ function action(mode, type, selection) {
|
||||
} else if (status == 3) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -238,23 +238,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++) {
|
||||
if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i])) {
|
||||
complete = false;
|
||||
}
|
||||
} else {
|
||||
if (!cm.haveItem(mats[i],matQty[i] * selection))
|
||||
complete=false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!cm.haveItem(mats,matQty * selection))
|
||||
complete=false;
|
||||
}*/
|
||||
}
|
||||
if (stimulator){ //check for stimulator
|
||||
if (!cm.haveItem(stimID)) {
|
||||
|
||||
@@ -159,12 +159,12 @@ function action(mode, type, selection) {
|
||||
} else if (status == 3) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
else if (cm.getMeso() < (cost)){
|
||||
else if (cm.getMeso() < cost){
|
||||
cm.sendOk("Sorry, we only accept meso.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -177,22 +177,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/*
|
||||
if (mats instanceof Array) {
|
||||
for (var i = 0; complete && i < mats.length; i++) {
|
||||
if (matQty[i] == 1){
|
||||
if (!cm.haveItem(mats[i]))
|
||||
complete = false;
|
||||
} else {
|
||||
if (!cm.haveItem(mats[i],matQty[i]))
|
||||
complete=false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!cm.haveItem(mats,matQty))
|
||||
complete=false;
|
||||
}*/
|
||||
}
|
||||
if (stimulator){ //check for stimulator
|
||||
if (!cm.haveItem(stimID)) {
|
||||
@@ -213,7 +197,7 @@ function action(mode, type, selection) {
|
||||
cm.gainItem(stimID, -1);
|
||||
var deleted = Math.floor(Math.random() * 10);
|
||||
if (deleted != 0) {
|
||||
addRandomItem(item);
|
||||
cm.gainItem(item, 1, true, true);
|
||||
cm.sendOk("There, the shoes are ready. Be careful, they're still hot.");
|
||||
} else {
|
||||
cm.sendOk("Eek! I think I accidently added too much stimulator and, well, the whole thing is unusable now... Sorry, but I can't offer a refund.");
|
||||
|
||||
@@ -197,10 +197,13 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 3 && mode == 1) {
|
||||
var complete = true;
|
||||
|
||||
if (cm.getMeso() < cost)
|
||||
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Verify for a slot in your inventory first.");
|
||||
}
|
||||
else if (cm.getMeso() < cost)
|
||||
{
|
||||
cm.sendOk("I'm afraid my fees are non-negotiable.")
|
||||
cm.sendOk("I'm afraid my fees are non-negotiable.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -247,7 +250,7 @@ function action(mode, type, selection) {
|
||||
var deleted = Math.floor(Math.random() * 10);
|
||||
if (deleted != 0)
|
||||
{
|
||||
addRandomItem(item);
|
||||
cm.gainItem(item, 1, true, true);
|
||||
cm.sendOk("Heeere you go! What do you think? Marvellous, isn't it?");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -182,7 +182,7 @@ function action(mode, type, selection) {
|
||||
} else if (status == 3) {
|
||||
var complete = true;
|
||||
|
||||
if(!cm.canHold(item)) {
|
||||
if(!cm.canHold(item, 1)) {
|
||||
cm.sendOk("Check your inventory for a free slot first.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -199,23 +199,6 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/* if (mats instanceof Array) {
|
||||
for(var i = 0; complete && i < mats.length; i++) {
|
||||
if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i])) {
|
||||
complete = false;
|
||||
}
|
||||
} else {
|
||||
if (!cm.haveItem(mats[i], matQty[i]))
|
||||
complete=false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!cm.haveItem(mats,matQty))
|
||||
complete=false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (stimulator){ //check for stimulator
|
||||
if (!cm.haveItem(stimID)) {
|
||||
|
||||
@@ -210,41 +210,17 @@ function action(mode, type, selection) {
|
||||
for(var i = 0; i < mats.length; i++) {
|
||||
if(!cm.haveItem(mats[i], matQty[i]))
|
||||
complete = false;
|
||||
|
||||
/* if (matQty[i] == 1) {
|
||||
if (!cm.haveItem(mats[i])) {
|
||||
complete = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var count = 0;
|
||||
var iter = cm.getInventory(4).listById(mats[i]).iterator();
|
||||
while (iter.hasNext()) {
|
||||
count += iter.next().getQuantity();
|
||||
}
|
||||
if (count < matQty[i])
|
||||
complete = false;
|
||||
} */
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!cm.haveItem(mats, matQty))
|
||||
complete = false;
|
||||
|
||||
/* var count = 0;
|
||||
var iter = cm.getInventory(4).listById(mats).iterator();
|
||||
while (iter.hasNext()) {
|
||||
count += iter.next().getQuantity();
|
||||
}
|
||||
if (count < matQty)
|
||||
complete = false;
|
||||
*/
|
||||
}
|
||||
|
||||
if(java.lang.Math.random() >= 0.9) //A lucky find! Scroll 60%
|
||||
item += 1;
|
||||
|
||||
if (!complete || !cm.canHold(item))
|
||||
if (!complete || !cm.canHold(item, 1))
|
||||
cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your use inventory.");
|
||||
else {
|
||||
if (mats instanceof Array) {
|
||||
@@ -255,7 +231,7 @@ function action(mode, type, selection) {
|
||||
else
|
||||
cm.gainItem(mats, -matQty);
|
||||
|
||||
cm.gainItem(item);
|
||||
cm.gainItem(item, 1);
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
@@ -265,16 +241,7 @@ function action(mode, type, selection) {
|
||||
|
||||
if(!cm.haveItem(item, 100))
|
||||
complete = false;
|
||||
|
||||
/* var count = 0;
|
||||
var iter = cm.getInventory(4).listById(item).iterator();
|
||||
while (iter.hasNext()) {
|
||||
count += iter.next().getQuantity();
|
||||
}
|
||||
if (count < 100)
|
||||
complete = false;
|
||||
*/
|
||||
|
||||
|
||||
if(!complete) {
|
||||
cm.sendOk("Please make sure you are neither lacking ingredients or lacking space in your etc inventory.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -146,10 +146,23 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 5 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
recvQty = 1000 - (item - 2060000) * 100;
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
recvQty = 1000 - (item - 2061000) * 100;
|
||||
else if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if (cm.getMeso() < cost * qty)
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("I'm afraid you are short in inventory slots for this.");
|
||||
}
|
||||
else if (cm.getMeso() < cost * qty)
|
||||
{
|
||||
cm.sendOk("I'm afraid you cannot afford my services.")
|
||||
cm.sendOk("I'm afraid you cannot afford my services.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,14 +201,7 @@ function action(mode, type, selection) {
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2060000) * 100);
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2061000) * 100);
|
||||
else if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("There, finished. What do you think, a piece of art, isn't it? Well, if you need anything else, you know where to find me.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
@@ -41,6 +41,7 @@ function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
if (cm.getMeso() < 1500) {
|
||||
cm.sendNext("I am sorry, but I think you are short on mesos. I am afraid I can't let you ride this if you do not have enough money to do so. Please come back when you have enough money to use this.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.warp(cm.getPlayer().getMapId() == 260020000 ? 261000000 : 260000000, 0);
|
||||
cm.gainMeso(-1500);
|
||||
|
||||
@@ -89,7 +89,7 @@ function action(mode, type, selection) {
|
||||
if (cm.getMeso() < cost * qty) {
|
||||
cm.sendOk("Come on! We're not here doing you a favor! We all need money to live properly, so bring the cash so we make deal and start the synthesis.");
|
||||
}
|
||||
else if(!cm.canHold(item)) {
|
||||
else if(!cm.canHold(item, qty)) {
|
||||
cm.sendOk("You didn't check if you got a slot to spare on your inventory before our business, no?");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -177,11 +177,11 @@ function action(mode, type, selection) {
|
||||
if (!complete)
|
||||
cm.sendOk("Are you sure you got all the items required? Double check it!");
|
||||
else {
|
||||
if (cm.canHold(item)) {
|
||||
if (cm.canHold(item, qty)) {
|
||||
if (mats instanceof Array) {
|
||||
for (var i = 0; i < mats.length; i++)
|
||||
cm.gainItem(mats[i], -(matQty[i] * qty));
|
||||
}else
|
||||
} else
|
||||
cm.gainItem(mats, -(matQty * qty));
|
||||
cm.gainMeso(-(cost * qty));
|
||||
|
||||
|
||||
@@ -26,13 +26,14 @@
|
||||
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 buy the plane ticket again to come in here.");
|
||||
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) {
|
||||
@@ -44,9 +45,9 @@ function action(mode, type, selection) {
|
||||
}
|
||||
status++;
|
||||
if (status == 1) {
|
||||
cm.sendNext("I have already told you the ticket is not refunable~ hope to see you again~");
|
||||
cm.sendNext("The ticket is not refundable, hope to see you again!");
|
||||
} else if(status == 2){
|
||||
cm.warp(103000000);
|
||||
cm.dispose();
|
||||
cm.warp(103000000);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,12 @@
|
||||
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;
|
||||
@@ -43,16 +47,40 @@ function action(mode, type, selection) {
|
||||
status++;
|
||||
}
|
||||
if(mode == 0) {
|
||||
cm.sendOk("Please hold on for a sec, and plane will be taking off. Thanks for your patience.");
|
||||
cm.dispose();
|
||||
return;
|
||||
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) {
|
||||
cm.sendYesNo("The plane will be taking off soon, Will you leave now? You will have buy the plane ticket again to come in here.");
|
||||
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) {
|
||||
cm.sendNext("I have already told you the ticket is not refunable~ hope to see you again~");
|
||||
} else if(status == 2) {
|
||||
cm.warp(540010000);
|
||||
cm.dispose();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,40 @@
|
||||
/*
|
||||
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 Singapore in no time. Do you want to go to Singapore?\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.");
|
||||
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) {
|
||||
@@ -21,8 +53,15 @@ function action(mode, type, selection) {
|
||||
oldSelection = selection;
|
||||
}else if(status == 1){
|
||||
if(oldSelection == 0){
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031732);
|
||||
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 {
|
||||
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");
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
/*
|
||||
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;
|
||||
|
||||
@@ -21,8 +53,15 @@ function action(mode, type, selection) {
|
||||
oldSelection = selection;
|
||||
}else if(status == 1){
|
||||
if(oldSelection == 0){
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031731);
|
||||
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 {
|
||||
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");
|
||||
|
||||
41
scripts/portal/ariant_castle.js
Normal file
41
scripts/portal/ariant_castle.js
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user