Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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.
 
Experienced Elementalist
Joined
May 19, 2008
Messages
281
Reaction score
0
Re: [Release] Check Gender in Scripts

thanks, its helpful :D
 
Newbie Spellweaver
Joined
Jun 10, 2008
Messages
71
Reaction score
1
Re: [Release] Check Gender in Scripts

my friends needed this thx
 
Skilled Illusionist
Joined
Apr 17, 2008
Messages
386
Reaction score
0
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
 
Newbie Spellweaver
Joined
Aug 1, 2008
Messages
7
Reaction score
0
Re: [Release] Check Gender in Scripts

nice thnx for the release !
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release] Check Gender in Scripts

This was already released?
 
Experienced Elementalist
Loyal Member
Joined
Apr 23, 2008
Messages
240
Reaction score
0
Re: [Release] Check Gender in Scripts

I think this was already released.
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Check Gender in Scripts

I think it was in odinms' first release.
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
Re: [Release] Check Gender in Scripts

This was already in OdinMS files.
 
Status
Not open for further replies.
Back
Top