#include "x2_inc_switches" #include "zzdlg_main_inc" #include "adv_include" #include "nwnx_events" // This fires when a PC activates their database item. // It simply fires the rest menu. This is handy for when players are in locations // with enemies and need to perform a task only available from the rest menu. void main() { object oPC; object oDatabase; if(ADV_USING_LINUX) { oPC = OBJECT_SELF; oDatabase = GetEventItem(); } else { if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return; oPC = GetItemActivator(); oDatabase = GetItemActivated(); } // Checks to make sure PC isn't already in a conversation otherwise // the menu will glitch. PC has to leave their current conversation to open // the rest menu. if(!IsInConversation(oPC)) { // Prevent player from resting and fire the rest menu AssignCommand(oPC, ClearAllActions()); _dlgStart(oPC, oDatabase, ADV_REST_MENU, 1, 1, 1); } }