112 lines
3.9 KiB
Plaintext
112 lines
3.9 KiB
Plaintext
|
// 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();
|
||
|
{
|
||
|
if (GetTag(OBJECT_SELF) == "TR_MAP_GRIN") {
|
||
|
CreateItemOnObject("map", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_STRAL") {
|
||
|
CreateItemOnObject("map001", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_CRYPTS") {
|
||
|
CreateItemOnObject("map003", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ELMINES") {
|
||
|
CreateItemOnObject("map004", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_SEWERS") {
|
||
|
CreateItemOnObject("map005", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_HILGIANT") {
|
||
|
CreateItemOnObject("map006", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ICEBLD") {
|
||
|
CreateItemOnObject("map007", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ELWINAR") {
|
||
|
CreateItemOnObject("map008", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_STRACOMB") {
|
||
|
CreateItemOnObject("map009", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_STRALADCAS") {
|
||
|
CreateItemOnObject("map010", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_STRALSEW") {
|
||
|
CreateItemOnObject("map011", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_STRLTEN") {
|
||
|
CreateItemOnObject("map012", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ETUMMUS") {
|
||
|
CreateItemOnObject("map013", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_XANALAN") {
|
||
|
CreateItemOnObject("map014", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_VARYN") {
|
||
|
CreateItemOnObject("map015", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ZELI") {
|
||
|
CreateItemOnObject("map016", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_RORK") {
|
||
|
CreateItemOnObject("map017", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_ZU") {
|
||
|
CreateItemOnObject("map018", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_TROLL") {
|
||
|
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
|
||
|
GenerateLowTreasure(oLastOpener, OBJECT_SELF);
|
||
|
CreateItemOnObject("map019", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_DORDACH") {
|
||
|
CreateItemOnObject("map020", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_REONYC") {
|
||
|
CreateItemOnObject("map021", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_PROURK") {
|
||
|
CreateItemOnObject("map022", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_HUK") {
|
||
|
CreateItemOnObject("map023", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_MEDUSA") {
|
||
|
CreateItemOnObject("map024", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_PIRBAG") {
|
||
|
CreateItemOnObject("map026", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_TELITH") {
|
||
|
CreateItemOnObject("map027", OBJECT_SELF, 1);}
|
||
|
|
||
|
else if (GetTag(OBJECT_SELF) == "TR_MAP_PRISON") {
|
||
|
CreateItemOnObject("map028", OBJECT_SELF, 1);}
|
||
|
}
|
||
|
|
||
|
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) ) );
|
||
|
}
|