generated from Jaysyn/ModuleTemplate
Initial upload
Initial upload
This commit is contained in:
36
_mod/_module/nss/rh_pl_bagclose.nss
Normal file
36
_mod/_module/nss/rh_pl_bagclose.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// rh_pl_bagclose - Close the bag and transfer it's contents
|
||||
// By Deva B. Winblood. November 12th, 2008
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////
|
||||
// FUNCTIONS
|
||||
////////////////////////////////////
|
||||
|
||||
void fnTransferGoods(object oSource,object oDestination,int bDestroy=FALSE)
|
||||
{ // PURPOSE: Transfer goods
|
||||
object oItem;
|
||||
object oCopy;
|
||||
oItem=GetFirstItemInInventory(oSource);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{ // transfer
|
||||
oCopy=CopyItem(oItem,oDestination,TRUE);
|
||||
DelayCommand(0.5,DestroyObject(oItem));
|
||||
oItem=GetNextItemInInventory(oSource);
|
||||
} // transfer
|
||||
if (bDestroy) DelayCommand(1.0,DestroyObject(oSource));
|
||||
} // fnTransferGoods()
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////[ MAIN ]//
|
||||
void main()
|
||||
{
|
||||
object oMe=OBJECT_SELF;
|
||||
object oOwner=GetLocalObject(oMe,"oOwner");
|
||||
object oStorage=GetLocalObject(oMe,"oStorage");
|
||||
if (!GetIsObjectValid(oStorage)) SendMessageToPC(oOwner,"ERROR rh_pl_bagclose - The Storage object is missing.");
|
||||
SendMessageToPC(oOwner,"Closing Other World Bag of Holding...");
|
||||
DeleteLocalInt(oOwner,"bBagOpening");
|
||||
fnTransferGoods(oMe,oStorage,TRUE);
|
||||
}
|
||||
Reference in New Issue
Block a user