31 lines
884 B
Plaintext
31 lines
884 B
Plaintext
|
/*
|
||
|
Spawns in general purpose treasure, some gold,
|
||
|
and up to 4 specific Magic Items
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Dalantriel
|
||
|
//:: Created On: July 22 2002
|
||
|
//:://////////////////////////////////////////////
|
||
|
#include "NW_O2_CONINCLUDE"
|
||
|
|
||
|
void main()
|
||
|
|
||
|
{
|
||
|
// Check if chest already opened
|
||
|
if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
// If not, spawn in random treasures and some gold
|
||
|
object oLastOpener = GetLastOpener();
|
||
|
GenerateHighTreasure(oLastOpener, OBJECT_SELF);
|
||
|
ExecuteScript("magictres", OBJECT_SELF);
|
||
|
ExecuteScript("magictres", OBJECT_SELF);
|
||
|
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
|
||
|
int nGoldPieces = (d100() * 8) + d10();
|
||
|
CreateItemOnObject ("NW_IT_GOLD001", OBJECT_SELF, nGoldPieces);
|
||
|
SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
|
||
|
|
||
|
ShoutDisturbed();
|
||
|
}
|