Files
sweetgum-server/scripts/npc/2012027.js
ronancpl fca7b2adaa Implemented Kites, PlayerNPCs and C. Shop Surprise & Tweaked login
Added code support for Kites.
Reviewed concurrent access issues with pet autopot.
Addressed PlayerStorage issue where characters would not be properly deregistered from channel PlayerStorage in certain situations.
Implemented harp quest (questid 3314) because of reasons.
Added SFX to signalize KC/NLC subway departing/approaching.
Changed traveling time values to work similarly to GMS.
Properly developed the PlayerNPC feature in the source.
Added autodeployable PlayerNPC system and Hall of Fame.
Solved a glitch with NLC mayor's quiz questline that would allow a player to restart the quiz as many times one would see fit.
Added a custom server flag that allows overwriting the ToT 999 mobs to a new value (technically it doesn't overwrite, rather sets the player at quest start with 999 - n credited mobs).
Fixed permanent pets expiring after a while.
Added code support for Cash Shop Surprise item.
Reviewed login handler system as a whole, protecting many exposed flaws.
Solved a bug with ULTRA_THREE_SNAILS sometimes taking wrong etc shell from inventory.
2018-05-19 14:28:06 -03:00

100 lines
4.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
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/>.
*/
/* Harp String C
Hidden Street - Elizas Garden (200010303)
*/
importPackage(Packages.tools);
var status;
var harpNote = 'C';
var harpSounds = ["do", "la", "mi", "pa", "re", "si", "sol"];
var harpSong = "CCGGAAGFFEEDDC|GGFFEED|GGFFEED|CCGGAAGFFEEDDC|";
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.getMap().broadcastMessage(MaplePacketCreator.playSound("orbis/" + harpSounds[cm.getNpc() - 2012027]));
if(cm.isQuestStarted(3114)) {
var idx = cm.getQuestProgress(3114, 7777);
if(idx != -1) {
var nextNote = harpSong[idx];
if(harpNote != nextNote) {
cm.setQuestProgress(3114, 7777, 0);
cm.getPlayer().announce(MaplePacketCreator.showEffect("quest/party/wrong_kor"));
cm.getPlayer().announce(MaplePacketCreator.playSound("Party1/Failed"));
cm.message("You've missed the note... Start over again.");
} else {
nextNote = harpSong[idx + 1];
if(nextNote == '|') {
idx++;
if(idx == 45) { // finished lullaby
cm.message("Twinkle, twinkle, little star, how I wonder what you are.");
cm.setQuestProgress(3114, 7777, -1);
cm.getPlayer().announce(MaplePacketCreator.showEffect("quest/party/clear"));
cm.getPlayer().announce(MaplePacketCreator.playSound("Party1/Clear"));
cm.dispose();
return;
} else {
if(idx == 14) {
cm.message("Twinkle, twinkle, little star, how I wonder what you are!");
} else if(idx == 22) {
cm.message("Up above the world so high,");
} else if(idx == 30) {
cm.message("like a diamond in the sky.");
}
}
}
cm.setQuestProgress(3114, 7777, idx + 1);
}
}
}
cm.dispose();
}
}
}