From a36fd4479a22281ea6e9d03e434d5dc6768f6c5a Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Tue, 8 Feb 2011 18:15:08 +0100 Subject: Implemented LUA binding to get the gender of a character The function is named mana.chr_get_gender. It returns 0 for male and 1 for female. libmana-constants.lua defines the variables GENDER_MALE and GENDER_FEMALE with these values. Also made the banker NPC refer to the gender of the player character. Reviewed-by: Jaxad0127 --- example/serverdata/scripts/npcs/banker.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'example/serverdata') diff --git a/example/serverdata/scripts/npcs/banker.lua b/example/serverdata/scripts/npcs/banker.lua index 79d6af6..bd11ba5 100644 --- a/example/serverdata/scripts/npcs/banker.lua +++ b/example/serverdata/scripts/npcs/banker.lua @@ -11,7 +11,13 @@ ---------------------------------------------------------------------------------- function Banker(npc, ch) - do_message(npc, ch, "Welcome to the bank!") + if mana.chr_get_gender(ch) == GENDER_MALE then + do_message(npc, ch, "Welcome to the bank, sir!") + elseif mana.chr_get_gender(ch) == GENDER_FEMALE then + do_message(npc, ch, "Welcome to the bank, madam!") + else + do_message(npc, ch, "Welcome to the bank... uhm... person of unspecified gender!") + end local account = tonumber(get_quest_var(ch, "BankAccount")) local result = -1 do_wait() -- cgit