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,56 @@
// 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 High and Boss 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 = 1800.0;
object oLastOpener = GetLastOpener();
// This is set in the OnEnter for the module.
string sID = GetLocalString(oLastOpener, "player_id");
// Debug info
// SpeakString("Player ID is:" + sID + ", fDelay is " + FloatToString(fDelay), TALKVOLUME_SHOUT);
if (GetLocalInt(OBJECT_SELF, sID) != 0)
{
return;
}
Empty_Container(OBJECT_SELF);
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
GenerateBossTreasure(oLastOpener, OBJECT_SELF);
SetLocalInt(OBJECT_SELF, sID, 1);
ShoutDisturbed();
// Delay resetting the flag back to zero
DelayCommand(fDelay, SetLocalInt(OBJECT_SELF,sID, 0));
}