Recent changes Random page
GAMING
Gaming
 
WoWWiki
Halopedia
FFXIclopedia
Age of Conan
Warhammer Online
Grand Theft Wiki
See more...

Destroy complete inventory

From NWNWiki

Jump to: navigation, search

The script destroys all items (including equipped items) and gold on a PC.

This script is best suited for loading into the OnEnter portion of an Area. Designed for those of you who want the PCs to begin equally.

[edit] The Script

/******************************
Script: Clear Inventory
Created By: Jaden Wagener
Created On: 08/28/02
******************************/
void main()
{
//Set variables
int xGold, xCount;
object xItem, xPC;
//Let's see who we're ripping off today..
xPC = GetEnteringObject();
//Destroy the inventory items
xItem = GetFirstItemInInventory(xPC);
while(GetIsObjectValid(xItem))
{
DestroyObject(xItem);
xItem = GetNextItemInInventory(xPC);
}
// Empty all inventory slots
// Change 18 to 14 to not strip creature slots
for (xCount = 0; xCount < 18; xCount++)
DestroyObject( GetItemInSlot( xCount, xPC));
//Now let's get greedy and take the gold!
xGold = GetGold(xPC);
AssignCommand(xPC, TakeGoldFromCreature( xGold,xPC,TRUE));
}
Rate this article:
Share this article: