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,20 +25,64 @@
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
-- Content Improved by ----------------------------------------------------------------------------
RonanLana (HeavenMS)
---------------------------------------------------------------------------------------------------
**/
var status;
var i;
var eim;
var hasEngage;
var hasRing;
function start() {
status = -1;
action(1, 0, 0);
eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
if(cm.getMapId() == 680000200) {
if(eim.getIntProperty("weddingStage") == 0) {
cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough.");
} else {
cm.warp(680000210, "sp");
cm.sendNext("Pick your seat over here and good show!");
}
cm.dispose();
} else {
if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) {
cm.sendNext("Sorry, only the marrying couple should be talking to me right now.");
cm.dispose();
return;
}
hasEngage = false;
for(var i = 4031357; i <= 4031364; i++) {
if(cm.haveItem(i)) {
hasEngage = true;
break;
}
}
var rings = [1112806, 1112803, 1112807, 1112809];
hasRing = false;
for (i = 0; i < rings.length; i++) {
if (cm.getPlayer().haveItemWithId(rings[i], true)) {
hasRing = true;
}
}
status = -1;
action(1, 0, 0);
}
}
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) {
@@ -46,28 +90,16 @@ function action(mode, type, selection) {
} else {
status--;
}
var engagementRings = Array(4031360, 4031358, 4031362, 4031364);
var hasEngage = false;
for (i = 0; i < engagementRings.length && !hasEngage; i++) {
if (cm.haveItem(engagementRings[i]))
hasEngage = true;
}
var Rings = Array(1112806, 1112803, 1112807, 1112809);
var hasRing = false;
for (i = 0; i < Rings.length; i++) {
if (cm.haveItem(Rings[i])) {
hasRing = true;
}
}
if (status == 0) {
if (cm.haveItem(4000313) && hasEngage) {
var hasGoldenLeaf = cm.haveItem(4000313);
if (hasGoldenLeaf && hasEngage) {
cm.sendOk("You can't leave yet! You need to click High Priest John and get married before I can let you leave.");
cm.dispose();
} else if (cm.haveItem(4000313) && hasRing) {
var choice = Array("Go to the Cherished Visage Photos", "What should I be doing");
var msg = "What can I help you with?";
} else if (hasGoldenLeaf && hasRing) {
var choice = Array("Go to the Afterparty", "What should I be doing");
var msg = "What can I help you with?#b";
for (i = 0; i < choice.length; i++) {
msg += "\r\n#L" + i + "#" + choice[i] + "#l";
}
@@ -79,14 +111,22 @@ function action(mode, type, selection) {
} else if (status == 1) {
switch(selection) {
case 0:
cm.warp(680000300, 0);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
if(eim.getIntProperty("isPremium") == 1) {
eim.warpEventTeam(680000300);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
} else { // skip the party-time (premium only)
eim.warpEventTeam(680000500);
cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit.");
}
cm.dispose();
break;
case 1:
cm.sendOk("The Bride and Groom must click High Priest John to be wed. When you are ready you can click me to go to the Cherished Visage Photos");
cm.sendOk("The Bride and Groom must receive the blessings of High Priest John to be wed. When you are ready you can click me to go to the Afterparty.");
cm.dispose();
break;
default:
cm.warp(680000000,0);
cm.dispose();