Author Topic: Random NPC Appearance and the NESS Spawn system woes..  (Read 584 times)

Legacy_Scarss

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« on: August 15, 2010, 01:14:28 pm »


                I've got a rather simple problem that I cant seem to figure out, and am hoping someone here can help.  I've created a NPC randomizer (see below script) so that I've got unique NPCs running around the city areas and such.  It works well when they are placed in their locations via toolset, but when they are spawned in using the NESS spawn system they appear naked, even tho the clothing is placed in their inventory.  This also happens when they're spawned as DM.  Can only assume its a problem with the script that I'm missing..  Can anyone think of a solution, or see something I've overlooked?


// Randomizes statsvoid RandomizeStats(object oTarget, int iStat, int iIncreaseBy);void RandomizeStats(object oTarget, int iStat, int iIncreaseBy){ int iIncreaseBy;    iIncreaseBy = d12 (1);    effect eEffect = EffectAbilityIncrease(iStat, iIncreaseBy);    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);}void DressTheNPC(object oTarget){ object oClothing; int nRandom = Random(59); switch (nRandom)     {      case 0:          {          CreateItemOnObject("CommonersOutfit",oTarget);          oClothing = GetItemPossessedBy(oTarget,"CommonersOutfit");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 1: //Common Man's Garb  ZEP_COMMON          {          CreateItemOnObject("ZEP_COMMON",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_COMMON");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 2: //Commoner's Outfit CommonersOutfit          {          CreateItemOnObject("CommonersOutfit",oTarget);          oClothing = GetItemPossessedBy(oTarget,"CommonersOutfit");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 3: //Common Woman's Garb ZEP_COMMONW          {          CreateItemOnObject("ZEP_COMMONW",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_COMMONW");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 4: //Arabian Nights Costume ZEP_ARABIAN          {          CreateItemOnObject("ZEP_ARABIAN",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_ARABIAN");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 5: //Bamboo Kimono  ZEP_KIMONO3          {          CreateItemOnObject("ZEP_KIMONO3",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_KIMONO3");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 6: //Bell Dress  ZEP_GOWN_BD          {          CreateItemOnObject("ZEP_GOWN_BD",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_GOWN_BD");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 7: //Blacksmith Apron  ZEP_ASMITHY_001          {          CreateItemOnObject("ZEP_ASMITHY_001",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_ASMITHY_001");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 8: //Butler's Clothes  ButlersClothes          {          CreateItemOnObject("ButlersClothes",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ButlersClothes");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 9: //Death Robes  crpi_deathrobe          {          CreateItemOnObject("crpi_deathrobe",oTarget);          oClothing = GetItemPossessedBy(oTarget,"crpi_deathrobe");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 10: //Dragon Kimono ZEP_KIMONO2          {          CreateItemOnObject("ZEP_KIMONO2",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_KIMONO2");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 11: //Evoker's Coat  ZEP_EVOKER          {          CreateItemOnObject("ZEP_EVOKER",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_EVOKER");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 12: //Foppish Outfit  ZEP_FOPPISH          {          CreateItemOnObject("ZEP_FOPPISH",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_FOPPISH");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 13: //Formal Kilt  ZEP_FORMALKILT          {          CreateItemOnObject("ZEP_FORMALKILT",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_FORMALKILT");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 14: //Innkeeper Clothes  InkeeperClothes          {          CreateItemOnObject("InkeeperClothes",oTarget);          oClothing = GetItemPossessedBy(oTarget,"InkeeperClothes");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 15: //Judoth's Clothing  JudothsClothing          {          CreateItemOnObject("JudothsClothing",oTarget);          oClothing = GetItemPossessedBy(oTarget,"JudothsClothing");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 16: // Lovic's Robes  LovicsRobes          {          CreateItemOnObject("LovicsRobes",oTarget);          oClothing = GetItemPossessedBy(oTarget,"LovicsRobes");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 17: //Monk's Habit  ZEP_MONK          {          CreateItemOnObject("ZEP_MONK",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_MONK");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 18: //Noblewoman's Gown  ZEP_GOWN          {          CreateItemOnObject("ZEP_GOWN",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_GOWN");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 19: //Regal Kimono ZEP_KIMONO          {          CreateItemOnObject("ZEP_KIMONO",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_KIMONO");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 20: //Ribbons Skirt  ZEP_GOWN5          {          CreateItemOnObject("ZEP_GOWN5",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_GOWN5");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 21: //Slave's Garb  ZEP_SLAVE          {          CreateItemOnObject("ZEP_SLAVE",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_SLAVE");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 22: //Warrior Monk's Outfit  ZEP_WARMONK          {          CreateItemOnObject("ZEP_WARMONK",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_WARMONK");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 23: //Wizard's Robes  ZEP_WIZROBES          {          CreateItemOnObject("ZEP_WIZROBES",oTarget);          oClothing = GetItemPossessedBy(oTarget,"ZEP_WIZROBES");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 24: //Adept's Tunic  NW_CLOTH027          {          CreateItemOnObject("NW_CLOTH027",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH027");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 25: //Adventurer's Robe  NW_MCLOTH011          {          CreateItemOnObject("NW_MCLOTH011",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_MCLOTH011");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 26: //Assassin's Garb  NW_CLOTH017          {          CreateItemOnObject("NW_CLOTH017",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH017");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 27: //Barbarian's Outfit  NW_CLOTH015          {          CreateItemOnObject("NW_CLOTH015",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH015");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 28: //Bard's Tunic  NW_CLOTH021          {          CreateItemOnObject("NW_CLOTH021",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH021");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 29: //Cleric's Robe  X2_CLOTH008          {          CreateItemOnObject("X2_CLOTH008",oTarget);          oClothing = GetItemPossessedBy(oTarget,"X2_CLOTH008");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 30: //Commoner's Outfit  NW_CLOTH022          {          CreateItemOnObject("NW_CLOTH022",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH022");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 31: //Commoner's Tunic  NW_CLOTH024          {          CreateItemOnObject("NW_CLOTH024",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH024");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 32: //Conjurer's Robe  NW_CLOTH012          {          CreateItemOnObject("NW_CLOTH012",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH012");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 33: //Duergar Mage Robe  X2_MDEURAR010          {          CreateItemOnObject("X2_MDEURAR010",oTarget);          oClothing = GetItemPossessedBy(oTarget,"X2_MDEURAR010");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 34: //Gladiator's Outfit  NW_CLOTH011          {          CreateItemOnObject("NW_CLOTH011",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH011");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 35: //Illusionist's Robe  NW_CLOTH020          {          CreateItemOnObject("NW_CLOTH020",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH020");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 36: //Jester's Outfit  NW_CLOTH014          {          CreateItemOnObject("NW_CLOTH014",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH014");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 37: //Last Words  x2_cus_lastwords          {          CreateItemOnObject("x2_cus_lastwords",oTarget);          oClothing = GetItemPossessedBy(oTarget,"x2_cus_lastwords");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 38: //Monk's Outfit  NW_CLOTH016          {          CreateItemOnObject("NW_CLOTH016",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH016");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 39: //Necromancer's Robe  NW_CLOTH026          {          CreateItemOnObject("NW_CLOTH026",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH026");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 40: //Noble Guardsman Tunic  NW_CLOTH018          {          CreateItemOnObject("NW_CLOTH018",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH018");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 41: //Noble Outfit  NW_CLOTH003          {          CreateItemOnObject("NW_CLOTH003",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH003");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 42: //Noble's Tunic  NW_CLOTH028          {          CreateItemOnObject("NW_CLOTH028",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH028");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 43: //Paladin's Tunic  NW_CLOTH010          {          CreateItemOnObject("NW_CLOTH010",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH010");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 44: //Palemaster's Robe  x2_it_pmrobe          {          CreateItemOnObject("x2_it_pmrobe",oTarget);          oClothing = GetItemPossessedBy(oTarget,"x2_it_pmrobe");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 45: //Performer's Outfit  NW_CLOTH002          {          CreateItemOnObject("NW_CLOTH002",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH002");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 46: //Priest's Robe  NW_CLOTH007          {          CreateItemOnObject("NW_CLOTH007",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH007");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 47: //Rogue's Tunic  NW_CLOTH004          {          CreateItemOnObject("NW_CLOTH004",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH004");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 48: //Sequencer Robe  x2_sequencer1          {          CreateItemOnObject("x2_sequencer1",oTarget);          oClothing = GetItemPossessedBy(oTarget,"x2_sequencer1");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 49: //Shifter Tunic  x2_cus_shiftertunic          {          CreateItemOnObject("x2_cus_shiftertunic",oTarget);          oClothing = GetItemPossessedBy(oTarget,"x2_cus_shiftertunic");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 50: //Soldier's Tunic  NW_CLOTH019          {          CreateItemOnObject("NW_CLOTH019",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH019");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 51: //Sorcerer's Robe  NW_CLOTH008          {          CreateItemOnObject("NW_CLOTH008",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH008");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 52: //Squire's Tunic  NW_CLOTH013          {          CreateItemOnObject("NW_CLOTH013",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH013");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 53: //Urchin Rags  NW_CLOTH009          {          CreateItemOnObject("NW_CLOTH009",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH009");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 54: //Vagabond Rags  NW_CLOTH023          {          CreateItemOnObject("NW_CLOTH023",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH023");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 55: //Vest of Escape  X0_CLOTH004          {          CreateItemOnObject("X0_CLOTH004",oTarget);          oClothing = GetItemPossessedBy(oTarget,"X0_CLOTH004");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 56: //Veteran's Outfit  NW_CLOTH006          {          CreateItemOnObject("NW_CLOTH006",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH006");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 57: //Warrior's Tunic  NW_CLOTH025          {          CreateItemOnObject("NW_CLOTH025",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH025");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      case 58: //Wizard's Robe  NW_CLOTH005          {          CreateItemOnObject("NW_CLOTH005",oTarget);          oClothing = GetItemPossessedBy(oTarget,"NW_CLOTH005");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;          }      default:   //Commoner's Outfit CommonersOutfit         {          CreateItemOnObject("CommonersOutfit",oTarget);          oClothing = GetItemPossessedBy(oTarget,"CommonersOutfit");          DelayCommand(1.0,AssignCommand(oTarget,ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));          DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));          break;         }     }
}void main(){
object oTarget;oTarget = OBJECT_SELF;
    int iIncreaseBy;    iIncreaseBy = d12 (1);    
    RandomizeStats(oTarget, ABILITY_STRENGTH, iIncreaseBy);    RandomizeStats(oTarget, ABILITY_DEXTERITY, iIncreaseBy);    RandomizeStats(oTarget, ABILITY_WISDOM, iIncreaseBy);    RandomizeStats(oTarget, ABILITY_INTELLIGENCE, iIncreaseBy);    RandomizeStats(oTarget, ABILITY_CHARISMA, iIncreaseBy);    RandomizeStats(oTarget, ABILITY_CONSTITUTION,iIncreaseBy);
int iFirst, iLast, nRandomHead, iAppearAs;
if (GetGender(oTarget)==GENDER_MALE)   {   iAppearAs = APPEARANCE_TYPE_HALFLING;   iFirst = Random(NAME_FIRST_HALFLING_MALE);   iLast = Random(NAME_LAST_HALFLING);   nRandomHead = Random(25)+1;

   iAppearAs = APPEARANCE_TYPE_HUMAN;   iFirst = Random(NAME_FIRST_HUMAN_MALE);   iLast = Random(NAME_LAST_HUMAN);   nRandomHead = Random(99)+1;   if (nRandomHead>= 49 && nRandomHead<=99)   {   nRandomHead = nRandomHead+50;   }
   iAppearAs = APPEARANCE_TYPE_ELF;   iFirst = Random(NAME_FIRST_ELF_MALE);   iLast = Random(NAME_LAST_ELF);   nRandomHead = Random(34)+1;
   iAppearAs = APPEARANCE_TYPE_HALF_ELF;   iFirst = Random(NAME_FIRST_HALFELF_MALE);   iLast = Random(NAME_LAST_HALFELF);   nRandomHead = Random(48)+1;
   iAppearAs = APPEARANCE_TYPE_HALF_ORC;   iFirst = Random(NAME_FIRST_HALFORC_MALE);   iLast = Random(NAME_LAST_HALFORC);   nRandomHead = Random(24)+1;
   iAppearAs = APPEARANCE_TYPE_GNOME;   iFirst = Random(NAME_FIRST_GNOME_MALE);   iLast = Random(NAME_LAST_GNOME);   nRandomHead = Random(34)+1;
   iAppearAs = APPEARANCE_TYPE_DWARF;   iFirst = Random(NAME_FIRST_DWARF_MALE);   iLast = Random(NAME_LAST_DWARF);   nRandomHead = Random(23)+1;   }else if (GetGender(oTarget)==GENDER_FEMALE)   {   iAppearAs = APPEARANCE_TYPE_HUMAN;   iFirst = Random(NAME_FIRST_HUMAN_FEMALE);   iLast = Random(NAME_LAST_HUMAN);   nRandomHead = Random(48)+1;
   iAppearAs = APPEARANCE_TYPE_ELF;   iFirst = Random(NAME_FIRST_ELF_FEMALE);   iLast = Random(NAME_LAST_ELF);   nRandomHead = Random(48)+1;
   iAppearAs = APPEARANCE_TYPE_HALF_ELF;   iFirst = Random(NAME_FIRST_HALFELF_FEMALE);   iLast = Random(NAME_LAST_HALFELF);   nRandomHead = Random(48)+1;
   iAppearAs = APPEARANCE_TYPE_HALF_ORC;   iFirst = Random(NAME_FIRST_HALFORC_FEMALE);   iLast = Random(NAME_LAST_HALFORC);   nRandomHead = Random(11)+1;
   iAppearAs = APPEARANCE_TYPE_GNOME;   iFirst = Random(NAME_FIRST_GNOME_FEMALE);   iLast = Random(NAME_LAST_GNOME);   nRandomHead = Random(9)+1;
   iAppearAs = APPEARANCE_TYPE_HALFLING;   iFirst = Random(NAME_FIRST_HALFLING_FEMALE);   iLast = Random(NAME_LAST_HALFLING);   nRandomHead = Random(14)+1;
   iAppearAs = APPEARANCE_TYPE_DWARF;   iFirst = Random(NAME_FIRST_DWARF_FEMALE);   iLast = Random(NAME_LAST_DWARF);   nRandomHead = Random(22)+1;   }
string sMeBeCalled;sMeBeCalled = RandomName(iFirst)+" "+RandomName(iLast);int nRandomSkin;nRandomSkin = d8 (1);int nRandomHair;nRandomHair = Random (24);int nTatooColor1;nTatooColor1 = Random (175);int nTatooColor2;nTatooColor2 = Random (175);int nRandomTatoo;nRandomTatoo = d2 (1);
DelayCommand(1.1, SetCreatureBodyPart(CREATURE_PART_HEAD, nRandomHead, oTarget));DelayCommand(1.1, SetCreatureBodyPart(CREATURE_PART_LEFT_BICEP, nRandomTatoo, oTarget));DelayCommand(1.1, SetCreatureBodyPart(CREATURE_PART_LEFT_FOOT, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.1, SetCreatureBodyPart(CREATURE_PART_LEFT_FOREARM, nRandomTatoo, oTarget));DelayCommand(1.1, SetCreatureBodyPart(CREATURE_PART_LEFT_HAND, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.2, SetCreatureBodyPart(CREATURE_PART_LEFT_SHIN, nRandomTatoo, oTarget));DelayCommand(1.2, SetCreatureBodyPart(CREATURE_PART_LEFT_THIGH, nRandomTatoo, oTarget));DelayCommand(1.2, SetCreatureBodyPart(CREATURE_PART_NECK, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.2, SetCreatureBodyPart(CREATURE_PART_PELVIS, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.2, SetCreatureBodyPart(CREATURE_PART_RIGHT_BICEP, nRandomTatoo, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_RIGHT_FOOT, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_RIGHT_FOREARM, nRandomTatoo, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_RIGHT_HAND, CREATURE_MODEL_TYPE_SKIN, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_RIGHT_SHIN, nRandomTatoo, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_RIGHT_THIGH, nRandomTatoo, oTarget));DelayCommand(1.3, SetCreatureBodyPart(CREATURE_PART_TORSO, nRandomTatoo, oTarget));SetColor(oTarget, COLOR_CHANNEL_SKIN, nRandomSkin);SetColor(oTarget, COLOR_CHANNEL_TATTOO_1, nTatooColor1);SetColor(oTarget, COLOR_CHANNEL_TATTOO_2, nTatooColor2);SetColor(oTarget, COLOR_CHANNEL_HAIR, nRandomHair);SetName(oTarget, sMeBeCalled);
DelayCommand(2.0,DressTheNPC(oTarget));if (d100()<=33)   {   CreateItemOnObject("CommonDirk", oTarget);
   }if (d100()<=5)   {   SetPhenoType(PHENOTYPE_BIG, oTarget);
   } }

               
               

               
            

Legacy_Scarss

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #1 on: August 15, 2010, 01:19:37 pm »


               Ugh.. These forums need a code feature, that just makes a big mess of it.  If anyone thinks they can help PM me and I'll send you a notepad copy of the code.
               
               

               
            

Legacy_Daybringer

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #2 on: August 16, 2010, 08:28:12 am »


               Your equip script probably is running before this script is ran on the NESS/DM spawned creatures... whatever the problem is isn't likely to be your code itself.. However I had a similar problem with another script for equipping items and the like; your best best is to have your script execute an item  equip script that way you avoid the trouble of having things just not fire. And you avoid the potential trouble of trying various delay commands that seem to work off an on, assuming the equip script isn't actually before your script anyways ^^;
               
               

               


                     Modifié par Daybringer, 16 août 2010 - 07:29 .
                     
                  


            

Legacy_Scarss

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #3 on: August 16, 2010, 03:55:57 pm »


               Tried setting it to run as an include and as its own script, still nothing.  Any idea for another method of doing this?
               
               

               
            

Legacy_Daybringer

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #4 on: August 16, 2010, 04:27:14 pm »


               your running the equipping script, or your own code as the included script ?

(its the equipping script you want)
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #5 on: April 24, 2012, 06:37:27 pm »


               First, let me say I hate to necro an old thread, especially when I am not even helping the OP.

I brought this back to life because I have a question about the inluded script:  
Wouldn't it have been cleaner to define a list (not sure if that is the right term in this case) of all the clothing options, then define a random int, then define a string as the (random int) item from the list, and then plugged that in as the clothing  item?  
It would have saved space, upped legibility, and made debugging easier.
               
               

               


                     Modifié par Leurnid, 24 avril 2012 - 05:38 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #6 on: April 24, 2012, 09:40:07 pm »


               

Leurnid wrote...

First, let me say I hate to necro an old thread, especially when I am not even helping the OP.

I brought this back to life because I have a question about the inluded script:  
Wouldn't it have been cleaner to define a list (not sure if that is the right term in this case) of all the clothing options, then define a random int, then define a string as the (random int) item from the list, and then plugged that in as the clothing  item?  
It would have saved space, upped legibility, and made debugging easier.


Yes definitely. All you really need to do is put all the clothing tags in a switch/case like:

void DressTheNPC(object oTarget)
{
    string sClothes;
    int nRandom = Random(59);
    switch (nRandom)
    {
        case 0: sClothes = "CommonersOutfit";break;
        case 1: sClothes = "ZEP_COMMON";break;//Common Man's Garb CEP
        case 2: sClothes = "ZEP_COMMONW";break;//Common Woman's Garb CEP
        case 3: sClothes = "TAG HERE";break;//
        //etc..
    }

    object oClothing = CreateItemOnObject(sClothes, oTarget);
    DelayCommand(1.0, AssignCommand(oTarget, ActionEquipItem(oClothing,INVENTORY_SLOT_CHEST)));
    DelayCommand(1.3,SetDroppableFlag(oClothing,FALSE));
}

That would have saved a whole heck of a lot of room.
               
               

               


                     Modifié par GhostOfGod, 24 avril 2012 - 08:41 .
                     
                  


            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Random NPC Appearance and the NESS Spawn system woes..
« Reply #7 on: April 25, 2012, 01:14:03 am »


               That was what I thought, but wasn't sure how to code the cleanup, I am still excited that my doors behave the way I want.

This has been the only example of a really exhaustive random npc spawner I have found. I actually do try to find solutions on my own before harassing the community, but lo-and-behold, my search brought me back to the community anyway.

Are there any other (poorly search-optimized) npc spawn randomizers?