diff options
author | omatt <m.vuoso@laposte.net> | 2016-07-17 04:28:34 +0200 |
---|---|---|
committer | omatt <m.vuoso@laposte.net> | 2016-08-04 04:30:18 +0200 |
commit | b79920677e694ab904ce729b3bf6fc9df42f2882 (patch) | |
tree | 83f5b3306fd3f62fe95a04c404316368736d04e9 | |
parent | 04d08c1b5f1bc4e9b4676b68d75530453aefce43 (diff) | |
download | serverdata-b79920677e694ab904ce729b3bf6fc9df42f2882.tar.gz serverdata-b79920677e694ab904ce729b3bf6fc9df42f2882.tar.bz2 serverdata-b79920677e694ab904ce729b3bf6fc9df42f2882.tar.xz serverdata-b79920677e694ab904ce729b3bf6fc9df42f2882.zip |
add BarberSayStyle function in barber.txt, and add new line on the top of menu of edouard,
add hairstyle and haircolor array in npc/config/hairstyle_config.txt.
-rw-r--r-- | npc/001-2-29/edouard.txt | 18 | ||||
-rw-r--r-- | npc/config/hairstyle_config.txt | 24 | ||||
-rw-r--r-- | npc/functions/barber.txt | 135 | ||||
-rw-r--r-- | npc/scripts.conf | 3 |
4 files changed, 103 insertions, 77 deletions
diff --git a/npc/001-2-29/edouard.txt b/npc/001-2-29/edouard.txt index d3a73ca9..2cd948df 100644 --- a/npc/001-2-29/edouard.txt +++ b/npc/001-2-29/edouard.txt @@ -36,29 +36,33 @@ do { menuint - l("I'd like to get a different style."), 1, - l("Can you do something with my color?"), 2, - l("What's your story again?"), 3, - l("I'm fine for now, thank you."), 4; + l("What is my current hairstyle and hair color?"), 1, + l("I'd like to get a different style."), 2, + l("Can you do something with my color?"), 3, + l("What's your story again?"), 4, + l("I'm fine for now, thank you."), 5; switch (@menuret) { case 1: + BarberSayStyle 3; + break; + case 2: BarberChangeStyle; speech 5, l("Enjoy your new style."); l("Anything else?"); break; - case 2: + case 3: BarberChangeColor; speech 5, l("I hope you like this color."); l("Anything else?"); break; - case 3: + case 4: tellStory; break; - case 4: + case 5: speech 5, l("Feel free to come visit me another time."); diff --git a/npc/config/hairstyle_config.txt b/npc/config/hairstyle_config.txt new file mode 100644 index 00000000..de2d0467 --- /dev/null +++ b/npc/config/hairstyle_config.txt @@ -0,0 +1,24 @@ +// Hairstyle config +// set array of style and colors + +001-2-29,37,31,0 script hairstyle_config NPC_HIDDEN,0,0,{ + + end; + +OnInit: + setarray $@hairstyle$[0], "(none)", "Bald", "Bowl cut", "Combed back", + "Emo", "Mohawk", "Pompadour", "Center parting", "Long and slick", + "Short and curly", "Pigtails", "Long and curly", "Parted", + "Perky ponytail", "Wave", "Mane", "Bun", "Wavy", "Bunches", + "Long ponytail", "Infinitely long", "Choppy", "Wild", "Punk", + "Imperial", "Side strand", "Messy", "Flat ponytail", + "Tapered Nape"; + + setarray $@haircolor$[0], "Off black", "Ash brown", "Dark brown", + "Dark copper", "Auburn brown", "Honey brown", "Copper blonde", + "Golden blonde", "Pure platinum", "Cherry blossom", "Pinky pink", + "Fire red", "Light violet", "Purple plum", "Navy blue", + "Lagoon blue", "Twisted teal", "Spring Green", "Forest Green", + "Silver Grey", "Esperia Blue"; + end; +} diff --git a/npc/functions/barber.txt b/npc/functions/barber.txt index 7240d138..b08e52d6 100644 --- a/npc/functions/barber.txt +++ b/npc/functions/barber.txt @@ -1,65 +1,72 @@ // Evol scripts. // Authors: +// omatt // Reid // Travolta // Description: // Function for supporting barber NPC. +function script BarberSayStyle { + + .@get_color = getlook (LOOK_HAIR_COLOR); + .@get_look = getlook (LOOK_HAIR); + .@style_name$ = $@hairstyle$[.@get_look]; + .@color_name$ = $@haircolor$[.@get_color]; + + switch (getarg(0)) + { + case 1: + message strcharinfo(0), l("@@", .@style_name$); + break; + case 2: + message strcharinfo(0), l("@@", .@color_name$); + break; + case 3: + speech 4, + l("Your hairstyle is @@ and its color is @@.", .@style_name$, .@color_name$); + break; + } + return; +} function script BarberChangeStyle { do { + .@hairsizearray = getarraysize($@hairstyle$); .@get_look = getlook (LOOK_HAIR); - menuint - l("As you want!"), 0, - rif(.@get_look != 1, l("Bald")), 1, - rif(.@get_look != 2, l("Bowl cut")), 2, - rif(.@get_look != 3, l("Combed back")), 3, - rif(.@get_look != 4, l("Emo")), 4, - rif(.@get_look != 5, l("Mohawk")), 5, - rif(.@get_look != 6, l("Pompadour")), 6, - rif(.@get_look != 7, l("Center parting")), 7, - rif(.@get_look != 8, l("Long and slick")), 8, - rif(.@get_look != 9, l("Short and curly")), 9, - rif(.@get_look != 10, l("Pigtails")), 10, - rif(.@get_look != 11, l("Long and curly")), 11, - rif(.@get_look != 12, l("Parted")), 12, - rif(.@get_look != 13, l("Perky ponytail")), 13, - rif(.@get_look != 14, l("Wave")), 14, - rif(.@get_look != 15, l("Mane")), 15, - rif(.@get_look != 16, l("Bun")), 16, - rif(.@get_look != 17, l("Wavy")), 17, - rif(.@get_look != 18, l("Bunches")), 18, - rif(.@get_look != 19, l("Long ponytail")), 19, - rif(.@get_look != 20, l("Infinitely long")), 20, - rif(.@get_look != 21, l("Choppy")), 21, - rif(.@get_look != 22, l("Wild")), 22, - rif(.@get_look != 23, l("Punk")), 23, - rif(.@get_look != 24, l("Imperial")), 24, - rif(.@get_look != 25, l("Side strand")), 25, - rif(.@get_look != 26, l("Messy")), 26, - rif(.@get_look != 27, l("Flat ponytail")), 27, - rif(.@get_look != 28, l("Tapered nape")), 28, - l("Hmm, I'm fine for now, thank you."), 29; + // Here .@i starts from 1 because hairstyle 0 doesn't exist. + for (.@i = 1; .@i < .@hairsizearray; .@i++) + { + .@menustr$ = .@menustr$ + + rif(.@get_look != .@i, l("" + $@hairstyle$[.@i] + "")) + + ":"; + } + + .@menustr$ = .@menustr$ + l("I'm fine for now, thank you."); + + .@idx = select(l("As you want!"),.@menustr$); + + if (.@idx == .@i + 1) return; // last choice for quit dialog - switch (@menuret) + switch (@menu) { - case 0: + case 1: do { - .@rand_hair = rand(1,28); + // here "- 1" because i don't use the 0 of array + .@rand_hair = rand(1,(.@hairsizearray - 1)); } while (.@rand_hair == getlook (LOOK_HAIR)); setlook LOOK_HAIR, .@rand_hair; setlook LOOK_HAIR_COLOR, getlook (LOOK_HAIR_COLOR); - + BarberSayStyle 1; break; - case 29: - return; default: - setlook LOOK_HAIR, @menuret; + // and here "- 1" because the first choice is take by the random. + setlook LOOK_HAIR, (@menu - 1); setlook LOOK_HAIR_COLOR, getlook (LOOK_HAIR_COLOR); break; } + .@menustr$ = ""; } while (1); } @@ -67,49 +74,37 @@ function script BarberChangeColor { do { .@get_look = getlook (LOOK_HAIR_COLOR); + .@hairsizearray = getarraysize($@haircolor$); - menuint - l("Surprise me!"), 21, - rif(.@get_look != 0, l("Off black")), 0, - rif(.@get_look != 1, l("Ash brown")), 1, - rif(.@get_look != 2, l("Dark brown")), 2, - rif(.@get_look != 3, l("Dark copper")), 3, - rif(.@get_look != 4, l("Auburn brown")), 4, - rif(.@get_look != 5, l("Honey brown")), 5, - rif(.@get_look != 6, l("Copper blonde")), 6, - rif(.@get_look != 7, l("Golden blonde")), 7, - rif(.@get_look != 8, l("Pure platinum")), 8, - rif(.@get_look != 9, l("Cherry blossom")), 9, - rif(.@get_look != 10, l("Pinky pink")), 10, - rif(.@get_look != 11, l("Fire red")), 11, - rif(.@get_look != 12, l("Light violet")), 12, - rif(.@get_look != 13, l("Purple plum")), 13, - rif(.@get_look != 14, l("Navy blue")), 14, - rif(.@get_look != 15, l("Lagoon blue")), 15, - rif(.@get_look != 16, l("Twisted teal")), 16, - rif(.@get_look != 17, l("Spring green")), 17, - rif(.@get_look != 18, l("Forest green")), 18, - rif(.@get_look != 19, l("Silver grey")), 19, - rif(.@get_look != 20, l("Esperia blue")), 20, - l("Hmm, I'm fine for now, thank you."), 22; + for (.@i = 0; .@i < .@hairsizearray; .@i++) + { + .@menustr$ = .@menustr$ + + rif(.@get_look != .@i, l("" + $@haircolor$[.@i] + "")) + + ":"; + } - switch (@menuret) + .@menustr$ = l("Surprise me!") + ":" + .@menustr$ + l("I'm fine for now, thank you."); + + .@idx = select(.@menustr$); + + if (.@idx == .@i + 2) return; + + switch (@menu) { - case 21: + case 1: do { - .@rand_color = rand(0, 21); + .@rand_color = rand(0, .@hairsizearray); } while (.@rand_color == getlook (LOOK_HAIR_COLOR)); setlook LOOK_HAIR_COLOR, .@rand_color; - + BarberSayStyle 2; break; - case 22: - return; default: - setlook LOOK_HAIR_COLOR, @menuret; + setlook LOOK_HAIR_COLOR, (@menu - 2); break; } + .@menustr$ = ""; } while (1); return; -}
\ No newline at end of file +} diff --git a/npc/scripts.conf b/npc/scripts.conf index 4f602628..8dd4d06f 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -37,5 +37,8 @@ npc: npc/commands/music.txt npc: npc/commands/warp.txt npc: npc/commands/zeny.txt +// config script +npc: npc/config/hairstyle_config.txt + // Maps specific scripts import: npc/_import.txt |