Overall wedding implementation

Implementation of the wedding feature.
This commit is contained in:
ronancpl
2018-04-10 21:50:29 -03:00
parent 6da5edd837
commit ede8ad8551
59 changed files with 5281 additions and 1246 deletions

View File

@@ -25,9 +25,13 @@
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
Improved by [RonanLana]
---------------------------------------------------------------------------------------------------
**/
var bgPrizes = [[2022179,10], [2022282,10], [2210005,5], [2210003,5]];
var cmPrizes = [[2022011,10], [2000005,50], [2022273,10], [2022179,3]];
var status;
function start() {
@@ -37,7 +41,7 @@ function start() {
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then");
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
@@ -47,7 +51,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!";
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!#b";
var choice1 = new Array("I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest");
for (var i = 0; i < choice1.length; i++) {
msg += "\r\n#L" + i + "#" + choice1[i] + "#l";
@@ -56,38 +60,41 @@ function action(mode, type, selection) {
} else if (status == 1) {
if (selection == 0) {
if (cm.haveItem(4031424)) {
var rand = Math.floor(Math.random() * 4);
if (rand == 0)
cm.gainItem(2022179,10);
else if (rand == 1)
cm.gainItem(2022282,10);
else if (rand == 2)
cm.gainItem(2210005,5);
else if (rand == 3)
cm.gainItem(2210003,5);
cm.gainItem(4031424,-1);
if (cm.isMarried()) {
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
var rand = Math.floor(Math.random() * bgPrizes.length);
cm.gainItem(bgPrizes[rand][0], bgPrizes[rand][1]);
cm.gainItem(4031424,-1);
cm.dispose();
} else {
cm.sendOk("You don't have a free USE slot right now.");
cm.dispose();
}
} else {
cm.sendOk("You must be married to claim the prize for this box.");
cm.dispose();
}
} else {
cm.sendOk("You don't have an Onyx Chest for Bride and Groom.");
cm.dispose();
}
} else if (selection == 1) {
if (cm.haveItem(4031423)) {
cm.sendSimple("You may choose your prize.\r\n#L0#Triangular Sushi#l\r\n#L1#50 power elixers#l\r\n#L2#10 Swiss Cheese#l\r\n#L3#3 Onyx Apples#l");
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
var rand = Math.floor(Math.random() * cmPrizes.length);
cm.gainItem(cmPrizes[rand][0], cmPrizes[rand][1]);
cm.gainItem(4031423,-1);
cm.dispose();
} else {
cm.sendOk("You don't have a free USE slot right now.");
cm.dispose();
}
} else {
cm.sendOk("You don't have an Onyx Chest");
cm.sendOk("You don't have an Onyx Chest.");
cm.dispose();
}
}
} else if (status == 2) {
if (selection == 0)
cm.gainItem(2022011,10);
else if (selection == 1)
cm.gainItem(2000005,50);
else if (selection == 2)
cm.gainItem(2022273,10);
else if (selection == 3)
cm.gainItem(2022179,3);
cm.gainItem(4031423,-1);
cm.dispose();
}
}