// The Barber script has been around since before the repository split
// so it's hard to figure out who wrote it.
// o11c updated it according to new scripting standards while adding pink.
// ... and added the code that shows your old color/style.
// Note: there is a soft limit of 12 colors (0-11) and 20 styles (0-19)
// This is the number that can be set when creating a character
// or using GM commands, but scripts (such as this one) can set
// any value 0-255
function|script|Barber|,
{
set @style, getlook(LOOK_HAIR_STYLE);
set @color, getlook(LOOK_HAIR_COLOR);
set @style$, "Unknown";
set @color$, "Unknown";
if (@style >= 0 && @style < 20)
set @style$, $@HairStyles$[@style];
if (@color >= 0 && @color < 20)
set @color$, $@HairColors$[@color];
if (@color == 127)
set @color$, "Shocked White";
mes "Your current style is " + @style$ + " and your current color is " + @color$ + ".";
set @style$, "";
set @color$, "";
goto L_Main;
L_Main:
menu
"Change my style", L_Style,
"Change my color", L_Color,
"Nah, I'm fine", L_Done;
L_Style:
menu
"Bald", L_MenuItems,
"Flat ponytail", L_MenuItems,
"Bowl cut", L_MenuItems,
"Combed back", L_MenuItems,
"Emo", L_MenuItems,
"Mohawk", L_MenuItems,
"Pompadour", L_MenuItems,
"Center parting/Short and slick", L_MenuItems,
"Long and slick", L_MenuItems,
"Short and curly", L_MenuItems,
"Pigtails", L_MenuItems,
"Long and curly", L_MenuItems,
"Parted", L_MenuItems,
"Perky ponytail", L_MenuItems,
"Wave", L_MenuItems,
"Mane", L_MenuItems,
"Bun", L_MenuItems,
"Shoulder Length Flick", L_MenuItems,
"Fizzy", L_MenuItems,
"Long and Clipped", L_MenuItems,
"Surprise me", L_RandomStyle,
"Nah, I'm fine", L_Done;
L_MenuItems:
if (@menu - 1 == @style)
goto L_SameStyle;
setlook LOOK_HAIR_STYLE, @menu - 1;
goto L_Done;
L_RandomStyle:
setlook LOOK_HAIR_STYLE, rand(20);
goto L_Done;
L_SameStyle:
mes "Your hair already has that style.";
goto L_Main;
L_Color:
menu
"Brunette", L_MenuItems1,
"Green", L_MenuItems1,
"Dark red", L_MenuItems1,
"Light purple", L_MenuItems1,
"Gray", L_MenuItems1,
"Blonde", L_MenuItems1,
"Teal", L_MenuItems1,
"Light red", L_MenuItems1,
"Blue", L_MenuItems1,
"Dark purple", L_MenuItems1,
"Black", L_MenuItems1,
"Pink", L_MenuItems1,
"Brown", L_MenuItems1,
"Surprise me", L_RandomColor,
"Nah, I'm fine", L_Done;
L_MenuItems1:
if (@menu - 1 == @color)
goto L_SameColor;
setlook LOOK_HAIR_COLOR, @menu - 1;
goto L_Done;
L_RandomColor:
setlook LOOK_HAIR_COLOR, rand(13);
goto L_Done;
L_SameColor:
mes "Your hair is already that color.";
goto L_Main;
L_Done:
// cleanup
set @menu, 0;
set @style, 0;
set @color, 0;
return;
}
-|script|#BarberConfig|-1,
{
end;
OnInit:
setarray $@HairStyles$,
"Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
"Pompadour", "Center parting/Short and slick", "Long and slick",
"Short and curly", "Pigtails", "Long and curly", "Parted",
"Perky ponytail", "Wave", "Mane", "Bun", "Shoulder Length Flick",
"Fizzy", "Long and Clipped";
setarray $@HairColors$,
"Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
"Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
"Brown";
end;
}