Reformat and clean up npc scripts
This commit is contained in:
@@ -19,68 +19,68 @@ function pushIfItemExists(array, itemid) {
|
||||
}
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
cm.sendSimple("Hahaha... it takes a lot of style and flair for someone to pay attention to his or her hairsyle in a desert. Someone like you...If you have #bAriant hair style coupon(VIP)#k or #bAriant hair color coupon(VIP)#k, I'll give your hair a fresh new look. \r\n#L0#Haircut: #i5150027##t5150027##l\r\n#L1#Dye your hair: #i5151022##t5151022##l");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
beauty = 1;
|
||||
hairnew = Array();
|
||||
if (cm.getChar().getGender() == 0) {
|
||||
for(var i = 0; i < mhair_v.length; i++) {
|
||||
pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getChar().getHair()
|
||||
% 10));
|
||||
}
|
||||
}
|
||||
if (cm.getChar().getGender() == 1) {
|
||||
for(var i = 0; i < fhair_v.length; i++) {
|
||||
pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getChar().getHair()
|
||||
% 10));
|
||||
}
|
||||
}
|
||||
cm.sendStyle("Hahaha~all you need is #bAriant hair style coupon(VIP)#k to change up your hairstyle. Choose the new style, and let me do the rest.", hairnew);
|
||||
} else if (selection == 1) {
|
||||
beauty = 2;
|
||||
haircolor = Array();
|
||||
var current = parseInt(cm.getChar().getHair()
|
||||
/10)*10;
|
||||
for(var i = 0; i < 8; i++) {
|
||||
pushIfItemExists(haircolor, current + i);
|
||||
}
|
||||
cm.sendStyle("Every once in a while, it doesn't hurt to change up your hair color... it's fun. Allow me, the great Mazra, to dye your hair, so you just bring me #bAriant hair color coupon(VIP)#k, and choose your new hair color.", haircolor);
|
||||
}
|
||||
}
|
||||
else if (status == 2){
|
||||
cm.dispose();
|
||||
if (beauty == 1){
|
||||
if (cm.haveItem(5150027) == true){
|
||||
cm.gainItem(5150027, -1);
|
||||
cm.setHair(hairnew[selection]);
|
||||
cm.sendOk("Enjoy your new and improved hairstyle!");
|
||||
} else {
|
||||
cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again.");
|
||||
}
|
||||
}
|
||||
if (beauty == 2){
|
||||
if (cm.haveItem(5151022) == true){
|
||||
cm.gainItem(5151022, -1);
|
||||
cm.setHair(haircolor[selection]);
|
||||
cm.sendOk("Enjoy your new and improved haircolor!");
|
||||
} else {
|
||||
cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mode < 1) { // disposing issue with stylishs found thanks to Vcoc
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
} else {
|
||||
status--;
|
||||
}
|
||||
if (status == 0) {
|
||||
cm.sendSimple("Hahaha... it takes a lot of style and flair for someone to pay attention to his or her hairsyle in a desert. Someone like you...If you have #bAriant hair style coupon(VIP)#k or #bAriant hair color coupon(VIP)#k, I'll give your hair a fresh new look. \r\n#L0#Haircut: #i5150027##t5150027##l\r\n#L1#Dye your hair: #i5151022##t5151022##l");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
beauty = 1;
|
||||
hairnew = Array();
|
||||
if (cm.getChar().getGender() == 0) {
|
||||
for (var i = 0; i < mhair_v.length; i++) {
|
||||
pushIfItemExists(hairnew, mhair_v[i] + parseInt(cm.getChar().getHair()
|
||||
% 10));
|
||||
}
|
||||
}
|
||||
if (cm.getChar().getGender() == 1) {
|
||||
for (var i = 0; i < fhair_v.length; i++) {
|
||||
pushIfItemExists(hairnew, fhair_v[i] + parseInt(cm.getChar().getHair()
|
||||
% 10));
|
||||
}
|
||||
}
|
||||
cm.sendStyle("Hahaha~all you need is #bAriant hair style coupon(VIP)#k to change up your hairstyle. Choose the new style, and let me do the rest.", hairnew);
|
||||
} else if (selection == 1) {
|
||||
beauty = 2;
|
||||
haircolor = Array();
|
||||
var current = parseInt(cm.getChar().getHair()
|
||||
/ 10) * 10;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
pushIfItemExists(haircolor, current + i);
|
||||
}
|
||||
cm.sendStyle("Every once in a while, it doesn't hurt to change up your hair color... it's fun. Allow me, the great Mazra, to dye your hair, so you just bring me #bAriant hair color coupon(VIP)#k, and choose your new hair color.", haircolor);
|
||||
}
|
||||
} else if (status == 2) {
|
||||
cm.dispose();
|
||||
if (beauty == 1) {
|
||||
if (cm.haveItem(5150027) == true) {
|
||||
cm.gainItem(5150027, -1);
|
||||
cm.setHair(hairnew[selection]);
|
||||
cm.sendOk("Enjoy your new and improved hairstyle!");
|
||||
} else {
|
||||
cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again.");
|
||||
}
|
||||
}
|
||||
if (beauty == 2) {
|
||||
if (cm.haveItem(5151022) == true) {
|
||||
cm.gainItem(5151022, -1);
|
||||
cm.setHair(haircolor[selection]);
|
||||
cm.sendOk("Enjoy your new and improved haircolor!");
|
||||
} else {
|
||||
cm.sendNext("I thought I told you, you need the coupon in order for me to work magic on your hair check again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user