Aller au contenu

Photo

Changing the PC's default clothing


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Shaun the Crazy One

Shaun the Crazy One
  • Members
  • 183 messages
I few searches and some trial and error and I've gotten nowhere on this.  Does anyone know of a way to change the PC's default clothing (bywhich I mean the clothing they wear when they have no armor equipped)?  I found a way I can override clothing 1 but what I was hoping to do was let the player what type of clothing they want to wear.

Modifié par Shaun the Crazy One, 01 avril 2011 - 09:57 .


#2
El Condoro

El Condoro
  • Members
  • 148 messages
This part of the OnEnter script I use to strip the PC of all clothes (except the DMFI tool) and then clothe them in a basic outfit according to their class. It may not do exactly what you want but may help...

 // Remove all equipment of new character and dress in basic outfit
  object oObjInv = GetFirstItemInInventory(oPC);
  while (oObjInv != OBJECT_INVALID)
  {
   // Exceptions (e.g. the DMFI Tool)
   string sDMFI = GetStringLeft(GetTag(oObjInv),4);
   if (sDMFI != "dmfi")
   {
   DestroyObject(oObjInv);
   }
  oObjInv = GetNextItemInInventory(oPC);
  }
  int i;
  for (i = 0; i < NUM_INVENTORY_SLOTS; ++i)
  {
  object oDestroy = GetItemInSlot(i, oPC);
  DestroyObject(oDestroy);
  }
  // Clothe the now-naked oPC
  int iclass = GetclassByPosition(1,oPC);
  if (iclass == class_TYPE_BARBARIAN)
  {
  CreateItemOnObject("nw_cloth015",oPC,1,"i_clothes");
  }
  else if (iclass == class_TYPE_PALADIN)
  {
  CreateItemOnObject("nw_cloth003",oPC,1,"i_clothes");
  }
  else if (iclass == class_TYPE_RANGER)
  {
  CreateItemOnObject("shirt_ranger",oPC,1,"i_clothes");
  }
  else
  {
  CreateItemOnObject("nw_cloth006",oPC,1,"i_clothes");
  }
  object oItem = GetObjectByTag("i_clothes");
  AssignCommand(oPC, ActionEquipItem(oItem,INVENTORY_SLOT_CHEST));

Edit: I notice that when I paste the code in some of the cases change. Check the cases if you cut and paste into a new script.

Modifié par El Condoro, 02 avril 2011 - 02:07 .