Initial Commit

Initial Commit.
This commit is contained in:
Jaysyn904
2025-09-14 15:40:46 -04:00
parent 7083b33d71
commit 1eefc84201
19230 changed files with 11539227 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
// Each player can loot containers that have this
// script in its OnOpen event.
// Set the float fDelay on the object to customize
// the number of seconds to wait.
// Oner the Wise otwise@gmail.com
// This generates medium treasures.
void Empty_Container(object oContainer )
{
object oItem = GetFirstItemInInventory( oContainer );
while ( GetIsObjectValid( oItem ))
{
DestroyObject( oItem );
oItem = GetNextItemInInventory( oContainer );
}
}
#include "NW_O2_CONINCLUDE"
void main()
{
float fDelay = GetLocalFloat(OBJECT_SELF, "fDelay"); // seconds to wait on respawn
// A default delay.
if (fDelay == 0.0)
fDelay = 600.0;
object oLastOpener = GetLastOpener();
// This is set in the OnEnter for the module.
string sID = GetLocalString(oLastOpener, "player_id");
if (GetLocalInt(OBJECT_SELF, sID) != 0)
{
return;
}
Empty_Container(OBJECT_SELF);
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF, sID, 1);
ShoutDisturbed();
DelayCommand(fDelay, SetLocalInt(OBJECT_SELF,sID, 0));
}