Check Gender in Scripts

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jul 18, 2008
Messages
81
Reaction score
1
A lot of servers have the "starter pack" which gives you both a male and female sauna robe, which I thought was pretty stupid...

Method 1: Using MapleCharacter only in the source.

Add this function in NPCConversationManager.java (net/sf/odinms/scripting/npc):

Code:
        public int getGender() {
            // gender (0 = male, 1 = female)
            return getPlayer().getGender();
        }

getPlayer() is an inherited function from AbstractPlayerInteraction.java, if you're wondering.

In your scripts do:
Code:
        if (cm.getGender() == 0) {
                // Receive male clothing
        } else {
                // Receive female clothing
        }

Method 2: Using MapleCharacter in Scripts

Or, if you don't mind using getPlayer() in scripts you can do:

Code:
        if (cm.getPlayer().getGender() == 0) {
                // Receive male clothing
        } else {
                // Receive female clothing
        }

without having to copy the first function.
 
Re: [Release] Check Gender in Scripts

uh this is already coded isnt it? My nimakin and Kin npcs check to see if you're male or female 0_0
 
Status
Not open for further replies.
Back