Reformat and clean up npc scripts

This commit is contained in:
P0nk
2021-09-09 23:35:02 +02:00
parent 0c1545f81d
commit d893309b4f
665 changed files with 19932 additions and 19046 deletions

View File

@@ -43,39 +43,43 @@ function start() {
}
function action(mode, type, selection) {
if (mode < 1)
if (mode < 1) {
cm.dispose();
else {
} else {
status++;
if (selection == 1) {
beauty = 1;
hairnew = Array();
for (var id = 0; id < cm.getPlayer().getGender() == 0 ? mhair_r.length : fhair_r.length; id++)
pushIfItemExists(hairnew, cm.getPlayer().getGender == 0 ? mhair_r[i] : fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10));
for (var id = 0; id < cm.getPlayer().getGender() == 0 ? mhair_r.length : fhair_r.length; id++) {
pushIfItemExists(hairnew, cm.getPlayer().getGender == 0 ? mhair_r[i] : fhair_r[i] + parseInt(cm.getPlayer().getHair() % 10));
}
cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY with a chance to obtain a new experimental style that I came up with. Are you going to use #b#t5150032##k and really change your hairstyle?");
} else if (selection == 2) {
beauty = 2;
haircolor = Array();
var current = parseInt(cm.getPlayer().getHair()/10)*10;
for(var i = 0; i < 8; i++)
var current = parseInt(cm.getPlayer().getHair() / 10) * 10;
for (var i = 0; i < 8; i++) {
pushIfItemExists(haircolor, current + i);
}
cm.sendYesNo("If you use the REG coupon your hair will change RANDOMLY. Do you still want to use #b#t5151027##k and change it up?");
} else if (status == 2) {
if (beauty == 1){
if (cm.haveItem(5150032)){
if (beauty == 1) {
if (cm.haveItem(5150032)) {
cm.gainItem(5150032, -1);
cm.setHair(hairnew[Math.floor(Math.random() * hairnew.length)]);
cm.sendOk("Enjoy your new and improved hairstyle!");
} else
} 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...");
}
}
if (beauty == 2){
if (cm.haveItem(5151027)){
if (beauty == 2) {
if (cm.haveItem(5151027)) {
cm.gainItem(5151027, -1);
cm.setHair(haircolor[Math.floor(Math.random() * haircolor.length)]);
cm.sendOk("Enjoy your new and improved haircolor!");
} else
} else {
cm.sendOk("Hmmm...it looks like you don't have our designated coupon...I'm afraid I can't dye your hair without it. I'm sorry...");
}
}
cm.dispose();
}