From 401ff146cbd56e214007c1a298194fdef66d5a96 Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 5 Jan 2016 10:30:44 -0500 Subject: remove the cruft left behind, prepare for new races --- world/map/npc/functions/barber.txt | 87 +++++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 24 deletions(-) (limited to 'world/map/npc/functions/barber.txt') diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt index 2c940c33..2413e0fe 100644 --- a/world/map/npc/functions/barber.txt +++ b/world/map/npc/functions/barber.txt @@ -4,13 +4,15 @@ // 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) +// Note: there is a soft limit of 15 colors per classes 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 { + if (getequipid(equip_head) == 647) + goto L_Debug; callfunc "getHeadStyles"; goto L_Main; @@ -21,12 +23,11 @@ L_Main: set @color$, "Unknown"; if (@style >= 1 && @style <= 20) set @style$, @HairStyles$[(@style - 1)]; - if (Class > 1) - set @color, (@color - (15 * Class)); + if (@color == ((HC_WHITE - Class) + 1)) + set @color$, "Shocked White"; + set @color, (@color - (15 * (Class - 1))); if (@color >= 0 && @color <= 15) 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$, ""; @@ -61,24 +62,22 @@ L_Style: @HairStyles$[18], L_MenuItems, @HairStyles$[19], L_MenuItems, @HairStyles$[20], L_MenuItems, - @HairStyles$[21], L_MenuItems, - @HairStyles$[22], L_MenuItems, - @HairStyles$[23], L_MenuItems, - @HairStyles$[24], L_MenuItems, - @HairStyles$[25], L_MenuItems; + @HairStyles$[21], L_MenuItems; L_MenuItems: if (@menu == @style) goto L_SameStyle; if(@menu == (getarraysize(@HairStyles$) - 1)) goto L_RandomStyle; - if(@menu == getarraysize(@HairStyles$)) goto L_Done; + if(@menu >= getarraysize(@HairStyles$)) goto L_Done; setlook LOOK_HAIR_STYLE, @menu; goto L_Main; L_RandomStyle: - set @randomStyle, rand(1, (getarraysize(@HairStyles$) -4)); - if(@randomStyle == @style) goto L_RandomStyle; - setlook LOOK_HAIR_STYLE, @randomStyle; + setarray @randomStyle[0], rand(1, (getarraysize(@HairStyles$) - 2)); + setarray @randomStyle[1], @randomStyle[1] + 1; // infinite loop prevention + if(@randomStyle[0] == @style && @randomStyle[1] < 15) goto L_RandomStyle; + setlook LOOK_HAIR_STYLE, @randomStyle[0]; + setarray @randomStyle[1], 0; menu "Surprise me once again", L_RandomStyle, "Go back", L_Main, @@ -89,7 +88,6 @@ L_SameStyle: goto L_Main; L_Color: - if(@style == @BaldStyle) goto L_SameColor; // last headstyle of any class is bald if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Surprise me"; if(!@colorOpts) set @HairColors$[getarraysize(@HairColors$)], "Nah, I'm fine"; if(!@colorOpts) set @colorOpts, 1; @@ -116,24 +114,26 @@ L_MenuItems1: if (@menu - 1 == @color) goto L_SameColor; if(@menu == (getarraysize(@HairColors$) - 1)) goto L_RandomColor; - if(@menu == getarraysize(@HairColors$)) goto L_Done; + if(@menu >= getarraysize(@HairColors$)) goto L_Done; setlook LOOK_HAIR_COLOR, ((@menu - 1) + (15 * (Class - 1))); goto L_Main; L_RandomColor: - set @randomColor, rand((15 * (Class - 1)), ((getarraysize(@HairColors$) -4) + (15 * (Class - 1)))); - if(@randomColor == @color) goto L_RandomColor; - setlook LOOK_HAIR_COLOR, @randomColor; + setarray @randomColor[0], rand((15 * (Class - 1)), ((getarraysize(@HairColors$) - 3) + (15 * (Class - 1)))); + setarray @randomColor[1], @randomColor[1] + 1; + if(@randomColor[0] == @color && @randomColor[1] < 15) goto L_RandomColor; + setlook LOOK_HAIR_COLOR, @randomColor[0]; + setarray @randomColor[1], 0; menu "Surprise me once again", L_RandomColor, "Go back", L_Main, "Goodbye", L_Done; L_SameColor: - mes "You are either bald or your hair is already that color."; + mes "You already have that color."; goto L_Main; -S_Janitor: +L_Done: // cleanup set @menu, 0; set @style, 0; @@ -144,7 +144,46 @@ S_Janitor: set @colorOpts, 0; return; -L_Done: - callsub S_Janitor; - return; +L_Debug: + npcaction 9; // FIXME: this should become a builtin (ie `clear`) + mes "Class: " + Class; + mes "Style: " + getlook(LOOK_HAIR_STYLE); + mes "Color: " + getlook(LOOK_HAIR_COLOR); + menu + "edit| Set Class", L_DebugClass, + "edit| Set Style", L_DebugStyle, + "edit| Set Color", L_DebugColor, + "toggle| Simulate logout", L_DebugLogout, + "Close", L_Done; + +L_DebugLogout: + callfunc "fixHeadStyles"; + goto L_Debug; + +L_DebugClass: + set @dbg_class, 0; + mes "input class (0-32767)"; + input @dbg_class; + if (@dbg_class >= 0 && @dbg_class <= 32767) + set Class, @dbg_class; + set @dbg_class, 0; + goto L_Debug; + +L_DebugStyle: + set @dbg_style, 0; + mes "input style (0-255)"; + input @dbg_style; + if (@dbg_style >= 0 && @dbg_style <= 255) + setlook LOOK_HAIR_STYLE, @dbg_style; + set @dbg_style, 0; + goto L_Debug; + +L_DebugColor: + set @dbg_color, 0; + mes "input color (0-255)"; + input @dbg_color; + if (@dbg_color >= 0 && @dbg_color <= 255) + setlook LOOK_HAIR_COLOR, @dbg_color; + set @dbg_color, 0; + goto L_Debug; } -- cgit v1.2.3-70-g09d2 From f28b9ef883c8da9a890096d8e05865b90795c46d Mon Sep 17 00:00:00 2001 From: wushin Date: Sun, 17 Jan 2016 19:10:01 -0600 Subject: Fix gender as a starting condition make sex changes free make barbers do sex changes --- world/map/npc/002-2/eurni.txt | 21 +-------------------- world/map/npc/029-2/sorfina.txt | 4 +++- world/map/npc/functions/barber.txt | 30 ++++++++++++++++++++++++++++++ world/map/npc/functions/change_sex.txt | 24 ++++++++++++++++++++++++ world/map/npc/functions/game_rules.txt | 1 - 5 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 world/map/npc/functions/change_sex.txt (limited to 'world/map/npc/functions/barber.txt') diff --git a/world/map/npc/002-2/eurni.txt b/world/map/npc/002-2/eurni.txt index c9735ad0..7e7254ed 100644 --- a/world/map/npc/002-2/eurni.txt +++ b/world/map/npc/002-2/eurni.txt @@ -2,19 +2,13 @@ 002-2,22,77,0|script|Eurni|136 { - set @SERVICES_ZENY, 10000; - set @halloween_npc_id, $@halloween_npc_eurni; callfunc "TrickOrTreat"; - if (BaseLevel < 10) goto L_TooYoung; - if (Zeny < @SERVICES_ZENY) goto L_NoMoney; - mes "[Eurni the Surgeon]"; mes "\"Are you tired of who you are?\""; next; - mes "\"Would you be interested in changing your sex?"; - mes "It'll cost ##B" + @SERVICES_ZENY + " GP##b.\""; + mes "\"Would you be interested in changing your sex?\""; next; menu @@ -42,9 +36,6 @@ L_NonBinary: L_Change: if (Sex == @sex) goto L_Already_Change; - if (Zeny < @SERVICES_ZENY) - goto L_NoMoney; - set Zeny, Zeny - @SERVICES_ZENY; set Sex, @sex; close; @@ -53,16 +44,6 @@ L_Already_Change: mes "\"Umm, you are that gender already.\""; close; -L_TooYoung: - mes "[Eurni the Surgeon]"; - mes "\"Move along, kid.\""; - close; - -L_NoMoney: - mes "[Eurni the Surgeon]"; - mes "\"You don't have the kind of money to pay for my services.\""; - close; - L_Close: close; } diff --git a/world/map/npc/029-2/sorfina.txt b/world/map/npc/029-2/sorfina.txt index ff5b3a3b..9e35b549 100644 --- a/world/map/npc/029-2/sorfina.txt +++ b/world/map/npc/029-2/sorfina.txt @@ -342,6 +342,7 @@ L_Block: mes "[Server/Client Notice]"; mes "The explanations in this tutorial are based on the official client, Manaplus."; mes "If you're using another client, settings and controls may be different."; + callfunc "ChangeSex"; callfunc "GameRules"; close; } @@ -349,10 +350,11 @@ L_Block: { if (TUT_var > 0) end; - callfunc "GameRules"; mes "[Server/Client Notice]"; mes "The explanations in this tutorial are based on the official client, Manaplus."; mes "If you're using another client, settings and controls may be different."; + callfunc "ChangeSex"; + callfunc "GameRules"; close; } 029-2,22,26,0|script|#GameRules3|32767,1,0 diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt index 2413e0fe..effa3436 100644 --- a/world/map/npc/functions/barber.txt +++ b/world/map/npc/functions/barber.txt @@ -34,8 +34,38 @@ L_Main: menu "Change my style", L_Style, "Change my color", L_Color, + "Change my gender", L_Gender, "Nah, I'm fine", L_Done; +L_Gender: + menu + "Female.", L_Female, + "Male.", L_Male, + "Non-binary.", L_NonBinary, + "Nah, I'm fine", L_Done; + +L_Female: + set @sex, 0; + goto L_Change; + +L_Male: + set @sex, 1; + goto L_Change; + +L_NonBinary: + set @sex, 3; + goto L_Change; + +L_Change: + if (Sex == @sex) + goto L_Already_Change; + set Sex, @sex; + return; + +L_Already_Change: + mes "\"Umm, you are that gender already.\""; + return; + L_Style: if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Surprise me"; if(!@hairOpts) set @HairStyles$[getarraysize(@HairStyles$)], "Nah, I'm fine"; diff --git a/world/map/npc/functions/change_sex.txt b/world/map/npc/functions/change_sex.txt new file mode 100644 index 00000000..f81334f6 --- /dev/null +++ b/world/map/npc/functions/change_sex.txt @@ -0,0 +1,24 @@ +function|script|ChangeSex +{ + mes "Please select a character gender:"; + menu + "Female.", L_Female, + "Male.", L_Male, + "Non-binary.", L_NonBinary; + +L_Female: + set @sex, 0; + goto L_Change; + +L_Male: + set @sex, 1; + goto L_Change; + +L_NonBinary: + set @sex, 3; + goto L_Change; + +L_Change: + set Sex, @sex; + return; +} diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt index cb72dfec..e2b9df81 100644 --- a/world/map/npc/functions/game_rules.txt +++ b/world/map/npc/functions/game_rules.txt @@ -2,7 +2,6 @@ function|script|GameRules { - mes "[Game Rules]"; mes "Please select a language:"; menu -- cgit v1.2.3-70-g09d2 From d0b2262fc38ecfa47671e1738d657b4317238499 Mon Sep 17 00:00:00 2001 From: wushin Date: Tue, 26 Jan 2016 13:32:37 -0600 Subject: Move gender selection to intro dialogue --- world/conf/char_athena.conf | 8 +++---- world/map/db/const.txt | 2 +- world/map/npc/029-2/sorfina.txt | 38 +++++++++++++++++++++++++++++----- world/map/npc/029-2/stat_reset.txt | 12 +++++++++-- world/map/npc/029-2/tanisha.txt | 3 ++- world/map/npc/functions/barber.txt | 11 ++++++++++ world/map/npc/functions/change_sex.txt | 24 --------------------- world/map/npc/functions/headstyles.txt | 11 +++++++--- 8 files changed, 69 insertions(+), 40 deletions(-) delete mode 100644 world/map/npc/functions/change_sex.txt (limited to 'world/map/npc/functions/barber.txt') diff --git a/world/conf/char_athena.conf b/world/conf/char_athena.conf index 64f8b082..3e0fa61d 100644 --- a/world/conf/char_athena.conf +++ b/world/conf/char_athena.conf @@ -45,17 +45,17 @@ min_name_length: 4 char_slots: 9 // max hair style and hair color -max_hair_style: 20 -max_hair_color: 11 +max_hair_style: 1 +max_hair_color: 1 // the minimum value for stats (str, agi, ...) min_stat_value: 1 // the maximum value for stats (str, agi, ...) -max_stat_value: 9 +max_stat_value: 1 // the sum of all stats combined (str + agi + int + ...) -total_stat_sum: 30 +total_stat_sum: 6 // Filename of the file which receives the online players list in text online_txt_filename: online.txt diff --git a/world/map/db/const.txt b/world/map/db/const.txt index 71f1f06c..d3b42ee4 100644 --- a/world/map/db/const.txt +++ b/world/map/db/const.txt @@ -14,7 +14,7 @@ Hp 5 1 MaxHp 6 1 Sp 7 1 MaxSp 8 1 -//StatusPoint 9 1 +StatusPoint 9 1 BaseLevel 11 1 //SkillPoint 12 1 Class 19 1 diff --git a/world/map/npc/029-2/sorfina.txt b/world/map/npc/029-2/sorfina.txt index 9e35b549..9d2d4bb3 100644 --- a/world/map/npc/029-2/sorfina.txt +++ b/world/map/npc/029-2/sorfina.txt @@ -26,13 +26,43 @@ L_Start: mes "\"You didn't have any possessions on you when we found you and no one knows who you are.\""; mes "Do you have a name?"; menu - strcharinfo(0), L_name; + strcharinfo(0), L_Name; -L_name: +L_Name: mes "[Old Woman]"; mes "\"Well " + strcharinfo(0) + " what else can you tell me about yourself?.\""; menu - "Umm... I... I don't remember anything...", L_KnowNothing; + "I'm a woman from ...", L_Woman, + "I'm a man that lived in ...", L_Man, + "My home is in ...", L_N; + +L_Woman: + set Sex, 0; + goto L_Species; + +L_Man: + set Sex, 1; + goto L_Species; + +L_N: + set Sex, 2; + goto L_Species; + +L_Species: + mes "[Old Woman]"; + mes "\"Go on. If you need to think a bit, take your time.\""; + menu + "... Tulimshar in Tonori ... I'm a Talpan.", L_Talpan; + +L_Talpan: + set Class, 1; + goto L_AnythingElse; + +L_AnythingElse: + mes "[Old Woman]"; + mes "\"Anything else you can remember?\""; + menu + "Umm... no... I... I don't remember anything else...", L_KnowNothing; L_KnowNothing: mes "[Old Woman]"; @@ -342,7 +372,6 @@ L_Block: mes "[Server/Client Notice]"; mes "The explanations in this tutorial are based on the official client, Manaplus."; mes "If you're using another client, settings and controls may be different."; - callfunc "ChangeSex"; callfunc "GameRules"; close; } @@ -353,7 +382,6 @@ L_Block: mes "[Server/Client Notice]"; mes "The explanations in this tutorial are based on the official client, Manaplus."; mes "If you're using another client, settings and controls may be different."; - callfunc "ChangeSex"; callfunc "GameRules"; close; } diff --git a/world/map/npc/029-2/stat_reset.txt b/world/map/npc/029-2/stat_reset.txt index 6123f632..427a1da5 100644 --- a/world/map/npc/029-2/stat_reset.txt +++ b/world/map/npc/029-2/stat_reset.txt @@ -11,11 +11,18 @@ mes "[Jessie]"; mes "\"I know a spell that will"; mes "reset status points on the youngings."; + mes ""; + mes "I can also change their appearance.\""; next; menu "Reset my stats",L_Reset, + "Change my appearance", L_Appearance, "Forget about it",L_Pass; +L_Appearance: + callfunc "Barber"; + goto L_Pass; + L_Reset: resetstatus; @@ -35,8 +42,9 @@ L_Sorry: mes "\"My spell only works on the very young, sorry.\""; next; mes "\"You can try Mailvox in the Tulimshar Bazaar or Wyara in the Potion Shop in Hurnscald.\""; - next; - goto L_Close; + menu + "Change my appearance", L_Appearance, + "Bye", L_Close; L_Close: close; diff --git a/world/map/npc/029-2/tanisha.txt b/world/map/npc/029-2/tanisha.txt index d69195a5..7142721e 100644 --- a/world/map/npc/029-2/tanisha.txt +++ b/world/map/npc/029-2/tanisha.txt @@ -110,7 +110,8 @@ L_StatsRe: next; mes "\"Think about how you want to play before assigning the points.\""; mes "\"My Uncle sitting at the counter knows a spell to help the younglings reset their stats.\""; - mes "\"He also knows of mages with even more powerful reset spells.\""; + mes "\"He can also change your hair style and color, along with your gender.\""; + mes "\"Furthermore, he knows of mages with even more powerful reset spells for your stats.\""; next; if (QL_BEGIN == 7) goto L_Money; diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt index effa3436..54732418 100644 --- a/world/map/npc/functions/barber.txt +++ b/world/map/npc/functions/barber.txt @@ -179,10 +179,12 @@ L_Debug: mes "Class: " + Class; mes "Style: " + getlook(LOOK_HAIR_STYLE); mes "Color: " + getlook(LOOK_HAIR_COLOR); + mes "Gender: " + Sex; menu "edit| Set Class", L_DebugClass, "edit| Set Style", L_DebugStyle, "edit| Set Color", L_DebugColor, + "edit| Set Gender", L_DebugGender, "toggle| Simulate logout", L_DebugLogout, "Close", L_Done; @@ -216,4 +218,13 @@ L_DebugColor: setlook LOOK_HAIR_COLOR, @dbg_color; set @dbg_color, 0; goto L_Debug; + +L_DebugGender: + set @dbg_gender, 0; + mes "input gender (0-3)"; + input @dbg_gender; + if (@dbg_gender >= 0 && @dbg_gender <= 3) + set Sex, @dbg_gender; + set @dbg_gender, 0; + goto L_Debug; } diff --git a/world/map/npc/functions/change_sex.txt b/world/map/npc/functions/change_sex.txt deleted file mode 100644 index f81334f6..00000000 --- a/world/map/npc/functions/change_sex.txt +++ /dev/null @@ -1,24 +0,0 @@ -function|script|ChangeSex -{ - mes "Please select a character gender:"; - menu - "Female.", L_Female, - "Male.", L_Male, - "Non-binary.", L_NonBinary; - -L_Female: - set @sex, 0; - goto L_Change; - -L_Male: - set @sex, 1; - goto L_Change; - -L_NonBinary: - set @sex, 3; - goto L_Change; - -L_Change: - set Sex, @sex; - return; -} diff --git a/world/map/npc/functions/headstyles.txt b/world/map/npc/functions/headstyles.txt index 02cc895f..1098c80c 100644 --- a/world/map/npc/functions/headstyles.txt +++ b/world/map/npc/functions/headstyles.txt @@ -3,10 +3,9 @@ function|script|fixHeadStyles { - if (Class < 1 || Class > 5) // usable classes - set Class, 1; // it is impossible to use custom styling for class 0 in m+ so default is 1 - callfunc "getHeadStyles"; + if ((TUT_var < 1 || QL_BEGIN < 1) && StatusPoint < 1) + goto L_RandomHair; // on first login set @style, getlook(LOOK_HAIR_STYLE); // FIXME: this needs to be a param in the future set @color, getlook(LOOK_HAIR_COLOR); // FIXME: this needs to be a param in the future if (@style < 1 || @style > getarraysize(@HairStyles$)) // leftover from previous attempt at classes @@ -17,6 +16,12 @@ function|script|fixHeadStyles set @color, 15 * (Class - 1); // it is possible to style color 0 but not style 0 since style is treated as an item setlook LOOK_HAIR_COLOR, @color; // FIXME: this needs to be a param in the future return; + +L_RandomHair: + resetstatus; // <= important! gives 48 stat points + setlook LOOK_HAIR_STYLE, rand(1, getarraysize(@HairStyles$)); + setlook LOOK_HAIR_COLOR, rand((15 * (Class - 1)),((15 * (Class - 1)) + (getarraysize(@HairColors$) - 1))); + return; } function|script|getHeadStyles -- cgit v1.2.3-70-g09d2