Initial commit
Initial commit [1.18]
This commit is contained in:
61
_module/nss/treasure_devour2.nss
Normal file
61
_module/nss/treasure_devour2.nss
Normal file
@@ -0,0 +1,61 @@
|
||||
// Treasure Chest
|
||||
#include "NW_O2_CONINCLUDE"
|
||||
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 = 600.00;
|
||||
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
object oLastOpener = GetLastOpener();
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
|
||||
{int nRandom = d8(1);
|
||||
if (nRandom == 1){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 402);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 1);
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);}
|
||||
else if (nRandom == 2){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 675);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 1);
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);}
|
||||
else if (nRandom == 3){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 905);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 1);
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);}
|
||||
else if (nRandom == 4){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 1255);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 2);
|
||||
GenerateLowTreasure(oLastOpener, OBJECT_SELF);}
|
||||
else if (nRandom == 5){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 1361);
|
||||
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 2);}
|
||||
else if (nRandom == 6){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 1528);
|
||||
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 3);}
|
||||
else if (nRandom == 7){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 1723);
|
||||
GenerateMediumTreasure(oLastOpener, OBJECT_SELF);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 3);}
|
||||
else if (nRandom == 8){
|
||||
CreateItemOnObject("NW_IT_GOLD001", OBJECT_SELF, 1900);
|
||||
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
|
||||
CreateGem(OBJECT_SELF, OBJECT_SELF, 4);}}
|
||||
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
|
||||
ShoutDisturbed();
|
||||
// Command added to delay the <span class="highlight">respawn</span>
|
||||
AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) );
|
||||
}
|
||||
Reference in New Issue
Block a user