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.
57 lines
2.0 KiB
JavaScript
57 lines
2.0 KiB
JavaScript
var status = 0;
|
|
|
|
var spawnPnpc = false;
|
|
var spawnPnpcFee = 7000000;
|
|
var jobType = 21;
|
|
|
|
function numberWithCommas(x) {
|
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
}
|
|
|
|
function start() {
|
|
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
|
|
spawnPnpc = true;
|
|
|
|
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
|
|
if(spawnPnpcFee > 0) {
|
|
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
|
|
}
|
|
|
|
cm.sendYesNo(sendStr);
|
|
} else {
|
|
cm.sendOk("Behold, the distinguished brave heroes of Rien! Those stout hearts are who have been protecting our people since long ago, our valiant comrades.");
|
|
cm.dispose();
|
|
}
|
|
}
|
|
|
|
function action(mode, type, selection) {
|
|
status++;
|
|
if (mode == 0 && type != 1)
|
|
status -= 2;
|
|
if (status == -1){
|
|
start();
|
|
return;
|
|
} else {
|
|
if(spawnPnpc) {
|
|
if(mode > 0) {
|
|
if(cm.getMeso() < spawnPnpcFee) {
|
|
cm.sendOk("Sorry, you don't have enough mesos to purchase your place on the Hall of Fame.");
|
|
cm.dispose();
|
|
return;
|
|
}
|
|
|
|
if(Packages.server.life.MaplePlayerNPC.spawnPlayerNPC(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()), cm.getPlayer())) {
|
|
cm.sendOk("There you go! Hope you will like it.");
|
|
cm.gainMeso(-spawnPnpcFee);
|
|
} else {
|
|
cm.sendOk("Sorry, the Hall of Fame is currently full...");
|
|
}
|
|
}
|
|
|
|
cm.dispose();
|
|
return;
|
|
} else {
|
|
// do nothing
|
|
}
|
|
}
|
|
} |