generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
56
_module/nss/oner_o2_classsup.nss
Normal file
56
_module/nss/oner_o2_classsup.nss
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user