diff --git a/md/mc_diplomatic_aid.xml b/md/mc_diplomatic_aid.xml
index c9e2b82..860b977 100644
--- a/md/mc_diplomatic_aid.xml
+++ b/md/mc_diplomatic_aid.xml
@@ -384,7 +384,7 @@
<param name="T3_Protect_Station" value="$T3_Protect_Station" />
<param name="T3_Dignitary_Start_Station" value="$T3_Dignitary_Start_Station" />
<param name="T3_Dignitary_End_Station" value="$T3_Dignitary_End_Station" />
- <param name="Debug_Chance" value="100" />
+ <param name="Debug_Chance" value="0" />
<param name="End_Signal_Cue" value="CleanUp" />
</cue>
</cues>
@@ -415,6 +415,7 @@
-103: Client_Station was left unspecified.
-104: Required Station not found after mission start
-5: Mission Offer was removed.
+ -2: Mission was aborted.
1: Mission finished successfully.
-->
<library name="Start">
@@ -514,6 +515,7 @@
</create_cue_actor>
<set_comm_handler actor="$Client" customhandler="true" />
<set_entity_type entity="$Client" type="entitytype.commander" />
+ <set_mission_actor actor="$Client" missionactor="true" />
<find_dock_location name="$Client_Station_Dock" container="$Client_Station" freemissionactorslot="true" required="true" />
<add_actor_to_platform actor="$Client" dockingbay="$Client_Station_Dock.component" />
</do_if>
@@ -570,6 +572,10 @@
<conditions>
<check_value value="$Without_Offer" exact="false" />
</conditions>
+ <actions>
+ <set_value name="$Briefing_Seen" exact="false" />
+ <set_value name="$In_Mission" exact="false" />
+ </actions>
<cues>
<cue name="MissionLocationOffer" onfail="cancel">
<conditions>
@@ -585,7 +591,7 @@
<param name="Reward" value="0Cr" />
<param name="Difficulty" value="level.hard" />
<param name="Faction" value="$Client_Faction" />
- <param name="MissionType" value="missiontype.police" />
+ <param name="MissionType" value="missiontype.chain" />
<param name="AcceptCue" value="Mission_Accepted" />
<param name="CompleteCue" value="Add_Offer_Steps" />
</cue>
@@ -668,7 +674,9 @@
<event_conversation_started actor="$Client" />
<event_conversation_returned_to_section actor="$Client" />
</check_any>
- <check_value value="not $Conversation_Trigger_Cue"/>
+ <check_value value="not $Conversation_Trigger_Cue" />
+ <check_value value="$In_Mission" exact="false" />
+ <check_value value="$Briefing_Seen" exact="false" />
</check_all>
<event_cue_signalled />
</check_any>
@@ -678,15 +686,50 @@
<do_if value="event.name" exact="'event_conversation_started'">
<add_npc_line line="3002" />
</do_if>
- <add_player_choice text="{1002,14001}" position="top_right" section="c_police_accept" choiceparam="Start" />
- <add_player_choice text="{1002,14002}" position="bottom_right" section="c_police_decline" choiceparam="Start" />
- <add_player_choice_sub text="{1002, 14003}" position="left" section="c_police_moreinfo" choiceparam="Start" />
+ <add_player_choice text="{1002, 14003}" position="right" section="c_police_moreinfo" />
+ <add_player_choice text="{1002, 2}" position="bottom_right" section="g_finish" comment="Goodbye" />
</actions>
</cue>
<cue name="Conversation_NextSection" instantiate="true">
<conditions>
+ <event_conversation_next_section actor="$Client" />
+ <check_value value="$In_Mission" exact="false" />
+ </conditions>
+ <actions>
+ <!-- Moreinfo case -->
+ <do_if value="event.param == 'c_police_moreinfo'">
+ <!-- Briefing here -->
+ <open_conversation_menu menu="MissionBriefingMenu" param="[0, 0, Start, true]" param2="event.param3" />
+ <add_conversation_view view="facedetailmonitor" />
+ <add_npc_line line="3037" />
+
+ <set_value name="$Briefing_Seen" exact="true" />
+ </do_if>
+ </actions>
+ </cue>
+
+ <cue name="Conversation_Return" instantiate="true">
+ <conditions>
+ <check_all>
+ <event_conversation_returned_to_section actor="$Client" />
+ <check_value value="$Briefing_Seen" exact="true" />
+ <check_value value="$In_Mission" exact="false" />
+ </check_all>
+ </conditions>
+ <actions>
+ <add_conversation_view view="facenormal" />
+
+ <add_player_choice text="{1002, 14001}" position="top_right" section="c_police_accept" choiceparam="Start" />
+ <add_player_choice text="{1002, 14003}" position="right" section="c_police_moreinfo" choiceparam="Start" />
+ <add_player_choice text="{1002, 14002}" position="bottom_right" section="c_police_decline" choiceparam="Start" />
+ </actions>
+ </cue>
+
+ <cue name="Conversation_ReturnNextSection" instantiate="true">
+ <conditions>
<event_conversation_next_section actor="$Client" choiceparam="Start" />
+ <check_value value="$In_Mission" exact="false" />
</conditions>
<actions>
<!-- Moreinfo case -->
@@ -707,6 +750,7 @@
<!-- Decline Case -->
<do_elseif value="event.param == 'c_police_decline'">
+ <set_value name="$Briefing_Seen" exact="false" />
<reset_cue cue="Show_Offer" />
</do_elseif>
</actions>
@@ -868,26 +912,33 @@
<actions>
<add_conversation_view view="facenormal" />
- <do_if value="$Tier" exact="3" negate="true">
- <!-- Conversation positions 1 - 4 -->
- <do_all exact="$Mission_List.count" counter="$Counter">
- <add_player_choice_sub text="readtext.{$Page}.{$Mission_List.{$Counter}.{$MissionList_TextID}}" position="$Counter" section="mission_choice" choiceparam="$Counter" selectable="not $Completed_Missions.indexof.{$Mission_List.{$Counter}.{$MissionList_MissionID}}" />
- </do_all>
- </do_if>
- <do_else>
- <!-- Conversation position 4 -->
- <add_player_choice text="{1002,14001}" position="top_right" section="final_accept" />
- </do_else>
+ <do_if value="@$Mission_Active" exact="false">
+ <do_if value="$Seen_Updated_Briefing" exact="true">
+ <do_if value="$Tier" exact="3" negate="true">
+ <!-- Conversation Positions 1 - 4 -->
+ <do_all exact="$Mission_List.count" counter="$Counter">
+ <add_player_choice_sub text="readtext.{$Page}.{$Mission_List.{$Counter}.{$MissionList_TextID}}" position="$Counter" section="mission_choice" choiceparam="$Counter" selectable="not $Completed_Missions.indexof.{$Mission_List.{$Counter}.{$MissionList_MissionID}}" />
+ </do_all>
+ </do_if>
+ <do_else>
+ <!-- Conversation Position 4 -->
+ <add_player_choice text="{1002,14001}" position="top_right" section="final_accept" />
+ </do_else>
- <!-- Conversation position 5 -->
- <do_if value="$Seen_Updated_Briefing" exact="false">
- <add_player_choice_sub text="'Updated Mission Briefing'" position="right" section="info" />
+ <!-- Conversation Position 5 -->
+ <add_player_choice_sub text="'Mission Briefing'" position="right" section="info" />
+ </do_if>
+ <do_else>
+ <!-- Conversation position 5 -->
+ <add_player_choice_sub text="'Updated Mission Briefing'" position="right" section="info" />
+ </do_else>
+
+ <!-- Conversation position 6 -->
+ <add_player_choice_return text="{1002,20}" position="bottom_right" comment="(Back)" />
</do_if>
<do_else>
- <add_player_choice_sub text="'Mission Briefing'" position="right" section="info" />
+ <add_player_choice text="{1002, 2}" position="right" section="g_finish" comment="Goodbye" />
</do_else>
- <!-- Conversation position 6 -->
- <add_player_choice_return text="{1002,20}" position="bottom_right" comment="(Back)" />
<debug_text text="'MC_Diplomatic_Aid: In-mission conversation has been started...'" chance="$Debug_Chance" />
</actions>
@@ -1156,6 +1207,8 @@
<signal_cue cue="Mission_Success" />
</do_elseif>
</do_else>
+
+ <set_value name="$Mission_Active" exact="false" />
</actions>
</cue>
@@ -1177,9 +1230,9 @@
<do_if value="$T1_Failed_Missions.count" max="1">
<!-- If the player has not yet failed two missions, this failure can be ignored -->
<append_to_list name="$T1_Completed_Missions" exact="$Mission_List.{event.param}.{$MissionList_MissionID}" />
- <debug_text text="readtext.{$Page}.{$Mission_List.{event.param}.{$MissionList_TextID}} + 'was added to $T1_Completed_Missions.'" chance="$Debug_Chance" />
+ <debug_text text="readtext.{$Page}.{$Mission_List.{event.param}.{$MissionList_TextID}} + ' was added to $T1_Completed_Missions.'" chance="$Debug_Chance" />
<append_to_list name="$Completed_Missions" exact="$Mission_List.{event.param}.{$MissionList_MissionID}" />
- <debug_text text="readtext.{$Page}.{$Mission_List.{event.param}.{$MissionList_TextID}} + 'was added to $Completed_Missions'" chance="$Debug_Chance" />
+ <debug_text text="readtext.{$Page}.{$Mission_List.{event.param}.{$MissionList_TextID}} + ' was added to $Completed_Missions'" chance="$Debug_Chance" />
<!-- Go back to the mission -->
<create_mission cue="Start" name="$Mission_Name" description="readtext.{$Page}.{$Text_Offset + 5}" type="missiontype.police" faction="$Client_Faction">
@@ -1240,6 +1293,8 @@
<!-- In the final tier, the failure of any of the missions means absolute mission failure. -->
<signal_cue cue="Absolute_Mission_Failure" />
</do_elseif>
+
+ <set_value name="$Mission_Active" exact="false" />
</actions>
</cue>
@@ -2141,6 +2196,21 @@
</cue>
</cues>
</cue>
+
+ <cue name="Mission_Aborted">
+ <conditions>
+ <event_mission_aborted cue="Start" />
+ </conditions>
+ <actions>
+ <signal_cue_instantly cue="md.GenericMissions.GenericAbortLogbookEntry" param="[$Mission_Name, $Client]" />
+
+ <remove_mission cue="Start" type="aborted" />
+
+ <set_value name="$Feedback_Value" exact="-2" />
+ <set_value name="Mission_Library_Cleanup.$EndFeedbackValue" exact="$Feedback_Value" />
+ <signal_cue_instantly cue="Mission_Library_Cleanup" />
+ </actions>
+ </cue>
</cues>
</cue>
</cues>
@@ -2154,14 +2224,8 @@
</actions>
</cue>
- <cue name="Mission_Library_Cleanup">
- <conditions>
- <event_cue_signalled />
- </conditions>
+ <library name="CleanUpActions">
<actions>
- <debug_text text="'MC_Diplomatic_Aid: Cleaning up MC_Diplomatic_Aid library...'" chance="$Debug_Chance" />
-
- <!-- Remove objects -->
<do_if value="@$Client.exists and (not $Preexisting_Client?)">
<destroy_object object="$Client" />
</do_if>
@@ -2176,8 +2240,45 @@
<signal_cue cue="$End_Signal_Cue" />
</do_if>
+ <remove_offer cue="Start" />
<cancel_cue cue="Start" />
</actions>
+ </library>
+
+ <cue name="Mission_Library_Cleanup">
+ <conditions>
+ <event_cue_signalled />
+ </conditions>
+ <actions>
+ <debug_text text="'MC_Diplomatic_Aid: Cleaning up MC_Diplomatic_Aid library...'" chance="$Debug_Chance" />
+
+ <!-- Remove objects -->
+ <do_if value="player.platform">
+ <set_value name="$PlayerOnPlatform" exact="true" />
+ </do_if>
+ <do_else>
+ <set_value name="$PlayerOnPlatform" exact="false" />
+ <include_actions ref="CleanUpActions" />
+ </do_else>
+ </actions>
+ <cues>
+ <cue name="PlayerMustLeavePlatformCheck" onfail="cancel">
+ <conditions>
+ <check_value value="$PlayerOnPlatform" exact="true" />
+ </conditions>
+ <cues>
+ <cue name="PlayerLeavesPlatform">
+ <conditions>
+ <event_object_changed_room object="player.entity" />
+ <check_value value="player.platform" negate="true" />
+ </conditions>
+ <actions>
+ <include_actions ref="CleanUpActions" />
+ </actions>
+ </cue>
+ </cues>
+ </cue>
+ </cues>
</cue>
</cues>
</library>