I'm working on a campagin in which the PC starts with no equipment except for his clothes. I plan to use this script (will it work? If not, pointout it's flaws). Only problem is, I can't figure out where to put the script. Help would be appreciated, thanks in advance.
void StripPC(object oPC)
{
// Removing PC's equipment.
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BELT, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_BELT, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_ARMS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARMS, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_CHEST, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_HEAD, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_HEAD, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_NECK, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_NECK, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_ARROWS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_ARROWS, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC)); }
if(GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_BULLETS, oPC))) { DestroyObject(GetItemInSlot(INVENTORY_SLOT_BULLETS, oPC)); }
// Removing PC's inventory.
object oStuff = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oStuff))
{
DestroyObject(oStuff);
oStuff = GetNextItemInInventory(oPC);
}
}
void GiveNewPC()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (GetHitDice(oPC) <= 2)
{
int ngold=d10(10)+ 100;// starting gold of you choice
GiveGoldToCreature(oPC,ngold);
// this is where you would have items added to the player, you can set this up by class if you wanted to..
CreateItemOnObject("nw_cloth001", oPC);
}
}