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

@@ -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);