include library.create; include library.utils; include library.npe; include library.groundquests; include library.space_quest; include library.space_utils; include library.space_crafting; include library.sui; const string_id LAUNCH = new string_id("npe", "launch"); const string NPE_STATION = "object/building/general/npe_space_station.iff"; trigger OnObjectMenuRequest(obj_id player, menu_info mi) { mi.addRootMenu(menu_info_types.ITEM_USE, LAUNCH); return SCRIPT_CONTINUE; } trigger OnObjectMenuSelect(obj_id player, int item) { if ( item == menu_info_types.ITEM_USE ) { if (checkGod(player)) return SCRIPT_CONTINUE; if(utils.hasScriptVar(player, "npe.gamma_travel.pid")) return SCRIPT_CONTINUE; obj_id container = getTopMostContainer(self); string containerTemplate = getTemplateName(container); //debugSpeakMsg(self, "Container is " + containerTemplate); string_id stfPrompt = new string_id("npe", "gamma_shuttle_prompt"); string_id stfTitle = new string_id("npe", "gamma_shuttle_title"); string prompt = utils.packStringId(stfPrompt); string title = utils.packStringId(stfTitle); location terminalLoc = getLocation(self); utils.setScriptVar(player, "npe.gamma_travel.term_loc", terminalLoc); utils.setScriptVar(player, "npe.gamma_travel.pid", true); if (containerTemplate.equals(NPE_STATION)) int pid = sui.msgbox(player, player, prompt, sui.OK_CANCEL, title, 0, "npeGammaTransfer"); else int pid = sui.msgbox(player, player, prompt, sui.OK_CANCEL, title, 0, "npeStationTransfer"); } return SCRIPT_CONTINUE; } boolean checkGod(obj_id self) { if (isGod(self)) { sendSystemMessageTestingOnly(self, "Please turn off god mode when moving between npe locations. God mode and instances do not get along"); return true; } return false; }