generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
34
_module/nss/opw_inv_replace.nss
Normal file
34
_module/nss/opw_inv_replace.nss
Normal file
@@ -0,0 +1,34 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Replaces Inventories In Placeables
|
||||
// opw_inv_replace
|
||||
// By Don Anderson
|
||||
// dandersonru@msn.com
|
||||
//
|
||||
// Place this script in the On Disturbed Event
|
||||
// Warning....this gives away stuff for free in UNLIMITED quantities
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oChest = OBJECT_SELF;
|
||||
object oPC = GetLastDisturbed();
|
||||
object oItem = GetInventoryDisturbItem();
|
||||
string sRItem = GetResRef(oItem);
|
||||
|
||||
int nDType = GetInventoryDisturbType();
|
||||
|
||||
//Destroy Added Item
|
||||
if(nDType == INVENTORY_DISTURB_TYPE_ADDED)
|
||||
{
|
||||
DestroyObject(oItem,0.1);
|
||||
return;
|
||||
}
|
||||
|
||||
//Replace Removed Item
|
||||
if(nDType == INVENTORY_DISTURB_TYPE_REMOVED)
|
||||
{
|
||||
CreateItemOnObject(sRItem,oChest,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user