Files
sweetgum-server/scripts/npc/1012117.js
ronancpl 74b4ca4132 Reworked Autoassigner & Hero's Will & Trade + Visual NX + New commands
Reworked autoassigner (improved limits between required secondary and
surplus primary stats). Hero's will removes most of diseases, tonic
removes slow. Added visual info for collected NX cards. Added commands
cake (cake boss with customizable HP) and setgmlevel. Reworked Trade
system now checking for slots smartly (instead of just checking for
empty slots).
2017-09-01 01:20:01 -03:00

82 lines
3.2 KiB
JavaScript

/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
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/>.
*/
/*
NPC Name: Big Headward
Map(s): Victoria Road : Henesys Hair Salon (100000104)
Description: Random haircut
*/
var status = 0;
var mhair = Array(30040, 30050, 30100, 30130, 30180, 30220, 30260, 30330, 30350, 30580);
var fhair = Array(31020, 31160, 31180, 31220, 31290, 31330, 31420, 31440, 31480, 31590);
var hairnew = Array();
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.sendSimple("If you use this regular coupon, your hair may transform into a random new look...do you still want to do it using #b#t5150040##k, I will do it anyways for you. But don't forget, it will be random!\r\n\#L2#OK! (Uses #i5150040# #t5150040#)#l");
} else if (status == 1) {
cm.sendYesNo("If you use the EXP coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that even you didn't think was possible. Are you going to use #b#t5150040##k and really change your hairstyle?");
}
else if (status == 2) {
if (cm.haveItem(5150040) == true){
hairnew = Array();
if (cm.getPlayer().getGender() == 0) {
for(var i = 0; i < mhair.length; i++) {
hairnew.push(mhair[i] + parseInt(cm.getPlayer().getHair() % 10));
}
}
else {
for(var i = 0; i < fhair.length; i++) {
hairnew.push(fhair[i] + parseInt(cm.getPlayer().getHair() % 10));
}
}
cm.gainItem(5150040, -1);
cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]);
cm.sendOk("Enjoy your new and improved hairstyle!");
} else {
cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't give you a haircut without it. I'm sorry...");
}
cm.dispose();
}
}
}