GammaAge/_module/nss/sei_pickup.nss
Jaysyn904 b927d0faf8 File re-organization.
File re-organization.  Added module builder & hak builder.
2021-09-16 10:15:32 -04:00

44 lines
1.0 KiB
Plaintext

//
// NWPickup
//
// Script to make the PC pick up an item.
//
// (c) Shir'le E. Illios, 2002 (shirle@drowwanderer.com)
//
////////////////////////////////////////////////////////
// Script to place an item in the inventory of a character in place of this one.
// ARGUMENTS:
// a_oCharacter - The character picking up the item.
// a_sNewItem - ResRef of the new item in the character's inventory.
//
void SEI_PickupItem( object a_oCharacter, string a_sNewItem )
{
// Make the object disappear.
DestroyObject( OBJECT_SELF );
// Put a new object in the character's inventory.
CreateItemOnObject( a_sNewItem, a_oCharacter, 1 );
} // End SEI_PickupItem
void main()
{
if( GetTag( OBJECT_SELF ) == "movechair" )
{
// Put a chair in the PC's inventory.
SEI_PickupItem( GetPCSpeaker(), "Chair" );
}
else if( GetTag( OBJECT_SELF ) == "movestool" )
{
// Put a stool in the PC's inventory.
SEI_PickupItem( GetPCSpeaker(), "Stool" );
}
} // End main