WoR_PRC8/_module/nss/s_createzoladsto.nss

29 lines
903 B
Plaintext
Raw Permalink Normal View History

2025-04-03 11:49:34 -04:00
void main()
{
object oItem = OBJECT_INVALID;
// Clear all contents of the <span class="highlight">chest</span>
oItem = GetFirstItemInInventory();
while ( oItem != OBJECT_INVALID )
{
//Make sure people don't stuff <span class="highlight">chest</span> with plot items and break it
SetPlotFlag(oItem, FALSE);
DestroyObject( oItem, 0.0 );
oItem = GetNextItemInInventory();
}
// Set respawntime float to the number of seconds.
float respawntime = 5.0;
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
else
{
CreateItemOnObject("sha_zolad_stones", OBJECT_SELF, 4);
}
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
}