Skip to content

Commit

Permalink
Replaced hardcoded genders with constants (rathena#1730)
Browse files Browse the repository at this point in the history
* Replaced hardcoded gender codes in source

Introduced a new constant for the account based gender and replaced all hardcoded gender references to code 99 with it.

* Replaced hardcoded gender codes in npcs

Exported the gender constants into the script engine and replaced all usages with references to the constants instead of expecting a value behind them.

* Corrected a typo

Thanks to Machiezmo from Discord.

* Fixed an inverted gender logic

Thanks to @secretdataz
  • Loading branch information
Lemongrass3110 authored Nov 22, 2016
1 parent c7a8909 commit 9b1b7b1
Show file tree
Hide file tree
Showing 96 changed files with 383 additions and 378 deletions.
2 changes: 1 addition & 1 deletion npc/cities/aldebaran.txt
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ aldeba_in,156,179,4 script Master#alde 61,{
mes "Who's your";
mes "favorite Kafra girl?";
next;
if (Sex == 0) {
if (Sex == SEX_FEMALE) {
mes "[Master]";
mes "Oh, and don't worry. I know that girls have some kind of opinion about how pretty other girls are.";
next;
Expand Down
4 changes: 2 additions & 2 deletions npc/cities/amatsu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ amatsu,243,202,3 script Drama Teacher#ama 760,{
mes "Also, this town is the origin of";
mes "legendary play, 'White Dryad.' ";
next;
if (Sex) {
if (Sex == SEX_MALE) {
mes "[Garakame sensei]";
mes "If you know a girl who is";
mes "talented in acting, please";
Expand Down Expand Up @@ -531,7 +531,7 @@ amatsu,262,197,1 script Legendary Tree 111,{
mes "Nymph of cherry tree... What would";
mes "be her position in the play?^000000";
next;
if (Sex) {
if (Sex == SEX_MALE) {
mes "^3355FFI would like to find";
mes "a person who is talented";
mes "in acting and help her until";
Expand Down
4 changes: 2 additions & 2 deletions npc/cities/einbech.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ einbech,46,107,6 script Shena#ein::EinMonsters 846,{
mes "adorable little girl?";
mes "Hello, dearie~";
next;
if (Sex) {
if (Sex == SEX_MALE) {
select("Excuse me, but I'm actually a guy.");
mes "[Shena]";
mes "Oh, oh are you now?";
Expand All @@ -542,7 +542,7 @@ einbech,46,107,6 script Shena#ein::EinMonsters 846,{
mes "about the monsters around";
mes "here, young lady?";
next;
if (Sex) {
if (Sex == SEX_MALE) {
select("I told you, I'm a dude...!");
mes "[Shena]";
mes "Hmm. ''Dude.'' I think";
Expand Down
24 changes: 12 additions & 12 deletions npc/cities/geffen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ geffen,111,48,0 script Stacey 101,{
mes "Is that an Orc Helm you're wearing?! That's so cool! Wow...";
next;
mes "[Stacey]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "You look so...";
mes "Rugged and manly~";
}
Expand All @@ -152,7 +152,7 @@ geffen,111,48,0 script Stacey 101,{
mes "of Orc Hero!";
next;
mes "[Stacey]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "It's...";
mes "It's like you're surrounded by this incredibly masculine aura! Oooh~! You must be irresistable to all the girls!";
next;
Expand Down Expand Up @@ -226,7 +226,7 @@ OnTouch_:
mes "You wanna get your hands on some great stuff? Come on over!^000000";
next;
mes "[Suspicious Guy]";
if (Sex)
if (Sex == SEX_MALE)
mes "Hey there tough guy. You look smart enough to recognize a bargain when it's right in front of your eyes.";
else
mes "Well, well, well. Aren't you a pretty girl. Today just happens to be your lucky day!";
Expand Down Expand Up @@ -261,7 +261,7 @@ OnTouch_:
input .@input;
if (.@input == 0) {
mes "[Suspicious Guy]";
if (Sex)
if (Sex == SEX_MALE)
mes "Ah duuuuuude~ You're breakin' my heart! I mean, at these prices, I'm practically performing charity!";
else
mes "W-waaaait! You didn't let me tell you the part about how Red Potions help you lose and gain weight in all the right places! Waaaaait!";
Expand Down Expand Up @@ -293,7 +293,7 @@ OnTouch_:
break;
case 2:
mes "[Suspicious Guy]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "What would a strong guy like you want a knife for? Those will just break under the force of your incredibly powerful swings!";
next;
mes "[Suspicious Guy]";
Expand Down Expand Up @@ -358,7 +358,7 @@ OnTouch_:
break;
case 3:
mes "[Suspicious Guy]";
if (Sex)
if (Sex == SEX_MALE)
mes "A Manteau? That's old news! You know what's the latest in protective armors?";
else
mes "Now why would such a beautiful woman wear something out of style? You know what would make you look even better?";
Expand Down Expand Up @@ -612,7 +612,7 @@ geffen_in,27,134,5 script Waitress#elen 91,{
mes "I hear there's this person somewhere in Rune-Midgard...";
next;
mes "[Elenore]";
if (Sex)
if (Sex == SEX_MALE)
mes "Tell me, have you ever heard of "+strcharinfo(0)+"? He's supposed to be the suavest hero around!";
else
mes "Have you ever heard of "+strcharinfo(0)+"? People say she's one of the prettiest girls in all of Rune-Midgard!";
Expand Down Expand Up @@ -652,7 +652,7 @@ geffen_in,27,134,5 script Waitress#elen 91,{
mes "^990000Hey you sex crazed bastard!! Stop looking at my daughter like that before I rip out your eyes, and eat them with pasta!^000000";
next;
mes "["+strcharinfo(0)+"]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "Huh...?";
mes "C-come again?";
next;
Expand Down Expand Up @@ -768,7 +768,7 @@ geffen_in,70,67,3 script Waitress#elise 90,{
mes "^990000Stay away from my daughter, or I'll beat your brains out, punk! Elisa's gonna marry a doctor! Or a lawyer!^000000";
next;
mes "["+strcharinfo(0)+"]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "Y-y-y-yes, sir!";
next;
mes "^3355FFThat was scary...!";
Expand Down Expand Up @@ -1039,7 +1039,7 @@ geffen_in,39,127,2 script Psychic Advisor 704,{
break;
case 3:
mes "Um...";
if (Sex)
if (Sex == SEX_MALE)
mes "The girl that you";
else
mes "The boy that you";
Expand All @@ -1057,7 +1057,7 @@ geffen_in,39,127,2 script Psychic Advisor 704,{
mes "You didn't let me finish my sentence. What I meant to say was...";
next;
mes "[Psychic Advisor]";
if (Sex)
if (Sex == SEX_MALE)
mes "The girl that you";
else
mes "The boy that you";
Expand All @@ -1076,7 +1076,7 @@ geffen_in,39,127,2 script Psychic Advisor 704,{
mes "Sometimes, I get the future and the present mixed up. You know, since I'm always looking into the future...?";
next;
mes "[Psychic Advisor]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "What I meant to say was";
mes "^3355FFyou and the perfect woman will soon fall in love^000000. Yes, that's what I meant!";
}
Expand Down
8 changes: 4 additions & 4 deletions npc/cities/jawaii.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ jawaii_in,25,98,0 script Employee#jaw3 724,{
mes "Oh~";
mes "Look at you...";
mes "You look perfect";
if (Sex)
if (Sex == SEX_MALE)
mes "for your wife~";
else
mes "with your husband~";
Expand All @@ -517,7 +517,7 @@ jawaii_in,25,98,0 script Employee#jaw3 724,{
mes "Hmm...?";
mes "You don't look like";
mes "you're married, are you?";
if (Sex) {
if (Sex == SEX_MALE) {
next;
mes "[Employee Buffy]";
mes "I'm pretty good";
Expand Down Expand Up @@ -1176,7 +1176,7 @@ jawaii_in,41,106,3 script Customer#Cage 98,{
mes "After all, everyone knows marriage is a sham for desperate, lonely people!";
next;
mes "[Cage]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "I don't trust anybody!";
mes "You're a fool for chaining";
mes "yourself to some gorgeous";
Expand Down Expand Up @@ -1356,7 +1356,7 @@ prt_in,173,13,4 script Customer#SoloHan 86,{
mes "...Wha!?";
mes "Oh man!";
mes "Get outta my face!";
if (Sex) {
if (Sex == SEX_MALE) {
mes "You smell like,";
mes "whupped boyfriend";
mes "or something!";
Expand Down
8 changes: 4 additions & 4 deletions npc/cities/lighthalzen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ lhz_in02,283,276,4 script Customer#amano12 815,{
mes "to ask me out or something?";
next;
mes "[Sei]";
if (Sex == 1) {
if (Sex == SEX_MALE) {
mes "Well, if he does,";
mes "shouldn't he have";
mes "more guts? Or are ";
Expand Down Expand Up @@ -1546,7 +1546,7 @@ lhz_in03,192,19,3 script Haggar#zen1 855,{

lhz_in03,193,25,2 script Bartender#12 61,{
mes "[Tony]";
if (Sex) {
if (Sex == SEX_MALE) {
mes "Hey man, I know this";
}
else {
Expand Down Expand Up @@ -2949,7 +2949,7 @@ lhz_in01,139,48,7 script Leimi#mimir 73,{
mes "Um, may I help you?";
emotion e_omg;
if (BaseJob == Job_Assassin) {
if (Sex) {
if (Sex == SEX_MALE) {
next;
mes "[Leimi]";
mes "Oh, you're an Assassin!";
Expand All @@ -2972,7 +2972,7 @@ lhz_in01,139,48,7 script Leimi#mimir 73,{
lhz_in01,138,47,0 script #mimir_camera -1,2,2,{
OnTouch_:
if (BaseJob == Job_Assassin) {
if (Sex) {
if (Sex == SEX_MALE) {
mes "^3355FF*Click*^000000";
next;
mes "["+strcharinfo(0)+"]";
Expand Down
4 changes: 2 additions & 2 deletions npc/cities/louyang.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ lou_fild01,190,100,7 script Girl#1lou 815,{
mes "stay and enjoy the";
mes "the food and the sights!";
next;
if (Sex) {
if (Sex == SEX_MALE) {
mes "[Girl]";
mes "And by sights...";
mes "I mean girls!";
Expand All @@ -138,7 +138,7 @@ lou_fild01,190,100,7 script Girl#1lou 815,{
// Generic Louyang NPCs
//============================================================
louyang,297,167,2 script Muscular Woman#lou 815,{
if (!Sex) {
if (Sex == SEX_FEMALE) {
mes "[Zhi Ching Li]";
mes "All the members of the Maiden Palace, including myself and our master, are all female.";
next;
Expand Down
6 changes: 3 additions & 3 deletions npc/cities/payon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ payon,249,156,1 script Woman#payon 66,{
mes " To be honest, things are getting tough because of all those monsters. ^666666*Sigh...*^000000";
next;
mes "[Woman]";
if (Sex == 1)
if (Sex == SEX_MALE)
mes "Whoa~! I just noticed those arms of yours look pretty solid. You look pretty strong, guy. Just how many monsters have you killed?!";
else
mes "Oooh! I didn't notice before, but you look pretty strong beneath all of that feminine charm.";
Expand Down Expand Up @@ -191,7 +191,7 @@ payon,246,158,5 script Woman#2payon 66,0,0,{
mes "of the people living in Payon by her behavior. She's the only loudmouth. I guess she's just too excited about what the fortune teller told her.";
next;
mes "[Jim's Mother]";
if (Sex == 1) {
if (Sex == SEX_MALE) {
mes "Ooh...!";
mes "You've got";
mes "such broad shoulders!";
Expand Down Expand Up @@ -387,7 +387,7 @@ payon_in01,180,7,2 script Waitress#payon 90,{
mes "And lonely...";
next;
mes "[Pub Lady]";
if (Sex == 1)
if (Sex == SEX_MALE)
mes "Where I can find the right person, a hot and Sexy hunk who can take me away from here? Um, hey mister, are you listening?";
else {
mes "Where I can find the right person, a cute, yet hard-bodied hunk who can take me away from here?";
Expand Down
2 changes: 1 addition & 1 deletion npc/cities/prontera.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ prt_in,177,18,2 script Marvin#pront 80,{
mes "Whether it's schmoozing with a member of the opposite sex, or battling monsters, I gotta say, it's all about ^333399skills^000000.";
next;
mes "[Marvin]";
if (Sex)
if (Sex == SEX_MALE)
mes "I can't help you much when it comes to the subject of talking to attractive women such as myself, but I can tell you a little more about skills that help in battle.";
else
mes "I don't really have any advice for skills when it comes to talking to a cute guy, but I can let you in on what I know about skills that help in battle.";
Expand Down
8 changes: 4 additions & 4 deletions npc/custom/etc/airplane.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ L_Nope:

Notime:
mes "^FF0000[Porter]^000000";
if(Sex==0) mes "Sorry, ma'am, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
if(Sex==1) mes "Sorry, sir, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
if(Sex==SEX_FEMALE) mes "Sorry, ma'am, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
else mes "Sorry, sir, but the plane currently isn't ported. However, you can view the airplane's hourly itinerary.";
next;
menu "Yes, please.",Itin,"No thanks.",L_Nope;
close;
Expand Down Expand Up @@ -365,8 +365,8 @@ Lnope:

Notime:
mes "^FF0000[Airplane Attendant]^000000";
if(Sex==0) mes "Sorry, ma'am, but the plane currently isn't docked. Please wait.";
if(Sex==1) mes "Sorry, sir, but the plane currently isn't docked. Please wait.";
if(Sex==SEX_FEMALE) mes "Sorry, ma'am, but the plane currently isn't docked. Please wait.";
else mes "Sorry, sir, but the plane currently isn't docked. Please wait.";
close;

Nowhere:
Expand Down
16 changes: 8 additions & 8 deletions npc/custom/etc/marriage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,19 @@ OnTimer55000:

//Subfunction: Checks that the groom/bride is still wearing their stuff.
function SF_equip_check {
if (Sex && getequipid(EQI_ARMOR) != 7170) {
if (Sex == SEX_MALE && getequipid(EQI_ARMOR) != 7170) {
mes "["+@name$+"]";
mes "Child, what did you do with your "+getitemname(7170)+"?";
emotion e_dots;
return 0;
}
if (Sex == 0 && getequipid(EQI_ARMOR) != 2338) {
if (Sex == SEX_FEMALE && getequipid(EQI_ARMOR) != 2338) {
mes "["+@name$+"]";
mes "Child, you are supposed to wear a "+getitemname(2338)+" at all times during the ceremony...";
emotion e_dots;
return 0;
}
if (Sex == 0 && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
mes "["+@name$+"]";
mes "Child, you can't take off your "+getitemname(2206)+" yet....";
emotion e_dots;
Expand Down Expand Up @@ -489,7 +489,7 @@ function SF_Register {
mes "Very well, whom would you like to register as?";
next;
set @submenu, select("Groom","Bride","Cancel");
} else if (Sex) { //Groom
} else if (Sex == SEX_MALE) { //Groom
mes "["+@name$+"]";
mes "Very well, will you register as the Groom?";
next;
Expand Down Expand Up @@ -549,7 +549,7 @@ function SF_WedProgress {
mes "Tell your groom to register, what is taking so long? Time is running out.";
close;
}
if (($wed_groom_progress == 0) && (Sex == 1 || $@wed_allow == 1)) {
if (($wed_groom_progress == 0) && (Sex == SEX_MALE || $@wed_allow == 1)) {
mes "["+@name$+"]";
mes $wed_bride$+" is waiting for the groom to register. Are you the one who came to register as groom?";
next;
Expand All @@ -571,7 +571,7 @@ function SF_WedProgress {
}

}
if (($wed_bride_progress == 0) && (Sex == 0 || $@wed_allow == 1)) {
if (($wed_bride_progress == 0) && (Sex == SEX_FEMALE || $@wed_allow == 1)) {
mes "["+@name$+"]";
mes $wed_groom$+" is waiting for the bride to register. Are you the one who came to register as the bride?";
next;
Expand Down Expand Up @@ -687,7 +687,7 @@ function SF_TryRegister {
emotion e_gasp;
close;
}
if (Sex)
if (Sex == SEX_MALE)
set @item, 7170;
else
set @item, 2338;
Expand All @@ -697,7 +697,7 @@ function SF_TryRegister {
mes "You should be wearing a "+getitemname(@item)+" if you want to get married.";
close;
}
if (Sex == 0 && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
if (Sex == SEX_FEMALE && $@wed_veil && getequipid(EQI_HEAD_TOP) != 2206) {
mes "["+@name$+"]";
mes "Where is your "+getitemname(2206)+"? It's a necessary complement to your dress.";
close;
Expand Down
2 changes: 1 addition & 1 deletion npc/custom/etc/penal_servitude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sec_pri,36,58,1 script Chief Warder 105,{
mes "[Saddeus]";
emotion e_what;
mes (Sex?"Mr.":"Ms.")+" Prisoner #"+BaseLevel+JobLevel+",";
mes (Sex==SEX_MALE?"Mr.":"Ms.")+" Prisoner #"+BaseLevel+JobLevel+",";
mes "what's the noise over there?";
next;
menu "Let me free, I'll pay!",-, "Let me to work off my freedom!",M_Q1, "Nothing",M_NO_THANKS;
Expand Down
8 changes: 4 additions & 4 deletions npc/custom/events/holiday/uneasy_cemetery.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ OnZombieDead:
if ($@UNEASY_MOB>0) end;
set $UNEASY_DL,0;
set $UNEASY_H$,strcharinfo(0);
if (Sex==1) mapannounce "prontera","[Mother Mathana]: Brave "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
if (Sex==0) mapannounce "prontera","[Mother Mathana]: Lady "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
if (Sex==SEX_MALE) mapannounce "prontera","[Mother Mathana]: Brave "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
else mapannounce "prontera","[Mother Mathana]: Lady "+$UNEASY_H$+" has just killed the last undead in Prontera!",0;
set JobExp,JobExp+100;
set BaseExp,BaseExp+50;
end;
Expand Down Expand Up @@ -105,8 +105,8 @@ L_Undead_Walk:
mes "[Mother Mathana]";
mes "Our Church is going to thank you personally...";
next;
if (Sex==1) mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare handsom "+$UNEASY_H$+" as a Prontera savior!",0;
if (Sex==0) mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare beautiful "+$UNEASY_H$+" as a Prontera savior!",0;
if (Sex==SEX_MALE) mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare handsom "+$UNEASY_H$+" as a Prontera savior!",0;
else mapannounce "prontera","[Mother Mathana]: In the name of Odin we declare beautiful "+$UNEASY_H$+" as a Prontera savior!",0;
mes "[Mother Mathana]";
mes "In the name of Odin we bless you and decently present a modest gift just from Mareusis' wine-cellar.";
getitem 505,1; //Blue_Potion
Expand Down
Loading

0 comments on commit 9b1b7b1

Please sign in to comment.