Author Topic: Starting without default equipment.  (Read 964 times)

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
Starting without default equipment.
« on: September 22, 2010, 04:06:43 am »


               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);
   }
}
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Starting without default equipment.
« Reply #1 on: September 22, 2010, 02:40:59 pm »


               This would go either into a trigger in your starting area or in your module's OnEnter event. But, ... I'd not use this particular script as anyone relogging that hasn't reached 2nd level will get restripped each time.



I recommend the following instead.

http://nwvault.ign.c....Detail&id=2676

               
               

               
            

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
Starting without default equipment.
« Reply #2 on: September 22, 2010, 03:57:36 pm »


               oh, it's a single player, so they won't I assure you. When I try to open script example.. it says both expansions required?
               
               

               


                     Modifié par simomate, 22 septembre 2010 - 04:13 .
                     
                  


            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Starting without default equipment.
« Reply #3 on: September 22, 2010, 09:41:28 pm »


               

simomate wrote...

oh, it's a single player, so they won't I assure you. When I try to open script example.. it says both expansions required?


You don't have HOTU and SOU installed as well?

Your script will likely suit your need if it is a SP module. Just use it in a trigger in your starting area.
               
               

               
            

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
Starting without default equipment.
« Reply #4 on: September 22, 2010, 09:45:59 pm »


               

 You don't have HOTU and SOU installed as well?


hopely in a month I will have them '<img'> 

Thanks for your advice. 
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Starting without default equipment.
« Reply #5 on: September 22, 2010, 10:35:39 pm »


               

simomate wrote...

 You don't have HOTU and SOU installed as well?


hopely in a month I will have them '<img'> 

Thanks for your advice. 

You really should just get a copy of NWN Diamond or Platinum editions. They can often be found from $10-30 dollars US.
               
               

               
            

Legacy_Khuzadrepa

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Starting without default equipment.
« Reply #6 on: September 22, 2010, 11:23:09 pm »


               Sometimes, though, you can find new copies of SoU and HotU for a few dollars apiece, so I'd look for any and all of them.  I picked up a brand new copy of HotU for 2 bucks at a local Micro Center a while back.  '<img'>
               
               

               


                     Modifié par Khuzadrepa, 22 septembre 2010 - 10:23 .
                     
                  


            

Legacy_simomate

  • Full Member
  • ***
  • Posts: 162
  • Karma: +0/-0
Starting without default equipment.
« Reply #7 on: September 23, 2010, 09:29:42 am »


               They don't sell them in Australia anymore.