Aller au contenu

Photo

Starting without default equipment.


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
simomate

simomate
  • Members
  • 83 messages
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);
   }
}

#2
kalbaern

kalbaern
  • Members
  • 824 messages
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


#3
simomate

simomate
  • Members
  • 83 messages
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 .


#4
kalbaern

kalbaern
  • Members
  • 824 messages

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.

#5
simomate

simomate
  • Members
  • 83 messages

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


hopely in a month I will have them :D 

Thanks for your advice. 

#6
kalbaern

kalbaern
  • Members
  • 824 messages

simomate wrote...

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


hopely in a month I will have them :D 

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.

#7
Khuzadrepa

Khuzadrepa
  • Members
  • 188 messages
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.  :)

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


#8
simomate

simomate
  • Members
  • 83 messages
They don't sell them in Australia anymore.