Dynamic World/Channel shutdown + Equip levels on Duey + AP/SP patch
Implemented dynamic world/channel shutdown, coupling with the dynamic deployment from last commit rendering on a fully automated world/channel management. Fixed some spawned mobs not being properly registered on events. Implemented a respawn mechanic sensitive to number of players on map. More mobs will spawn the greater the number of players is. Server flag: USE_ENABLE_FULL_RESPAWN = false. Implemented a mechanic for delayed mob loot drops, on which the delay is determined by the death animation duration. Server flag: USE_SPAWN_LOOT_ON_ANIMATION = true. Fixed EIM being disposed incorrectly when the dispose is called through scripts. Protected concurrently AP and SP distribution handlers. Slightly improved HealOvertimeHandler performance. Fixed Duey not propagating equipment level and experience when transfering items. Buyback now has a short grace period, granting the returning player time for decision making (players won't die right away, rather sticks at 1HP). Reviewed item monitor task not properly protected concurrently. Fixed some issues with ropes on some Kampung Village maps. Fixed "maxhpmp" command allowing to pass negative values.
This commit is contained in:
@@ -112,6 +112,10 @@ function playerDead(eim, player) {
|
||||
// Happens when player dies
|
||||
}
|
||||
|
||||
function monsterRevive(mob, eim) {
|
||||
// Happens when an opposing mob revives
|
||||
}
|
||||
|
||||
function playerRevive(eim, player) {
|
||||
// Happens when player's revived.
|
||||
// @Param : returns true/false
|
||||
|
||||
@@ -28,8 +28,6 @@ function action(mode, type, selection) {
|
||||
else if(mapid == 108010401) cm.getPlayer().changeMap(107000402);
|
||||
else if(mapid == 108010501) cm.getPlayer().changeMap(105070200);
|
||||
|
||||
var em = cm.getEventManager("3rdjob");
|
||||
em.getInstance(cm.getPlayer().getName()).unregisterPlayer(cm.getPlayer());
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ function action(mode, type, selection) {
|
||||
if(allDone) {
|
||||
cm.sendOk("Done. Thanks for showing up~.");
|
||||
} else {
|
||||
cm.sendOk("Done. Be aware some of the items could not be synthetized because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||
cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -21,10 +21,50 @@
|
||||
*/
|
||||
status = -1;
|
||||
|
||||
|
||||
var travelFrom = [777777777, 541000000];
|
||||
var travelFee = [3000, 10000];
|
||||
|
||||
var travelMap = [800000000, 550000000];
|
||||
var travelPlace = ["Mushroom Shrine of Japan", "Trend Zone of Malaysia"];
|
||||
var travelPlaceShort = ["Mushroom Shrine", "Metropolis"];
|
||||
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."];
|
||||
|
||||
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."];
|
||||
|
||||
var travelType;
|
||||
var travelStatus;
|
||||
|
||||
function start() {
|
||||
travelStatus = getTravelingStatus(cm.getPlayer().getMapId());
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function getTravelingStatus(mapid) {
|
||||
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]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
status++;
|
||||
if(mode != 1){
|
||||
@@ -35,7 +75,8 @@ function action(mode, type, selection) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (cm.getPlayer().getMapId() == 800000000) {
|
||||
|
||||
if (travelStatus != -1) {
|
||||
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) {
|
||||
@@ -53,23 +94,24 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
if (status == 0)
|
||||
cm.sendNext("If you're tired of the monotonous daily life, how about getting out for a change? there's nothing quite like soaking up a new culture, learning something new by the minute! It's time for you to get out and travel. We, at the Maple Travel Agency recommend you going on a #bWorld Tour#k! Are you worried about the travel expense? You shouldn't be! We, the #bMaple Travel Agency#k, havecarefully come up with a plan to let you travel for ONLY #b3,000 mesos#k!");
|
||||
else if (status == 1)
|
||||
cm.sendSimple("We currently offer this place for you traveling pleasure: #bMushroom Shrine of Japan#k. I'll be there serving you as the travel guide. Rest assured, the number of destinations will be increase over time. Now, would you like to head over to the Mushroom Shrine?#b\r\n#L0#Yes, take me to Mushroom Shrine (Japan)");
|
||||
else if (status == 2)
|
||||
cm.sendNext("Would you like to travel to #bMushroom Shrine of Japan#k? 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.");
|
||||
else if (status == 3) {
|
||||
if(cm.getMeso() < 3000){
|
||||
if (status == 0) {
|
||||
travelType = getTravelType(cm.getPlayer().getMapId());
|
||||
cm.sendNext("If you're tired of the monotonous daily life, how about getting out for a change? there's nothing quite like soaking up a new culture, learning something new by the minute! It's time for you to get out and travel. We, at the Maple Travel Agency recommend you going on a #bWorld Tour#k! Are you worried about the travel expense? You shouldn't be! We, the #bMaple Travel Agency#k, have carefully come up with a plan to let you travel for ONLY #b" + cm.numberWithCommas(travelFee[travelType]) + " mesos#k!");
|
||||
} else if (status == 1) {
|
||||
cm.sendSimple("We currently offer this place for you traveling pleasure: #b" + travelPlace[travelType] + "#k. " + travelAgent[travelType] + "'ll be there serving you as the travel guide. Rest assured, the number of destinations will be increase over time. Now, would you like to head over to the " + travelPlaceShort[travelType] + "?#b\r\n#L0#Yes, take me to " + travelPlaceShort[travelType] + " (" + travelPlaceCountry[travelType] + ")");
|
||||
} 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]){
|
||||
cm.sendNext("You don't have enough mesos to take the travel.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendNextPrev("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.");
|
||||
cm.sendNextPrev(travelDescription2[travelType]);
|
||||
} else if (status == 4) {
|
||||
cm.gainMeso(-3000);
|
||||
cm.gainMeso(-travelFee[travelType]);
|
||||
cm.getPlayer().saveLocation("WORLDTOUR");
|
||||
cm.warp(800000000, 0);
|
||||
cm.warp(travelMap[travelType], 0);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,26 +19,55 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
var toMap = new Array(550000000, 551000000, 540000000,540000000);
|
||||
var inMap = new Array(540000000, 540000000, 551000000, 550000000);
|
||||
var cost = new Array(10000, 50000, 50000, 10000);
|
||||
var inMap = new Array(540000000, 550000000, 551000000);
|
||||
var toMap = new Array(550000000, new Array(551000000, 541000000), 550000000);
|
||||
var cost = new Array(42000, new Array(10000, 0), 10000);
|
||||
var toMapSp = new Array(0, new Array(2, 4), 4);
|
||||
|
||||
var location;
|
||||
var text = "Where would you like to travel?\n\n";
|
||||
var text;
|
||||
|
||||
var travelCost;
|
||||
var travelMap;
|
||||
var travelSp;
|
||||
|
||||
var startedTravel = false;
|
||||
|
||||
var status = 0;
|
||||
|
||||
function start() {
|
||||
if (cm.getPlayer().getMap().getId() != 540000000) {
|
||||
for (var i = 0; i < toMap.length; i ++) {
|
||||
if (inMap[i] == cm.getPlayer().getMap().getId()) {
|
||||
location = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
text +="\t\r\n#b#L0##m" + toMap[location] + "# (" + cost[location] + "mesos)#l#k";
|
||||
text = "Hey I'm #p9201135#, your tour guide here in #rMalaysia#k. Where would you like to travel?\n\n";
|
||||
} else {
|
||||
text += "\t\r\n#b#L0##m" + toMap[0] + "# (" + cost[0] + "mesos)#l\n\t\r\n#L1##m" + toMap[1] + "# (" + cost[1] + "mesos)#l#k";
|
||||
text = "Hey I'm #p9201135#, a tour guide on #rMalaysia#k. Since you're not registered in our special travel package with our partner #bMaple Travel Agency#k, the ride will be significantly more expensive. So, would you like to ride now?\n\n";
|
||||
startedTravel = true;
|
||||
}
|
||||
cm.sendSimple(text);
|
||||
|
||||
for (var i = 0; i < toMap.length; i ++) {
|
||||
if (inMap[i] == cm.getPlayer().getMap().getId()) {
|
||||
if(inMap[i] == 550000000) {
|
||||
toMap[1][1] = cm.getPlayer().peekSavedLocation("WORLDTOUR");
|
||||
}
|
||||
|
||||
location = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(toMap[location] instanceof Array) {
|
||||
var maps = toMap[location];
|
||||
var costs = cost[location];
|
||||
|
||||
for(var i = 0; i < maps.length; i++) {
|
||||
text +="\t\r\n#b#L" + i + "##m" + maps[i] + "# " + (costs[i] > 0 ? "(" + costs[i] + "mesos)" : "") + "#l";
|
||||
}
|
||||
} else {
|
||||
text +="\t\r\n#b#L0##m" + toMap[location] + "# " + (cost[location] > 0 ? "(" + cost[location] + "mesos)" : "") + "#l";
|
||||
}
|
||||
|
||||
text += "#k";
|
||||
|
||||
cm.sendSimple(text);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
@@ -51,22 +80,45 @@ function action(mode, type, selection) {
|
||||
return;
|
||||
} else {
|
||||
status++;
|
||||
}
|
||||
}
|
||||
if (status == 1) {
|
||||
if (cm.getPlayer().getMap().getId() == 540000000) {
|
||||
location = selection;
|
||||
}
|
||||
if (toMap[location] == null) {
|
||||
cm.dipose();
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendYesNo("Would you like to travel to #b#m"+toMap[location]+"##k? To head over to #b#m"+toMap[location]+"##k, it'll cost you cost you #b" + cost[location] + "#k. Would you like to go right now?");
|
||||
|
||||
if(toMap[location] instanceof Array) {
|
||||
var maps = toMap[location];
|
||||
var costs = cost[location];
|
||||
var sps = toMapSp[location];
|
||||
|
||||
travelCost = costs[selection];
|
||||
travelMap = maps[selection];
|
||||
travelSp = sps[selection];
|
||||
} else {
|
||||
travelCost = cost[location];
|
||||
travelMap = toMap[location];
|
||||
travelSp = toMapSp[location];
|
||||
}
|
||||
|
||||
if(travelCost > 0) {
|
||||
cm.sendYesNo("Would you like to travel to #b#m" + travelMap + "##k? To head over to #b#m" + travelMap + "##k, it'll cost you #r" + cm.numberWithCommas(travelCost) + " mesos#k. Would you like to go right now?");
|
||||
} else {
|
||||
cm.sendNext("Had a great time in #rMalaysia#k? I hope so, have a safe travel back!");
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (cm.getMeso() < cost[location]) {
|
||||
if (cm.getMeso() < travelCost) {
|
||||
cm.sendNext("You do not seem to have enough mesos.");
|
||||
} else {
|
||||
cm.warp(toMap[location]);
|
||||
cm.gainMeso(-cost[location]);
|
||||
if(travelCost > 0) {
|
||||
cm.gainMeso(-travelCost);
|
||||
if(startedTravel) cm.getPlayer().saveLocation("WORLDTOUR");
|
||||
}
|
||||
else {
|
||||
travelMap = cm.getPlayer().getSavedLocation("WORLDTOUR");
|
||||
}
|
||||
|
||||
cm.warp(travelMap, travelSp);
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else if(status == 1) {
|
||||
if(eim.isEventCleared()) {
|
||||
if(!eim.giveEventReward(cm.getPlayer)) {
|
||||
if(!eim.giveEventReward(cm.getPlayer())) {
|
||||
cm.sendOk("Please make a room on your inventory to receive the loot.");
|
||||
cm.dispose();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user