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

@@ -36,6 +36,7 @@ function pushIfItemExists(array, itemid) {
array.push(itemid);
}
}
function start() {
status = -1;
action(1, 0, 0);
@@ -43,36 +44,40 @@ function start() {
function action(mode, type, selection) {
if (mode < 1) // disposing issue with stylishs found thanks to Vcoc
{
cm.dispose();
else {
if (mode == 1)
} else {
if (mode == 1) {
status++;
else
} else {
status--;
}
if (status == 0) {
cm.sendSimple("Well, hello! Welcome to the Henesys Plastic Surgery! Would you like to transform your face into something new? With a #b#t5152001##k, you can let us take care of the rest and have the face you've always wanted~!\r\n#L2#Plastic Surgery: #i5152001##t5152001##l");
} else if (status == 1) {
if (selection == 2) {
facenew = Array();
if (cm.getPlayer().getGender() == 0) {
for(var i = 0; i < mface_v.length; i++)
pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100));
for (var i = 0; i < mface_v.length; i++) {
pushIfItemExists(facenew, mface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100));
}
}
if (cm.getPlayer().getGender() == 1) {
for(var i = 0; i < fface_v.length; i++)
pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100));
for (var i = 0; i < fface_v.length; i++) {
pushIfItemExists(facenew, fface_v[i] + cm.getPlayer().getFace() % 1000 - (cm.getPlayer().getFace() % 100));
}
}
cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152001##k, you can get the face of your liking. Take your time in choosing the face of your preference.", facenew);
}
}
else if (status == 2){
} else if (status == 2) {
cm.dispose();
if (cm.haveItem(5152001) == true){
if (cm.haveItem(5152001) == true) {
cm.gainItem(5152001, -1);
cm.setFace(facenew[selection]);
cm.sendOk("Enjoy your new and improved face!");
} else
} else {
cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you...");
}
}
}
}