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

52
scripts/npc/2060009.js Normal file
View File

@@ -0,0 +1,52 @@
var status = 0;
var menu;
var payment = false;
var atHerbTown = false;
function start() {
if(cm.getPlayer().getMap().getId() == 251000100)atHerbTown = true;
if (cm.haveItem(4031242)){
if(atHerbTown)
menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l";
else
menu = "#L0##bI will use #t4031242##k to move to #b#m230030200##k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l";
}else {
if(atHerbTown)
menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m230000000##k after paying #b10000mesos#k.#l";
else
menu = "#L0#Go to #b#m230030200##k after paying #b1000mesos#k.#l\r\n#L1#Go to #b#m251000000##k after paying #b10000mesos#k.#l";
payment = true;
}
cm.sendSimple ("Ocean are all connected to each other. Place you can't reach by foot can easily reached oversea. How about taking #bDolphin Taxi#k with us today?\r\n"+menu);
}
function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else {
if (selection == 0) {
if(payment) {
if(cm.getPlayer().getMeso() < 1000) {
cm.sendOk("I don't think you have enough money...");
cm.dispose();
} else
cm.gainMeso(-1000);
} else
cm.gainItem(4031242,-1);
cm.warp(230030200);
cm.dispose();
return;
}else if(selection == 1){
if (cm.getPlayer().getMeso() < 10000) {
cm.sendOk("I don't think you have enough money...");
cm.dispose();
return;
}else{
cm.gainMeso(-10000);
cm.warp(atHerbTown ? 230000000 : 251000100);
}
}
cm.dispose();
}
}