Services unrestrained to channels + Event scripts placeholder

Fixed an inconsistent scenario where player data would remain in world player storage even though they were no longer online.
Implemented missing functionality for "Safety Charm" which allows 30% MaxHP/MP heal on return.
Improved services facility, no longer tightly related to channels.
Implemented a world service for "save players" (services acts as a monitor).
Reviewed the event script initialization approach. Players no longer are retained from logging in on a channel whilst the events don't finish loadup.
Fixed certain quest items not showing up, which would happen due to them not being quest requisites.
Fixed NPC Pi crashing players when trying to craft arrows.
Fixed pet re-evolution quest not working on Robos.
Fixed boss HPBar not disappearing in certain situations.
Revised gathered mob info on linked mobs, no longer marshaling stats.
Fixed two possible deadlock scenarios within the cancel effect method.
Added lock auditing support for read-write locks.
Implemented code support for Cygnus intro clip.
Reviewed updateBuffEffect, now properly checking for pirate buffs in order to send the expected packet.
Reviewed unnecessary load of field objects, which would be doing so just for fetching the predicted map names.
Fixed mob buff tooltips not showing on "fake" mobs in the event of them turning into "real".
Reviewed usage of "unique" constraint on petid within the inventoryitems table.
Fixed portal in Ariant unexpectedly leading players who completed the "secret passageway" of Sleepywood into it.
Fixed a loop case in quest scripts from Magatia's broker having ore request.
This commit is contained in:
ronancpl
2019-10-29 01:48:58 -03:00
parent 54cdba01ae
commit 7d8d4691da
80 changed files with 944 additions and 496 deletions

View File

@@ -31,7 +31,7 @@ function start(mode, type, selection) {
} else if (status == 4) {
qm.forceStartQuest();
qm.forceCompleteQuest();
//qm.warp(913040100, 0);
qm.warp(913040100, 0);
qm.dispose();
}
}

View File

@@ -28,32 +28,39 @@
var status = -1;
var oreArray;
function start(mode, type, selection) {
}
function end(mode, type, selection) {
if (mode == -1 || (mode == 0 && type > 0)) {
qm.dispose();
if (mode == -1) {
qm.dispose();
} else {
oreArray = getOreArray();
if (status == -1) {
if (mode == 0 && type > 0) {
qm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
oreArray = getOreArray();
if (oreArray.length > 0) {
status++;
qm.sendSimple("Oh, looks like someone's ready to make a deal. You want to join Zenumist so badly, huh? I really don't understand you, but that's just fine. What will you give me in return?\r\n" + getOreString(oreArray));
} else {
qm.sendOk("What is this, you don't have the ores with you. No ore, no deal.");
qm.sendOk("What is this, you don't have the #rjewel ores#k with you. No ore, no deal.");
qm.dispose();
return;
}
} else if (status == 0) {
} else if (status == 1) {
if (!qm.haveItem(oreArray[selection], 2)) {
qm.sendNext("What's this, you haven't got the ores. No ores no deal!");
qm.sendNext("What's this, you haven't got the #rjewel ores#k. No ores no deal!");
qm.dispose();
return;
}
qm.gainItem(oreArray[selection], -2); // Take 2 ores
qm.sendNext("Then wait for awhile. I'll go and get the stuff to help you pass the test of Chief Zenumist.");
qm.forceCompleteQuest();
} else if (status == 1) {
} else if (status == 2) {
qm.dispose();
}
}

View File

@@ -28,32 +28,39 @@
var status = -1;
var oreArray;
function start(mode, type, selection) {
}
function end(mode, type, selection) {
if (mode == -1 || (mode == 0 && type > 0)) {
qm.dispose();
if (mode == -1) {
qm.dispose();
} else {
oreArray = getOreArray();
if (status == -1) {
if (mode == 0 && type > 0) {
qm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
oreArray = getOreArray();
if (oreArray.length > 0) {
status++;
qm.sendSimple("Oh, looks like someone's ready to make a deal. You want to join Alcadno so badly, huh? I really don't understand you, but that's just fine. What will you give me in return?\r\n" + getOreString(oreArray));
qm.sendSimple("Oh, looks like someone's ready to make a deal. You want to join Zenumist so badly, huh? I really don't understand you, but that's just fine. What will you give me in return?\r\n" + getOreString(oreArray));
} else {
qm.sendOk("What is this, you don't have the ores with you. No ore, no deal.");
qm.sendOk("What is this, you don't have the #rjewel ores#k with you. No ore, no deal."); // script would loop undefinitely at completion, thanks IxianMace for noticing
qm.dispose();
return;
}
} else if (status == 0) {
} else if (status == 1) {
if (!qm.haveItem(oreArray[selection], 2)) { // thanks resinate for noticing a function missing here
qm.sendNext("What's this, you haven't got the ores. No ores no deal!");
qm.sendNext("What's this, you haven't got the #rjewel ores#k. No ores no deal!");
qm.dispose();
return;
}
qm.gainItem(oreArray[selection], -2); // Take 2 ores
qm.sendNext("Then wait for awhile. I'll go and get the stuff to help you pass the test of Chief Alcadno.");
qm.sendNext("Then wait for awhile. I'll go and get the stuff to help you pass the test of Chief Zenumist.");
qm.forceCompleteQuest();
} else if (status == 1) {
} else if (status == 2) {
qm.dispose();
}
}

View File

@@ -47,39 +47,46 @@ function end(mode, type, selection) {
} else if (status == 1) {
qm.sendNextPrev("Then here we go...! #rHYAHH!#k");
} else if (status == 2) {
var pet = 0;
if (qm.getPlayer().getPet(0).getItemId() >= 5000029 && qm.getPlayer().getPet(0).getItemId() <= 5000033) {
var pet = 0;
} else if (qm.getPlayer().getPet(1).getItemId() >= 5000029 && qm.getPlayer().getPet(1).getItemId() <= 5000033) {
var pet = 1;
} else if (qm.getPlayer().getPet(2).getItemId() >= 5000029 && qm.getPlayer().getPet(2).getItemId() <= 5000033) {
var pet = 2;
} else {
qm.sendOk("Something wrong, try again.");
qm.dispose();
var petidx = -1;
var petItemid;
for (var i = 0; i < 3; i++) {
var pet = qm.getPlayer().getPet(pet);
if (pet != null) {
var id = pet.getItemId();
if (id >= 5000029 && id <= 5000033) {
petItemid = 5000030;
petidx = i;
break;
} else if (id >= 5000048 && id <= 5000053) { // thanks Conrad for noticing Robo pets not being able to re-evolve
petItemid = 5000049;
petidx = i;
break;
}
}
}
if (petidx == -1) {
qm.sendOk("Something wrong, try again.");
qm.dispose();
return;
}
var id = qm.getPlayer().getPet(pet).getItemId();
if (id < 5000029 || id > 5000033) {
qm.sendOk("Something wrong, try again.");
qm.dispose();
return;
}
var rand = 1 + Math.floor(Math.random() * 10);
var after = 0;
if (rand >= 1 && rand <= 3) {
after = 5000030;
} else if (rand >= 4 && rand <= 6) {
after = 5000031;
} else if (rand >= 7 && rand <= 9) {
after = 5000032;
} else if (rand == 10) {
after = 5000033;
} else {
qm.sendOk("Something wrong. Try again.");
qm.dispose();
return;
}
}
var pool = (petItemid == 5000030) ? 10 : 11;
do {
var rand = 1 + Math.floor(Math.random() * pool);
var after = 0;
if (rand >= 1 && rand <= 3) {
after = petItemid;
} else if (rand >= 4 && rand <= 6) {
after = petItemid + 1;
} else if (rand >= 7 && rand <= 9) {
after = petItemid + 2;
} else if (rand == 10) {
after = petItemid + 3;
} else {
after = petItemid + 4;
}
} while (after == pet.getItemId());
/*if (name.equals(MapleItemInformationProvider.getInstance().getName(id))) {
name = MapleItemInformationProvider.getInstance().getName(after);
@@ -87,7 +94,7 @@ function end(mode, type, selection) {
qm.gainMeso(-10000);
qm.gainItem(5380000, -1);
qm.evolvePet(pet, after);
qm.evolvePet(petidx, after);
qm.sendOk("Woo! It worked again! #rYou may find your new pet under your 'CASH' inventory.\r #kIt used to be a #b#i" + id + "##t" + id + "##k, and now it's \r a#b #i" + after + "##t" + after + "##k! \r\n Come back with 10,000 mesos and another Rock of Evolution if you don't like it!\r\n\r\n#fUI/UIWindow.img/QuestIcon/4/0#\r\n#v"+after+"# #t"+after+"#");
} else if (status == 3) {