PNPC & Pmob + Events Wheel & P. Leave patch + Proper cash use deplete

Reworked cash item consume. It now depletes from the selected slot rather than from the first slot it appears on inventory.
Implemented PNPC and PMOB commands.
Solved an issue with some events finishing abruptly when players quit a party.
Added missing mandatory script functions to the event scripts.
Solved an interaction issue with Wheel of Destiny activation in event instances.
Added interaction with NPC Mom & Dad in the Engagement prequest.
Solved an issue with event maps being disposed while reactor's spray items activity is still in effect.
Fixed modifier scrolls such as Spikes on Shoes depleting a upgrade slot.
Added a server flag for avoiding compulsory consuming by pet autopot.
Added a cache for fetching mob names.
Implemented boss drop rate.
Smart protected commands system against command requests in burst by the same user.
Revised login handler, bringing disconnection checks before checking login state and preventing new client reattribution to already logged-in character objects.
Botched login handler sessions now properly gets closed.
This commit is contained in:
ronancpl
2019-01-16 14:46:28 -02:00
parent 132a4ee989
commit 0203d45901
107 changed files with 2740 additions and 473 deletions

View File

@@ -61,7 +61,7 @@ function action(mode, type, selection) {
if(cm.getPlayer().getLevel() > 50) {
cm.sendOk("The VIP area is available only for players #rlevel 50 or below#k.");
} else {
cm.sendOk("The VIP area is available via completing the #r'Admission to the VIP Zone'#k quest.");
cm.sendOk("The VIP area only gets available after handing over #r#t4032521#s#k from the #b'Admission to the VIP Zone'#k quest.");
}
} else {
cm.sendOk("#rVIP#k? Yeah that is funny #rMr. VIP#k, now get lost before I call security.");

View File

@@ -32,18 +32,6 @@ var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
function hasEngagementBox(player) {
for(var i = 2240000; i <= 2240003; i++) {
if(player.haveItem(i)) {
@@ -80,21 +68,9 @@ function action(mode, type, selection) {
if(!cm.isQuestCompleted(100400)) {
if(!cm.isQuestStarted(100400)) {
state = 0;
cm.sendAcceptDecline("So you want to make a engagement ring, huh? Very well, I can provide one for you if you pass my test. Certainly you must have already seen #rNanas, the fairies of Love#k, around the Maple world. From 4 of them, collect #b4 #t4031367#'s#k and bring them here. Only then I'll accept you as a proper ring holder. Are you up to it?");
cm.sendNext("So you want to make a engagement ring, huh? Very well, I can provide one after you receive #rblessings#k from your #b#p9201003##k.");
} else {
if(!hasProofOfLoves(cm.getPlayer())) {
cm.sendOk("Please bring here #b4 #t4031367#'s#k. That's a must for me to accept you as a proper holder for the wedding ring.");
} else {
cm.completeQuest(100400);
cm.gainExp(20000 * cm.getPlayer().getExpRate());
for(var i = 4031367; i <= 4031372; i++) {
cm.removeAll(i);
}
cm.sendOk("You brought the #t4031367#'s, good. From now on you are eligible for holding the rings I make. Talk to me again to start forging the kind of ring you want.");
}
cm.sendOk("Take the blessings from your #b#p9201003##k before trying to craft an engagement ring. They must be waiting for you at home, beyond #rHenesys hunting grounds#k.");
cm.dispose();
}
} else {
@@ -129,9 +105,8 @@ function action(mode, type, selection) {
}
} else if(status == 2) {
if(state == 0) {
cm.sendOk("Where do they live, you ask? My, it goes way back... you see, I'm a friend of theirs, and I was the one who crafted and personally delivered their engagement ring. They live beyond #rHenesys Hunting Grounds#k, I'm sure you know where it is.");
cm.startQuest(100400);
cm.sendOk("Very well, then go after these #t4031367#'s. I will be waiting here.");
cm.dispose();
} else {
var itemSet = new Array(2240000,2240001,2240002,2240003);

View File

@@ -22,9 +22,23 @@
/**
*9201003.js - Mom and Dad
*@author Jvlaple
*@author Ronan
*/
var numberOfLoves = 0;
var status = 0;
var status = -1;
var state = 0;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
function start() {
status = -1;
@@ -35,7 +49,7 @@ function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
@@ -43,45 +57,42 @@ function action(mode, type, selection) {
status++;
else
status--;
if (cm.getPlayer().getMarriageQuestLevel() == 51) {
if (status == 0) {
if (cm.getPlayer().getGender() == 0) {
cm.sendYesNo("Hello my child. Are you sure that you want to get married to this girl? I believe in love at first sight, but this is rather sudden... I don't think we are ready for this. Lets think about it. Do you really love this girl?");
if (status == 0) {
if (!cm.isQuestStarted(100400)) {
cm.sendOk("Hello we're Mom and Dad...");
cm.dispose();
} else {
if (cm.getQuestProgress(100400, 1) == 0) {
cm.sendNext("Mom, dad, I have a request to do to both of you... I wanna know more about the path you've already been walking since always, the path of loving and caring for someone dear to me.", 2);
} else {
cm.sendYesNo("Hello my child. Are you sure that you want to get married to this man? I believe in love at first sight, but this is rather sudden... I don't think we are ready for this. Lets think about it. Do you really love this man?");
if(!hasProofOfLoves(cm.getPlayer())) {
cm.sendOk("Dear, we need to make sure you are really ready to fall in love with whoever you choose to be your partner, please bring here #b4 #t4031367#'s#k.");
cm.dispose();
} else {
cm.sendNext("#b#h0##k, you made us proud today. You may now have #rour blessings#k to choose whoever you like to be your fiancee. You may now consult #p9201000#, the Wedding Jeweler. Have a sooth, loving and caring journey ahead~~");
state = 1;
}
}
} else if (status == 1) {
cm.getPlayer().addMarriageQuestLevel();
cm.sendNext("Okay then. Go back to town and collect two more #bProof of Loves#k to prove it.");
}
} else if (status == 1) {
if (state == 0) {
cm.sendNextPrev("My dear! How thoughtful of you asking our help. Surely we will help you out!");
} else {
cm.sendOk("Mom... Dad... Thanks a lot for your tender support!!!", 2);
cm.completeQuest(100400);
cm.gainExp(20000 * cm.getPlayer().getExpRate());
for(var i = 4031367; i <= 4031372; i++) {
cm.removeAll(i);
}
cm.dispose();
}
} else if (cm.getPlayer().getMarriageQuestLevel() == 52) {
if (status == 0) {
numberOfLoves += cm.getPlayer().countItem(4031367);
numberOfLoves += cm.getPlayer().countItem(4031368);
numberOfLoves += cm.getPlayer().countItem(4031369);
numberOfLoves += cm.getPlayer().countItem(4031370);
numberOfLoves += cm.getPlayer().countItem(4031371);
numberOfLoves += cm.getPlayer().countItem(4031372);
if (numberOfLoves >= 2) {
cm.sendNext("Wow, you really are serious! Okay then, here is our blessing.");
} else {
cm.sendNext("Come back when you get two #bProof of Loves#k.");
cm.dispose();
}
} else if (status == 1) {
cm.getPlayer().addMarriageQuestLevel();
cm.removeAll(4031367);
cm.removeAll(4031368);
cm.removeAll(4031369);
cm.removeAll(4031370);
cm.removeAll(4031371);
cm.removeAll(4031372);
cm.gainItem(4031373, 1);
cm.dispose();
}
} else {
cm.sendOk("Hello we're Mom and Dad...");
} else if (status == 2) {
cm.sendNextPrev("Certainly you must have already seen #rNanas, the fairies of Love#k, around the Maple world. From 4 of them, collect #b4 #t4031367#'s#k and bring them here. This journey shall clear some questions you may have about love...");
} else if (status == 3) {
cm.setQuestProgress(100400, 1, 1);
cm.dispose();
}
}

View File

@@ -78,7 +78,7 @@ function action(mode, type, selection) {
} else if(status == 1) {
switch(selection) {
case 0:
cm.sendOk("The #bengagement process#k is as straightforward as it can be. Firstly one must start a prequest from the #bring maker, #p9201000##k. They must gather #b#t4031367#'s#k thoughout the Maple world.\r\nFrom the completion of the quest, the player will gain an engagement ring. With that in hand, declare yourself to someone you become fond of. Then, hope the person accepts your proposal.");
cm.sendOk("The #bengagement process#k is as straightforward as it can be. Starting from a prequest from the #bring maker, #p9201000##k, gather #b#t4031367#'s#k thoughout the Maple world.\r\n\r\nCompleting it, you will be able to craft an engagement ring. With one in hands, declare yourself to someone you become fond of, and hope that person feels the same way.");
cm.dispose();
break;

View File

@@ -47,6 +47,7 @@ function writeFeatureTab_PQs() {
addFeature("Brand-new PQs: BossRushPQ, CafePQ.");
addFeature("Mu Lung Dojo.");
addFeature("Capt. Latanica with party fighting the boss.");
addFeature("Filled up missing obligatory event script methods.");
}
function writeFeatureTab_Skills() {
@@ -90,6 +91,7 @@ function writeFeatureTab_CashItems() {
addFeature("EXP/DROP/Cosmetic Coupons.");
addFeature("EXP/DROP Coupon as buff effect during active time.");
addFeature("Great deal of cash items functional.");
addFeature("Proper depletion of picked slot for usable cash items.");
addFeature("Code coupons functional, with multi-items support.");
addFeature("Merged unique ids for pets, rings and cash items.");
addFeature("MapleTV mechanics stabilized and split by world.");
@@ -206,6 +208,7 @@ function writeFeatureTab_Serverpotentials() {
function writeFeatureTab_Commands() {
addFeature("Spawn Zakum/Horntail/Pinkbean.");
addFeature("Permanent NPCs & mobs.");
addFeature("Several new commands.");
addFeature("Rank command highlighting users by world or overall.");
addFeature("Server commands layered by GM levels.");

View File

@@ -39,6 +39,7 @@ function writeServerStaff_HeavenMS() {
addPerson("Thora", "Contributor");
addPerson("GabrielSin", "Contributor");
addPerson("Masterrulax", "Contributor");
addPerson("MedicOP", "Adjunct Developer");
setHistory(2015, 2018);
}