summaryrefslogtreecommitdiff
path: root/world/map/npc/functions
diff options
context:
space:
mode:
authorJessica Tölke <jtoelke@mail.upb.de>2011-09-08 20:36:29 +0200
committerJessica Tölke <jtoelke@mail.upb.de>2011-09-08 20:36:29 +0200
commit5ea6c568c86d9c0f76983705258951e2db9974fa (patch)
tree94a402b645140a7bb9fbfa467a73cfb30d880a56 /world/map/npc/functions
parent2629fa14c6f7e6a5a7a71f5c784424cf80189f17 (diff)
parentcba4de9a5f7b9de412b9f458c80904cee9764a85 (diff)
downloadserverdata-5ea6c568c86d9c0f76983705258951e2db9974fa.tar.gz
serverdata-5ea6c568c86d9c0f76983705258951e2db9974fa.tar.bz2
serverdata-5ea6c568c86d9c0f76983705258951e2db9974fa.tar.xz
serverdata-5ea6c568c86d9c0f76983705258951e2db9974fa.zip
Merge remote-tracking branch 'testing/master'v2011.09.08
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r--world/map/npc/functions/barber.txt54
-rw-r--r--world/map/npc/functions/debug.txt6
2 files changed, 51 insertions, 9 deletions
diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt
index f4ad055d..09282106 100644
--- a/world/map/npc/functions/barber.txt
+++ b/world/map/npc/functions/barber.txt
@@ -2,6 +2,7 @@
// 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
@@ -9,11 +10,23 @@
// any value 0-255
function|script|Barber|{
- // TODO do something like this, but with names
- //set @style, getlook(LOOK_HAIR_STYLE);
- //set @color, getlook(LOOK_HAIR_COLOR);
- //mes "Your current style is " + @style + " and your current color is " + @color + ".";
+ 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$, "";
+
+L_Main:
menu
"Change my style", L_Style,
"Change my color", L_Color,
@@ -44,6 +57,9 @@ L_Style:
"Surprise me", L_RandomStyle,
"Nah, I'm fine", L_Done;
+ if (@menu - 1 == @style)
+ goto L_SameStyle;
+
setlook LOOK_HAIR_STYLE, @menu - 1;
goto L_Done;
@@ -51,6 +67,10 @@ L_RandomStyle:
setlook LOOK_HAIR_STYLE, rand(20);
goto L_Done;
+L_SameStyle:
+ mes "Your hair was already that style";
+ goto L_Main;
+
L_Color:
menu
"Brunette", -,
@@ -68,6 +88,9 @@ L_Color:
"Surprise me", L_RandomColor,
"Nah, I'm fine", L_Done;
+ if (@menu - 1 == @color)
+ goto L_SameColor;
+
setlook LOOK_HAIR_COLOR, @menu - 1;
goto L_Done;
@@ -75,10 +98,29 @@ L_RandomColor:
setlook LOOK_HAIR_COLOR, rand(12);
goto L_Done;
+L_SameColor:
+ mes "Your hair was already that color";
+ goto L_Main;
+
L_Done:
// cleanup
set @menu, 0;
- //set @style, 0;
- //set @color, 0;
+ set @style, 0;
+ set @color, 0;
+ return;
+}
+
+// Since this is a function, not an NPC, OnInit doesn't work
+// So call this from a real NPC's OnInit (001-1/barber.txt)
+function|script|OnInitBarber|{
+ 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", "Bald";
+ setarray $@HairColors$,
+ "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
+ "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink";
return;
}
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index 016bb98c..fe72eb72 100644
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -21,10 +21,10 @@ L_Level:
input @lvl;
if (@lvl > 255) goto L_Leveltoohigh;
if (@lvl < 1) goto L_Leveltoolow;
- if (Baselevel - @lvl == 0) goto L_Samelvl;
- set BaseLevel, BaseLevel - (Baselevel - @lvl);
+ if (Baselevel == @lvl) goto L_Samelvl;
+ set BaseLevel, @lvl;
resetstatus;
- message "New level: " + Baselevel;
+ message strcharinfo(0), "New level: " + Baselevel;
goto L_Begin;
L_Samelvl: