Full Version : How would i add Randomly Armor
xmlspawner >>Scripting Support >>How would i add Randomly Armor
<< Prev | Next >>
Erica- 04-19-2007
Hi how would i assign this part here

CODE
if (Female = GetGender()) { Body = 606; Name = NameList.RandomName("female"); Female = true;
Race = Race.Elf;
Hue = Utility.RandomList( 1154, 371 );
}
else
{
Body = 605;
Name = NameList.RandomName("male");
Female = false;
Race = Race.Elf;
Hue = Utility.RandomList( 1154, 371 );
}
Item hair = new Item( Utility.RandomList( 0x2FD1, 0x2FCF, 0x2FC0, 0x2FC2, 0x2FBF, 0X2FCE, 0X2FD0 ) );
hair.Hue = Utility.RandomList( 1153, 1175, 1260, 1266 );
hair.Layer = Layer.Hair;
hair.Movable = false;
AddItem( hair );
switch (Utility.Random(3))
{
case 0: AddItem(new ElvenDarkShirt(GetRandomHue())); break;
case 1: AddItem(new ElvenShirt(GetRandomHue())); break;
case 2:
{
if (Female = GetGender())
{
AddItem(new MaleElvenRobe(GetRandomHue()));
break;
}
else
{
AddItem(new FemaleElvenRobe(GetRandomHue()));
break;
}
}
}
AddItem(new ElvenPants(GetRandomHue()));
AddItem(new ElvenBoots(GetRandomHue()));

to add like 8 more AddItem i want the elfs so it can random add as well WoodlandArms, WoodlandChest,WoodlandGloves,WoodlandGorget, WoodlandLeggs ,VultureHelm so all elfs look different on theses items in elf land when i spawn them
Erica- 04-19-2007
Ok did this

CODE
switch (Utility.Random(8)) { case 0: AddItem(new ElvenDarkShirt(GetRandomHue())); break; case 1: AddItem(new ElvenShirt(GetRandomHue())); break; case 2: AddItem(new WoodlandArms()); break;
case 3: AddItem(new WoodlandChest()); break;
case 4: AddItem(new WoodlandGloves()); break;
case 5: AddItem(new WoodlandGorget()); break;
case 6: AddItem(new WoodlandLegs()); break;
case 7: AddItem(new VultureHelm()); break;
{
if ( Female )
{
AddItem(new FemaleElvenRobe(GetRandomHue()));
break;
}
else
{
AddItem(new MaleElvenRobe(GetRandomHue()));
break;
}
}
}
AddItem(new ElvenPants(GetRandomHue()));
AddItem(new ElvenBoots(GetRandomHue()));
}

but all it is doing now is adding part of it to the elf npc so lets say i add a banker he would have the elf boots and the woodlandchest and would not have nothing else on what did i do wrong.
Erica- 04-19-2007
Or is there a better way for theses elfs to get elf armor clothes ect randomly if theres a better way can you show me what i need to remove and place there.
ArteGordon- 04-20-2007
set up a separate switch case for the random items on each layer. For example have one switch case for pants and each of the cases would add a different random type of leg armor, and then have another switch case with upper torso stuff, etc.