ES_PRC8/_module/nss/llamachest_sc.nss
Jaysyn904 08e84b4e71 Initial upload
Initial upload.
2023-11-14 12:09:02 -05:00

40 lines
1.2 KiB
Plaintext

#include "NW_O2_CONINCLUDE"
void main()
{
// Set respawntime float to the number of seconds.
float respawntime = 1200.00;
// checks to see if it's already been opened
// ends the script if it has
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
{
return;
}
object oLastOpener = GetLastOpener();
int nOpenerLevel = GetHitDice(oLastOpener);
// this checks the opener's level
// a crappy book is spawned if over level 10
if (nOpenerLevel > 10) {
CreateItemOnObject("thestoryofxertlt");
} else {
// the quality of treasure.
// I use HighTreasure for large chests, MediumTreasure
// for small chests, and LowTreasure for barrels
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
}
// a local variable is set to 1 to let the script know
// it's been opened
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
// I think this lets all monsters of its faction know
// it's been opened. I don't use it
ShoutDisturbed();
// Command added to delay the <span class="highlight">respawn</span>
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
}