Jump to content
  • 0

changing NPC's gender code


mrgeiszer

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/07/23
  • Last Seen:  

as the title says, is there any way I can change the gender of my npc since i'm currently using the 'player' sprite. For example, mine i'm using a swordsman sprite but it's a female.

here's the full script:

//==================================================
//Walking NPC player sprite
//==================================================
// - Gepard
//==================================================
prontera,156,180,0    script    Bonita    1,{   // the number 1 here is the swordsman sprite female with the default hairstyle

end;

OnInit:
setarray .Message$[0],"Bonita: Hi there!",
                    "",
                    "",
                    "Bonita: Don't mind me",
                    "",
                    "Bonita: I'm just looking around",
                    "",
                    "Bonita: Hmm..";
while( 1 ){
    if(.Count >= getarraysize( .Message$))
    .Count = 0;
    npcwalkto rand(150,160),rand(175,186);
    npctalk .Message$[ .Count];
    .Count++;
    sleep rand(3000,5000);
}
end;

}

please help i want to change the gender to male

Edited by Mael
Use a codebox
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Hi, put this in your OnInit: label

	setunitdata(getnpcid(0), UNPC_CLASS, 1);
	setunitdata(getnpcid(0), UNPC_SEX, 1); //0=female 1=male

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/07/23
  • Last Seen:  

hi your code works, lastly can i also change the hairstyle and having head top equipment?

thanks for your help anyway

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

Just now, mrgeiszer said:

hi your code works, lastly can i also change the hairstyle and having head top equipment?

thanks for your help anyway

Yes you can

//Examples
	setunitdata(getnpcid(0), UNPC_HAIRSTYLE, 2);
	setunitdata(getnpcid(0), UNPC_HAIRCOLOR, 5);
	setunitdata(getnpcid(0), UNPC_HEADTOP, 547);
	setunitdata(getnpcid(0), UNPC_HEADMIDDLE, 0);
	setunitdata(getnpcid(0), UNPC_HEADBOTTOM, 0);
	setunitdata(getnpcid(0), UNPC_CLOTHCOLOR, 1);
	setunitdata(getnpcid(0), UNPC_ROBE, 4);

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/07/23
  • Last Seen:  

11 hours ago, Racaae said:

Yes you can

//Examples
	setunitdata(getnpcid(0), UNPC_HAIRSTYLE, 2);
	setunitdata(getnpcid(0), UNPC_HAIRCOLOR, 5);
	setunitdata(getnpcid(0), UNPC_HEADTOP, 547);
	setunitdata(getnpcid(0), UNPC_HEADMIDDLE, 0);
	setunitdata(getnpcid(0), UNPC_HEADBOTTOM, 0);
	setunitdata(getnpcid(0), UNPC_CLOTHCOLOR, 1);
	setunitdata(getnpcid(0), UNPC_ROBE, 4);

 

thank you for this it works perfectly for my npc

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/07/23
  • Last Seen:  

@Racaae do you know what script codes that an npc using player sprite can attack a mob? tia 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...