// ====================================================================== // // biogenic_scientist_geonosian.script // // // // DO NOT EDIT THIS AUTO-GENERATED FILE. PLEASE USE THE CONVERATION EDITOR! // // ====================================================================== // ====================================================================== // Library Includes // ====================================================================== include library.ai_lib; include library.chat; // ====================================================================== // Script Constants // ====================================================================== string c_stringFile = "conversation/biogenic_scientist_geonosian"; // ====================================================================== // Script Conditions // ====================================================================== boolean biogenic_scientist_geonosian_condition__defaultCondition (obj_id player, obj_id npc) { return true; } // ---------------------------------------------------------------------- boolean biogenic_scientist_geonosian_condition_get_tracker_1 (obj_id player, obj_id npc) { int tracker = getIntObjVar(player, "biogenic.scientist_geonosian_convo"); if(tracker == 1) { return true; } else { return false; } } // ====================================================================== // Script Actions // ====================================================================== void biogenic_scientist_geonosian_action__defaultAction (obj_id player, obj_id npc) { } // ---------------------------------------------------------------------- void biogenic_scientist_geonosian_action_give_schematic (obj_id player, obj_id npc) { setObjVar(player, "biogenic.scientist_geonosian_convo", 1); //sendSystemMessageTestingOnly(player, "Give sonic blaster schematic here"); } // ---------------------------------------------------------------------- void biogenic_scientist_geonosian_action_face_to (obj_id player, obj_id npc) { faceToBehavior(npc, player); } // ====================================================================== // User Script Triggers // ====================================================================== trigger OnInitialize () { if ((!isMob (self)) || (isPlayer (self))) detachScript(self, "npc.conversation.biogenic_scientist_geonosian"); setInvulnerable(self, true); setCondition (self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } trigger OnAttach () { setCondition (self, CONDITION_CONVERSABLE); setInvulnerable(self, true); return SCRIPT_CONTINUE; } trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo) { 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; } trigger OnIncapacitated (obj_id killer) { clearCondition (self, CONDITION_CONVERSABLE); detachScript (self, "npc.conversation.biogenic_scientist_geonosian"); return SCRIPT_CONTINUE; } // ====================================================================== // Script Triggers // ====================================================================== trigger OnStartNpcConversation (obj_id player) { if (ai_lib.isInCombat (self) || ai_lib.isInCombat (player)) return SCRIPT_OVERRIDE; //-- [NOTE] if (biogenic_scientist_geonosian_condition_get_tracker_1 (player, self)) { biogenic_scientist_geonosian_action_face_to (player, self); //-- NPC: It's... terrible... it's locked in... 78660... string_id message = new string_id (c_stringFile, "s_5d99d708"); chat.chat (self, message); return SCRIPT_CONTINUE; } //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { biogenic_scientist_geonosian_action_face_to (player, self); //-- NPC: Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out... string_id message = new string_id (c_stringFile, "s_a59fc522"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Hang in there, you'll be alright. boolean hasResponse0 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: Stop blathering. You'll live. boolean hasResponse1 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } //-- PLAYER: I hope you make it. Good-bye. boolean hasResponse2 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse2 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_f612da3"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_720b306c"); if (hasResponse2) responses [responseIndex++] = new string_id (c_stringFile, "s_ab9b9023"); setObjVar (player, "conversation.biogenic_scientist_geonosian.branchId", 2); npcStartConversation (player, self, "biogenic_scientist_geonosian", message, responses); } else { chat.chat (self, message); } return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnStartNpcConversation were false."); return SCRIPT_CONTINUE; } // ---------------------------------------------------------------------- trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response) { if (conversationId != "biogenic_scientist_geonosian") return SCRIPT_CONTINUE; int branchId = getIntObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); //-- [BRANCH NOTE] //-- NPC: Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out... //-- [RESPONSE NOTE] //-- PLAYER: Hang in there, you'll be alright. if (branchId == 2 && response == "s_f612da3") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { biogenic_scientist_geonosian_action_give_schematic (player, self); //-- NPC: No, no. But that's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... string_id message = new string_id (c_stringFile, "s_3b597458"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thank you, I will. boolean hasResponse0 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: OK, I'll take it. boolean hasResponse1 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_52a88e99"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_4c6bb27a"); setObjVar (player, "conversation.biogenic_scientist_geonosian.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out... //-- [RESPONSE NOTE] //-- PLAYER: Stop blathering. You'll live. if (branchId == 2 && response == "s_720b306c") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { biogenic_scientist_geonosian_action_give_schematic (player, self); //-- NPC: No, I doubt that. But it's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... string_id message = new string_id (c_stringFile, "s_7ddd5bf5"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thank you, I will. boolean hasResponse0 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: OK, I'll take it. boolean hasResponse1 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_52a88e99"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_4c6bb27a"); setObjVar (player, "conversation.biogenic_scientist_geonosian.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out... //-- [RESPONSE NOTE] //-- PLAYER: I hope you make it. Good-bye. if (branchId == 2 && response == "s_ab9b9023") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { biogenic_scientist_geonosian_action_give_schematic (player, self); //-- NPC: Wait, wait... Take this... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked... Put it to good use... string_id message = new string_id (c_stringFile, "s_71f20c60"); int numberOfResponses = 0; boolean hasResponse = false; //-- PLAYER: Thank you, I will. boolean hasResponse0 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } //-- PLAYER: OK, I'll take it. boolean hasResponse1 = false; if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { ++numberOfResponses; hasResponse = true; hasResponse1 = true; } if (hasResponse) { int responseIndex = 0; string_id responses [] = new string_id [numberOfResponses]; if (hasResponse0) responses [responseIndex++] = new string_id (c_stringFile, "s_52a88e99"); if (hasResponse1) responses [responseIndex++] = new string_id (c_stringFile, "s_4c6bb27a"); setObjVar (player, "conversation.biogenic_scientist_geonosian.branchId", 3); npcSpeak (player, message); npcSetConversationResponses (player, responses); } else { removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); } return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Thank... thank you for rescuing me, but... I've been hurt... I don't know... if I can make it out...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: No, no. But that's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: Thank you, I will. if (branchId == 3 && response == "s_52a88e99") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No, no. But that's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: No, no. But that's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: OK, I'll take it. if (branchId == 3 && response == "s_4c6bb27a") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No, no. But that's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: No, I doubt that. But it's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: Thank you, I will. if (branchId == 6 && response == "s_52a88e99") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No, I doubt that. But it's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: No, I doubt that. But it's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: OK, I'll take it. if (branchId == 6 && response == "s_4c6bb27a") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'No, I doubt that. But it's OK... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked. You take it... put it to good use...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: Wait, wait... Take this... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked... Put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: Thank you, I will. if (branchId == 7 && response == "s_52a88e99") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Wait, wait... Take this... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked... Put it to good use...' were false."); return SCRIPT_CONTINUE; } //-- [BRANCH NOTE] //-- NPC: Wait, wait... Take this... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked... Put it to good use... //-- [RESPONSE NOTE] //-- PLAYER: OK, I'll take it. if (branchId == 7 && response == "s_4c6bb27a") { //-- [NOTE] if (biogenic_scientist_geonosian_condition__defaultCondition (player, self)) { //-- NPC: Be careful... terrible creature... locked in... 78660... string_id message = new string_id (c_stringFile, "s_30d18e8f"); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); npcSpeak (player, message); npcEndConversation (player); return SCRIPT_CONTINUE; } chat.chat (self, "Error: All conditions for OnNpcConversationResponse for branch 'Wait, wait... Take this... I was trying to salvage data from... what's left of the computers. This was... all I could get... before the monsters attacked... Put it to good use...' were false."); return SCRIPT_CONTINUE; } chat.chat (self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); removeObjVar (player, "conversation.biogenic_scientist_geonosian.branchId"); return SCRIPT_CONTINUE; } // ======================================================================