package script.conversation; import script.library.ai_lib; import script.library.chat; import script.*; public class bestine_rumor04 extends script.base_script { public bestine_rumor04() { } public static String c_stringFile = "conversation/bestine_rumor04"; public boolean bestine_rumor04_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean bestine_rumor04_condition_nonoffice(obj_id player, obj_id npc) throws InterruptedException { return hasObjVar(npc, "bestine.electionEnded"); } public void bestine_rumor04_action__defaultAction(obj_id player, obj_id npc) throws InterruptedException { } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isMob(self)) || (isPlayer(self))) { detachScript(self, "npc.conversation.bestine_rumor04"); } setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException { int menu = menuInfo.addRootMenu(menu_info_types.CONVERSE_START, null); menu_info_data menuInfoData = menuInfo.getMenuItemById(menu); menuInfoData.setServerNotify(false); setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException { clearCondition(self, CONDITION_CONVERSABLE); detachScript(self, "npc.conversation.bestine_rumor04"); return SCRIPT_CONTINUE; } public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException { if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } if (!bestine_rumor04_condition_nonoffice(player, self)) { string_id message = new string_id(c_stringFile, "s_e4577019"); chat.chat(self, message); return SCRIPT_CONTINUE; } if (bestine_rumor04_condition_nonoffice(player, self)) { string_id message = new string_id(c_stringFile, "s_156c9c13"); chat.chat(self, message); return SCRIPT_CONTINUE; } chat.chat(self, "Error: All conditions for OnStartNpcConversation were false."); return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException { if (!conversationId.equals("bestine_rumor04")) { return SCRIPT_CONTINUE; } int branchId = getIntObjVar(player, "conversation.bestine_rumor04.branchId"); chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); removeObjVar(player, "conversation.bestine_rumor04.branchId"); return SCRIPT_CONTINUE; } }