Full Version : Male only Spawn. How do i do it?
xmlspawner >>Scripting Support >>Male only Spawn. How do i do it?


<< Prev | Next >>

Dave1969- 03-17-2006
Male only Spawn. How do i do it? Im making some customs but i cant figure out how to make them only spawn as a male. Can anyone reply with the coding i need. Thanks

ArteGordon- 03-17-2006
if you are spawning xmlquestnpcs then they accept an argument that specifies the gender.

xmlquestnpc,0

is a male. Using an argument of 1 will give you a female.

If you are trying to do this with some other custom npc that are derived from something like basevendor or baseescortable, then you would need to override the InitBody method. For example, the Victoria quest npc is force to be female with

CODE

 public override void InitBody()
 {
  InitStats( 100, 100, 25 );

  Female = true;
  Hue = 0x8835;
  Body = 0x191;

  Name = "Victoria";
 }

Dave1969- 03-17-2006
hmm doesnt seem to work with human monsters.


- Error: Scripts\Customs\custom mobiles\Dark Mobs\Raistlin.cs: CS0115: (line 22
, column 24) 'Server.Mobiles.Raistlin.InitBody()': no suitable method found to o
verride

ArteGordon- 03-17-2006
sounds like you are deriving your custom mob directly from the BaseCreature class rather than the basevendor, or baseescortable classes that support the InitBody method.
If you want it to have a male body form, just set the body value in the constructor like

Body = 0x190;
for male

Body = 0x191;
for female

Dave1969- 03-17-2006
K thanks Arte. That i have done but sometimes ya get The Dread Lady instead of the Dread Lord. He looks like a male but when ya kill it he makes female sounds. No biggie though. Appreciate the help

ArteGordon- 03-17-2006
you need to set the Female flag to false as well.

Dave1969- 03-17-2006
would that just be something like

female = false;

ArteGordon- 03-17-2006
c# is case sensitive and the name of the property is 'Female' so you need

Female = false;

Dave1969- 03-17-2006
Thanks again Arte. Great site btw. I love it