Multi World NPCs + patch on Player interactions

Made NPCs now work properly on multiworld system. Solved multiple issues
regarding Player Shops not giving back items properly when owner exits.
Added restriction on changing channels at FM rooms, preventing shop
owner entering Cash Shop.
This commit is contained in:
ronancpl
2017-05-28 22:11:39 -03:00
parent d0396e4c36
commit 7f178a3d80
548 changed files with 340 additions and 164 deletions

43
scripts/npc/1052006.js Normal file
View File

@@ -0,0 +1,43 @@
var status = -1;
var zones = 0;
var cost = 1000;
function start() {
cm.sendNext("Hi, I'm the ticket salesman.");
if (cm.isQuestStarted(2055) || cm.isQuestCompleted(2055))
zones++;
if (cm.isQuestStarted(2056) || cm.isQuestCompleted(2056))
zones++;
if (cm.isQuestStarted(2057) || cm.isQuestCompleted(2057))
zones++;
}
function action(mode, type, selection) {
status++;
if (mode != 1){
cm.dispose();
return;
}
if (status == 0) {
if (zones == 0)
cm.dispose();
else {
var selStr = "Which ticket would you like?#b";
for (var i = 0; i < zones; i++)
selStr += "\r\n#L" + i + "#Construction site B" + (i+1) + " (" + cost + " mesos)#l";
cm.sendSimple(selStr);
}
} else if (status == 1) {
if (cm.getMeso() < cost)
cm.sendOk("You do not have enough mesos.");
else {
cm.gainMeso(-cost);
if(selection < 0 || selection > zones) {
cm.getClient().disconnect(false, false);
return;
}
cm.gainItem(4031036 + selection,1);
}
cm.dispose();
}
}