// Treasure Chest #include "NW_O2_CONINCLUDE" void main() { object oItem = OBJECT_INVALID; // Clear all contents of the chest oItem = GetFirstItemInInventory(); while ( oItem != OBJECT_INVALID ) { //Make sure people don't stuff chest with plot items and break it SetPlotFlag(oItem, FALSE); DestroyObject( oItem, 0.0 ); oItem = GetNextItemInInventory(); } // Get respawntime float to the number of seconds off of placeable float respawntime = GetLocalFloat(OBJECT_SELF,"RESPAWNTIME"); // Set local int on object for how much time before respawn if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") != 0) { return; } //Start of 1st set of conditions if (GetLocalInt(OBJECT_SELF, "DAGGEROFZU")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("thesacreddaggero", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "QWEST_26")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End first conditional //Start 2nd set of conditions } else if (GetLocalInt(OBJECT_SELF, "BAGOFMARBLES")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("bagofmarbles", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "BagofMarbles")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); // End 2nd conditions //Start 3rd set of conditions } else if (GetLocalInt(OBJECT_SELF, "BAROLSLOOT")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("item011", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "QWEST_22")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 3rd set of conditions //Start 4th set of conditions } else if (GetLocalInt(OBJECT_SELF, "INFORMATION_CHEST")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("subracebook", OBJECT_SELF); CreateItemOnObject("dmfi_pc_dicebag", OBJECT_SELF); CreateItemOnObject("dmfi_pc_follow", OBJECT_SELF); CreateItemOnObject("dmfi_pc_emote", OBJECT_SELF); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 4th set of conditions //Start 5th set of conditions } else if (GetLocalInt(OBJECT_SELF, "MIXING_BOOKSA")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("book_gren_dragon", OBJECT_SELF); CreateItemOnObject("book_brnz_dragon", OBJECT_SELF); CreateItemOnObject("book_silver_drag", OBJECT_SELF); CreateItemOnObject("book_blue_dragon", OBJECT_SELF); CreateItemOnObject("book_blck_dragon", OBJECT_SELF); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 5th set of conditions //Start 6th set of conditions } else if (GetLocalInt(OBJECT_SELF, "MIXING_BOOKSB")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("book_coper_dragn", OBJECT_SELF); CreateItemOnObject("book_red_dragon", OBJECT_SELF); CreateItemOnObject("book_brass_drago", OBJECT_SELF); CreateItemOnObject("book_gold_dragon", OBJECT_SELF); CreateItemOnObject("book_white_drago", OBJECT_SELF); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 6th set of conditions //Start 7th set of conditions } else if (GetLocalInt(OBJECT_SELF, "SPEAR_BODY")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("bloody_spear_tip", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "Bloody_Spear_Tip")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 7th set of conditions //Start 8th set of conditions } else if (GetLocalInt(OBJECT_SELF, "KELINARSCLOCK")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("item014", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "QWEST_28")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 8th set of conditions //Start 9th set of conditions } else if (GetLocalInt(OBJECT_SELF, "SERWYXSKULL")== 1) { object oLastOpener = GetLastOpener(); CreateItemOnObject("theskullofserwyx", OBJECT_SELF, 1); DestroyObject(GetItemPossessedBy(oLastOpener, "QWEST_23")); SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1); ShoutDisturbed(); // Command added to delay the respawn AssignCommand( OBJECT_SELF, DelayCommand (respawntime, SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0) ) ); //End of 9th set of conditions } }