summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@gmail.com>2014-10-23 16:18:56 -0400
committermekolat <mekolat@gmail.com>2014-10-23 16:18:56 -0400
commit20e268cd6b8179c5f2a7ac772e533013764e65f4 (patch)
tree437f851b9050e894e74f4f0f308d3a0716d5a605
parente343e7fc35a14c453aa0cb218b97a66077573bed (diff)
downloadserverdata-20e268cd6b8179c5f2a7ac772e533013764e65f4.tar.gz
serverdata-20e268cd6b8179c5f2a7ac772e533013764e65f4.tar.bz2
serverdata-20e268cd6b8179c5f2a7ac772e533013764e65f4.tar.xz
serverdata-20e268cd6b8179c5f2a7ac772e533013764e65f4.zip
add janitor for old classes
-rw-r--r--world/map/npc/functions/headstyles.txt44
1 files changed, 30 insertions, 14 deletions
diff --git a/world/map/npc/functions/headstyles.txt b/world/map/npc/functions/headstyles.txt
index f79e97fe..072a9fbf 100644
--- a/world/map/npc/functions/headstyles.txt
+++ b/world/map/npc/functions/headstyles.txt
@@ -7,19 +7,35 @@ function|script|getHeadStyles|,
set @HairColors$, 0;
cleararray @HairStyles$, "", getarraysize(@HairStyles$);
cleararray @HairColors$, "", getarraysize(@HairColors$);
- if(Class == 0)
- setarray @HairStyles$, // TALPONIAN (human)
- "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";
- if(Class == 0)
- setarray @HairColors$, // TALPONIAN (human)
- "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
- "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
- "Brown";//, "(free slot)", "(free slot)";
+ cleararray @ValidClasses, "", getarraysize(@ValidClasses);
+ setarray @ValidClasses, 0; // add new classes here
+ set @loop, 0;
+ if(Class != 0) goto L_LoopValid;
+ goto L_ValidClass;
- // adding a new species is as simple as adding another if(Class == X)
- return;
+ L_LoopValid:
+ if(@ValidClasses[@loop] == Class) goto L_ValidClass;
+ set @loop, (@loop + 1);
+ if(@loop >= getarraysize(@ValidClasses)) goto L_FixClass;
+ goto L_LoopValid;
+
+ L_FixClass:
+ set Class, 0;
+ goto L_ValidClass;
+
+ L_ValidClass:
+ if(Class == 0)
+ setarray @HairStyles$, // TALPONIAN (human)
+ "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";
+ if(Class == 0)
+ setarray @HairColors$, // TALPONIAN (human)
+ "Brunette", "Green", "Dark red", "Light purple", "Gray", "Blonde",
+ "Teal", "Light red", "Blue", "Dark purple", "Black", "Pink",
+ "Brown";//, "(free slot)", "(free slot)";
+ // adding a new species is as simple as adding another if(Class == X) and adding the class to @ValidClasses
+ return;
}