Files
sweetgum-server/scripts/quest/2293.js
2024-05-21 20:23:34 +02:00

98 lines
4.2 KiB
JavaScript

/*
This file is part of the DietStory Maple Story Server
Copyright (C) 2017
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Author: Benji
NPC Name: Maestro Rho
Map(s): Kerning Square Lobby
Description: The Last Song
*/
var status = -1;
function start(mode, type, selection) {
if (mode == -1 || (mode == 0 && status == 0)) {
qm.dispose();
return;
} else if (mode == 0) {
status--;
} else {
status++;
}
if (status == 0) {
qm.sendNext("Do you remember the last song that the Spirit of Rock played? I can think of a few songs that he may be imitating, so listen carefully and tell me which song it is. #bYou only get one chance,#k so please choose wisely.");
qm.forceStartQuest();
} else if (status == 1) {
qm.dispose();
}
}
function end(mode, type, selection) {
if (mode == -1 || (mode == 0 && status == 0)) {
qm.dispose();
return;
} else if (mode == 0) {
status--;
} else {
status++;
}
// TODO: there are 10 different riffs; quest2288/0 through quest2288/9.
// One of the riffs should play randomly upon the death of Spirit of Rock, but there is currently no system in place to achieve that in a reasonable way.
// Spirit of Rock (4300013) spawns an invisible mob on death (Spirit of Rock's Soul, 4300017) which was likely used in some clever way in GMS.
// The map (103040430) has two scripts which could be useful: onFirstUserEnter=Depart_Boss_F_Enter and onUserEnter=Depart_BossEnter
// Currently, the best hypothesis is that one of the map scripts registers some form of "mob spawn" action/script that runs once the invisible mob spawns.
// The script would randomly pick one of the 10 riffs and then register it with all chrs on the map (to later be used by this quest 2293) and play it.
if (status == 0) {
qm.sendSimple("Here, I'll give you some samples. Please listen to them and choose one. Please listen carefully before making your choice.\r\n\
\t#b#L1# Listen to song No. 1#l \r\n\
\t#L2# Listen to Song No. 2#l \r\n\
\t#L3# Listen to Song No. 3#l \r\n\
\r\n\
\t#e#L4# Enter the correct song.#l");
} else if (status == 1) {
if (selection == 1) {
qm.playSound("Party1/Failed");
qm.sendOk("Awkwardly familiar...");
status = -1;
} else if (selection == 2) {
qm.playSound("Coconut/Failed");
qm.sendOk("Was it this?");
status = -1;
} else if (selection == 3) {
qm.playSound("quest2288/6");
qm.sendOk("You heard that?");
status = -1;
} else if (selection == 4) {
qm.sendGetNumber("Now, please tell me the answer. You only get #bone chance#k, so please choose wisely. Please enter #b1, 2, or 3#k in the window below.\r\n", 1, 1, 3);
}
} else if (status == 2) {
if (selection == 1) {
qm.sendOk("Obviously you don't enjoy music.");
} else if (selection == 2) {
qm.sendOk("I suppose you could get #b#eone#n#k more chance.");
} else if (selection == 3) {
qm.sendOk("So that was the song he was playing... Well, it wasn't my song after all, but I'm glad I can know that now with certainty. Thank you so much.");
qm.forceCompleteQuest();
qm.gainExp(32500);
} else {
qm.dispose();
}
} else if (status == 3) {
qm.dispose();
}
}