Howdy folks,
Yes, a very cheap way to garner attention, I’m afraid
I need to provide my PCs with custom underclothing items created in their inventories via the module’s OnClientEnter script.
However, while these lines work perfectly (creating the required item in the entering PC’s inventory…
if(!GetIsObjectValid(GetItemPossessedBy(oPC,"pc_clothing")))
CreateItemOnObject("pc_clothing01",oPC);
…what I really want is to provide a random selection from three item blueprints for both sexes, and my attempt at doing this for male PCs does not work…
// Routine to give entering male PCs underclothing.
int nClothing = d3();
int iGender = GetGender(oPC);
if (iGender = GENDER_MALE)
{
switch(nClothing)
{
case 1: if(!GetIsObjectValid(GetItemPossessedBy(oPC,"pc_clothing")))
CreateItemOnObject("pc_clothing01", oPC);
break;
case 2: if(!GetIsObjectValid(GetItemPossessedBy(oPC,"pc_clothing")))
CreateItemOnObject("pc_clothing02", oPC);
break;
case 3: if(!GetIsObjectValid(GetItemPossessedBy(oPC,"pc_clothing")))
CreateItemOnObject("pc_clothing03", oPC);
break;
}
}
If any kind soul can point out where I’m going wrong, I would appreciate the help very much.
I should add that the script compiles successfully, but none of the items are created in the inventories of the male test PCs.
BTW, I use NWN 1.69 not EE.
Many thanks.