Reformat and clean up npc scripts
This commit is contained in:
@@ -32,54 +32,54 @@ var travelPlaceCountry = ["Japan", "Malaysia"];
|
||||
var travelAgent = ["I", "#r#p9201135##k"];
|
||||
|
||||
var travelDescription = ["If you desire to feel the essence of Japan, there's nothing like visiting the Shrine, a Japanese cultural melting pot. Mushroom Shrine is a mythical place that serves the incomparable Mushroom God from ancient times.",
|
||||
"If you desire to feel the heat of the tropics on an upbeat environment, the residents of Malaysia are eager to welcome you. Also, the metropolis itself is the heart of the local economy, that place is known to always offer something to do or to visit around."];
|
||||
"If you desire to feel the heat of the tropics on an upbeat environment, the residents of Malaysia are eager to welcome you. Also, the metropolis itself is the heart of the local economy, that place is known to always offer something to do or to visit around."];
|
||||
|
||||
var travelDescription2 = ["Check out the female shaman serving the Mushroom God, and I strongly recommend trying Takoyaki, Yakisoba, and other delocious food sold in the streets of Japan. Now, let's head over to #bMushroom Shrine#k, a mythical place if there ever was one.",
|
||||
"Once there, I strongly suggest you to schedule a visit to Kampung Village. Why? Surely you've come to know about the fantasy theme park Spooky World? No? It's simply put the greatest theme park around there, it's worth a visit! Now, let's head over to the #bTrend Zone of Malaysia#k."];
|
||||
"Once there, I strongly suggest you to schedule a visit to Kampung Village. Why? Surely you've come to know about the fantasy theme park Spooky World? No? It's simply put the greatest theme park around there, it's worth a visit! Now, let's head over to the #bTrend Zone of Malaysia#k."];
|
||||
|
||||
var travelType;
|
||||
var travelStatus;
|
||||
|
||||
function start() {
|
||||
travelStatus = getTravelingStatus(cm.getPlayer().getMapId());
|
||||
action(1,0,0);
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function getTravelingStatus(mapid) {
|
||||
for(var i = 0; i < travelMap.length; i++) {
|
||||
if(mapid == travelMap[i]) {
|
||||
for (var i = 0; i < travelMap.length; i++) {
|
||||
if (mapid == travelMap[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function getTravelType(mapid) {
|
||||
for(var i = 0; i < travelFrom.length; i++) {
|
||||
if(mapid == travelFrom[i]) {
|
||||
for (var i = 0; i < travelFrom.length; i++) {
|
||||
if (mapid == travelFrom[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
status++;
|
||||
if(mode != 1){
|
||||
if(mode == 0 && status == 4)
|
||||
if (mode != 1) {
|
||||
if (mode == 0 && status == 4) {
|
||||
status -= 2;
|
||||
else{
|
||||
} else {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (travelStatus != -1) {
|
||||
if (status == 0)
|
||||
if (status == 0) {
|
||||
cm.sendSimple("How's the traveling? Are you enjoying it?#b\r\n#L0#Yes, I'm done with traveling. Can I go back to #m" + cm.getPlayer().peekSavedLocation("WORLDTOUR") + "#?\r\n#L1#No, I'd like to continue exploring this place.");
|
||||
else if (status == 1) {
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
cm.sendNext("Alright. I'll take you back to where you were before the visit to Japan. If you ever feel like traveling again down the road, please let me know!");
|
||||
} else if (selection == 1) {
|
||||
@@ -88,8 +88,10 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else if (status == 2) {
|
||||
var map = cm.getPlayer().getSavedLocation("WORLDTOUR");
|
||||
if (map == -1) map = 104000000;
|
||||
|
||||
if (map == -1) {
|
||||
map = 104000000;
|
||||
}
|
||||
|
||||
cm.warp(map);
|
||||
cm.dispose();
|
||||
}
|
||||
@@ -102,7 +104,7 @@ function action(mode, type, selection) {
|
||||
} else if (status == 2) {
|
||||
cm.sendNext("Would you like to travel to #b" + travelPlace[travelType] + "#k? " + travelDescription[travelType]);
|
||||
} else if (status == 3) {
|
||||
if(cm.getMeso() < travelFee[travelType]){
|
||||
if (cm.getMeso() < travelFee[travelType]) {
|
||||
cm.sendNext("You don't have enough mesos to take the travel.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user