Protected Trade/Quest system + Expirable quests
Added true protection against race conditions on player trades and fixed some situational issues. Character's quest status table also received concurrency treatment. Quests with time limit now expires properly. Increased subtly the performance on the server start-up.
This commit is contained in:
@@ -72,6 +72,12 @@ function action(mode, type, selection) {
|
||||
|
||||
cm.sendYesNo("Oh, are you interested in forming a Guild Union? The current fee for this operation is #b" + allianceCost + " mesos#k.");
|
||||
} else if (selection == 3) {
|
||||
if(cm.getPlayer().getMGC() == null) {
|
||||
cm.sendOk("You can not expand a Guild Union if you don't own one.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var rank = cm.getPlayer().getMGC().getAllianceRank();
|
||||
if (rank == 1)
|
||||
cm.sendYesNo("Do you want to increase your Alliance by one guild slot? The fee for this procedure is #b" + increaseCost + " mesos#k.");
|
||||
@@ -80,6 +86,12 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
}
|
||||
} else if(selection == 4) {
|
||||
if(cm.getPlayer().getMGC() == null) {
|
||||
cm.sendOk("You can not disband a Guild Union if you don't own one.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var rank = cm.getPlayer().getMGC().getAllianceRank();
|
||||
if (rank == 1)
|
||||
cm.sendYesNo("Are you sure you want to disband your Guild Union?");
|
||||
|
||||
@@ -70,7 +70,8 @@ function end(mode, type, selection) {
|
||||
} else if (status == 5) {
|
||||
qm.sendYesNo("Now do you understand? Every action comes with consequences, and pets are no exception. The egg of the snail shall hatch soon.");
|
||||
} else if (status == 6) {
|
||||
qm.gainItem(5000054, 1); // rune snail * 1
|
||||
qm.gainItem(5000054, 1, false, true, 5 * 60 * 60 * 1000); // rune snail (5hrs)
|
||||
|
||||
qm.gainItem(4032086, -1); // Mysterious Egg * -1
|
||||
qm.forceCompleteQuest();
|
||||
qm.sendNext("This snail will only be alive for #b5 hours#k. Shower it with love. Your love will be reciprocated in the end.");
|
||||
|
||||
Reference in New Issue
Block a user