mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
1262 lines
36 KiB
Plaintext
1262 lines
36 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// legacy_button_bastra.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.features;
|
|
include library.groundquests;
|
|
include library.space_quest;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/legacy_button_bastra";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean legacy_button_bastra_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_onButtonImp (obj_id player, obj_id npc)
|
|
{
|
|
|
|
boolean OnTask = hasObjVar(player, "legacy.faction.imperialPath");
|
|
|
|
return OnTask;
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_onButtonReb (obj_id player, obj_id npc)
|
|
{
|
|
return hasObjVar(player, "legacy.faction.rebelPath");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_failedTosche (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/legacy_button_start");
|
|
int questId2 = questGetQuestId("quest/legacy_button_jawatracks_reb");
|
|
|
|
|
|
|
|
boolean OnTask = (questIsQuestComplete (questId1, player))
|
|
&& ( !(questIsQuestActive(questId2, player))
|
|
&& !(questIsQuestComplete (questId2, player)));
|
|
|
|
|
|
|
|
return OnTask;
|
|
|
|
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_failedValarian (obj_id player, obj_id npc)
|
|
{
|
|
|
|
return (groundquests.hasCompletedQuest (player, "quest/legacy_button_jawatracks_reb_pt3")
|
|
|| groundquests.hasCompletedQuest (player, "quest/legacy_button_jawatracks_reb_pt3_v2"))
|
|
&& (!groundquests.isQuestActiveOrComplete (player, "quest/legacy_button_reb_valarian")
|
|
&& !groundquests.isQuestActiveOrComplete (player, "quest/legacy_button_reb_valarian_v2"));
|
|
|
|
/*
|
|
|
|
int questId1 = questGetQuestId("quest/legacy_button_jawatracks_reb_pt3");
|
|
int questId2 = questGetQuestId("quest/legacy_button_reb_valarian");
|
|
|
|
|
|
|
|
boolean OnTask = (questIsQuestComplete (questId1, player))
|
|
&& ( !(questIsQuestActive(questId2, player))
|
|
&& !(questIsQuestComplete (questId2, player)));
|
|
|
|
|
|
|
|
return OnTask;
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_onButtonCompleteReb (obj_id player, obj_id npc)
|
|
{
|
|
int questId2 = questGetQuestId("quest/legacy_button_reb_pt2");
|
|
|
|
boolean OnTask = questIsQuestComplete(questId2, player);
|
|
|
|
return OnTask;
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_failedDarklighter (obj_id player, obj_id npc)
|
|
{
|
|
return ((groundquests.hasCompletedQuest(player, "legacy_button_reb_valarian") || groundquests.hasCompletedQuest(player, "quest/legacy_button_jawatracks_reb_pt3_v2"))
|
|
&& !groundquests.isQuestActiveOrComplete(player, "legacy_button_reb_darklighter"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_failedSlicer (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/legacy_button_reb_darklighter");
|
|
int questId2 = questGetQuestId("quest/legacy_button_reb_pt2");
|
|
|
|
|
|
|
|
boolean OnTask = (questIsQuestComplete (questId1, player))
|
|
&& ( !(questIsQuestActive(questId2, player))
|
|
&& !(questIsQuestComplete (questId2, player)));
|
|
|
|
|
|
|
|
return OnTask;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_finishTogether (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "legacy_together") ||
|
|
groundquests.hasCompletedQuest(player, "legacy_together_2"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_FailedKickReb (obj_id player, obj_id npc)
|
|
{
|
|
boolean hasCompleted = false;
|
|
if(groundquests.isQuestActiveOrComplete(player, "naboo_kadaraa_tipping_the_balance_1"))
|
|
hasCompleted = true;
|
|
if(groundquests.hasCompletedQuest(player, "quest/legacy_naboo_kick_reb"))
|
|
hasCompleted = true;
|
|
|
|
return hasCompleted;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_failedWatto (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/legacy_button_reb_pt2");
|
|
int questId2 = questGetQuestId("quest/legacy_watto_pointer");
|
|
|
|
|
|
|
|
boolean OnTask = (questIsQuestComplete (questId1, player))
|
|
&& ( !(questIsQuestActive(questId2, player))
|
|
&& !(questIsQuestComplete (questId2, player)));
|
|
|
|
|
|
|
|
return OnTask;
|
|
|
|
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_button_bastra_condition_onButtonStart (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "quest/legacy_button_start");
|
|
/*int questId1 = questGetQuestId("quest/legacy_button_start");
|
|
|
|
boolean OnTask = (questIsQuestActive(questId1, player));
|
|
|
|
return OnTask;*/
|
|
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void legacy_button_bastra_action_signalRebelButton (obj_id player, obj_id npc)
|
|
{
|
|
setObjVar(player,"legacy.faction.rebelPath",1);
|
|
groundquests.grantQuest(player, "legacy_button_jawatracks_reb");
|
|
//groundquests.sendSignal(player, "legacy_button_start_launch_e3");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_grantValarian (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_reb_valarian_v2");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_grantDarklighter (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_reb_darklighter");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_grantTosche (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_jawatracks_reb");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_grantSlicer (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_reb_pt2");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_reGrantKickReb (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_naboo_kick_reb");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_grantWatto (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "legacy_watto_pointer");
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_button_bastra_action_signalGoToComplete (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "legacy_button_start_launch_e3");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int legacy_button_bastra_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Shouldn't you be on Naboo?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Just passing through.
|
|
if (response == "s_71")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well keep on moving?
|
|
string_id message = new string_id (c_stringFile, "s_72");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I seemed to have lost the name of my contact there.
|
|
if (response == "s_73")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Lost the name? Are you some type of nerf herder?
|
|
string_id message = new string_id (c_stringFile, "s_74");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Hmmm... no?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_76");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Lost the name? Are you some type of nerf herder?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Hmmm... no?
|
|
if (response == "s_76")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_disgust");
|
|
|
|
legacy_button_bastra_action_reGrantKickReb (player, npc);
|
|
|
|
//-- NPC: Here it is again.
|
|
string_id message = new string_id (c_stringFile, "s_77");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The Imps are also looking for this droid. I don't think they know you are on to its owner yet. Please get it back from Watto.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where is Watto again?
|
|
if (response == "s_85")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_grantWatto (player, npc);
|
|
|
|
//-- NPC: In Mos Espa.
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I told you no direct contact. You need to find out the contents of all three shipments. You will blow my cover if you keep coming back here. I will contact you by comm when you complete your mission.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am sorry. It will not happen again.
|
|
if (response == "s_45")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: See that it doesn't.
|
|
string_id message = new string_id (c_stringFile, "s_47");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I need the Jawa information again.
|
|
if (response == "s_48")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_grantTosche (player, npc);
|
|
|
|
//-- NPC: Here is their last known location.
|
|
string_id message = new string_id (c_stringFile, "s_51");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I need the Valarian location again.
|
|
if (response == "s_49")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_grantValarian (player, npc);
|
|
|
|
//-- NPC: Yea I expect you do.
|
|
string_id message = new string_id (c_stringFile, "s_52");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I need the Darklighter location again.
|
|
if (response == "s_50")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_grantDarklighter (player, npc);
|
|
|
|
//-- NPC: You need to get a move on.
|
|
string_id message = new string_id (c_stringFile, "s_55");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where is the slicer?
|
|
if (response == "s_53")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_grantSlicer (player, npc);
|
|
|
|
//-- NPC: Here is his location.
|
|
string_id message = new string_id (c_stringFile, "s_54");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE] D1
|
|
//-- NPC: So is Imperial Intelligence sending younglings to check up on me now?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am not an Imperial agent. I was the one that helped Solo.
|
|
if (response == "s_115")
|
|
{
|
|
legacy_button_bastra_action_signalGoToComplete (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Okay. Your bio-metrics check out with those sent to me by Inaldra. So why are you here?
|
|
string_id message = new string_id (c_stringFile, "s_119");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I've decided that I should help the rebellion.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_28");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 15);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sorry I didn't mean to bother you.
|
|
if (response == "s_116")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "adjust");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Good. Now leave.
|
|
string_id message = new string_id (c_stringFile, "s_117");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Okay. Your bio-metrics check out with those sent to me by Inaldra. So why are you here?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I've decided that I should help the rebellion.
|
|
if (response == "s_28")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
//-- NPC: I really have nothing to back up your word that you aren't an Imperial agent. But right now the Imps know the faces of most of my agents and I do need some help.
|
|
string_id message = new string_id (c_stringFile, "s_89");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do my best to help.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I am not sure that I want to do this.
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I want to help, but I need more experience.
|
|
boolean hasResponse2 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++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_91");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_99");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_38");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I really have nothing to back up your word that you aren't an Imperial agent. But right now the Imps know the faces of most of my agents and I do need some help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do my best to help.
|
|
if (response == "s_91")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: A shipment that I am interested in has been acquired by three different groups. A Jawa trading party, Valarians and Darklighters. Here is the information that I have. Let's start with the Jawas first. They are on a trade circuit. Here is their last known location.
|
|
string_id message = new string_id (c_stringFile, "s_93");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: It will be done in a flash.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_95");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am not sure that I want to do this.
|
|
if (response == "s_99")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "dismiss");
|
|
|
|
//-- NPC: As I suspected. You are just a coward. Well if you ever get that spine replaced come see me.
|
|
string_id message = new string_id (c_stringFile, "s_102");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I want to help, but I need more experience.
|
|
if (response == "s_38")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "point_left");
|
|
|
|
//-- NPC: Talk with Ordo, around the corner then. He might help.
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks I will.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_41");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 20);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A shipment that I am interested in has been acquired by three different groups. A Jawa trading party, Valarians and Darklighters. Here is the information that I have. Let's start with the Jawas first. They are on a trade circuit. Here is their last known location.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: It will be done in a flash.
|
|
if (response == "s_95")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_button_bastra_action_signalRebelButton (player, npc);
|
|
|
|
//-- NPC: Just get it done.
|
|
string_id message = new string_id (c_stringFile, "s_97");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_button_bastra_handleBranch20 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Talk with Ordo, around the corner then. He might help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks I will.
|
|
if (response == "s_41")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Come back when you are ready.
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.legacy_button_bastra");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Carh'la Bastra");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Carh'la Bastra");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
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, "conversation.legacy_button_bastra");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Triggers
|
|
// ======================================================================
|
|
|
|
//-- This function should move to base_class.java
|
|
boolean npcStartConversation(obj_id player, obj_id npc, string convoName, string_id greetingId, prose_package greetingProse, string_id[] responses)
|
|
{
|
|
Object[] objects = new Object[responses.length];
|
|
System.arraycopy(responses, 0, objects, 0, responses.length);
|
|
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnStartNpcConversation (obj_id player)
|
|
{
|
|
obj_id npc = self;
|
|
|
|
if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player))
|
|
return SCRIPT_OVERRIDE;
|
|
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition_onButtonImp (player, npc))
|
|
{
|
|
doAnimationAction (npc, "threaten");
|
|
|
|
//-- NPC: You know you don't play this entrapment game very well. I am a loyal citizen of the Empire. Leave me alone, before I hurt you.
|
|
string_id message = new string_id (c_stringFile, "s_145");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition_finishTogether (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shake_head_no");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Shouldn't you be on Naboo?
|
|
string_id message = new string_id (c_stringFile, "s_70");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Just passing through.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I seemed to have lost the name of my contact there.
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_bastra_condition_FailedKickReb (player, npc))
|
|
{
|
|
++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_71");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_73");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "legacy_button_bastra", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition_onButtonCompleteReb (player, npc))
|
|
{
|
|
doAnimationAction (npc, "threaten");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: The Imps are also looking for this droid. I don't think they know you are on to its owner yet. Please get it back from Watto.
|
|
string_id message = new string_id (c_stringFile, "s_101");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Where is Watto again?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition_failedWatto (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "legacy_button_bastra", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_button_bastra_condition_onButtonReb (player, npc))
|
|
{
|
|
doAnimationAction (npc, "dismiss");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I told you no direct contact. You need to find out the contents of all three shipments. You will blow my cover if you keep coming back here. I will contact you by comm when you complete your mission.
|
|
string_id message = new string_id (c_stringFile, "s_144");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am sorry. It will not happen again.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I need the Jawa information again.
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_bastra_condition_failedTosche (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I need the Valarian location again.
|
|
boolean hasResponse2 = false;
|
|
if (legacy_button_bastra_condition_failedValarian (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: I need the Darklighter location again.
|
|
boolean hasResponse3 = false;
|
|
if (legacy_button_bastra_condition_failedDarklighter (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
//-- PLAYER: Where is the slicer?
|
|
boolean hasResponse4 = false;
|
|
if (legacy_button_bastra_condition_failedSlicer (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_45");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_48");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_49");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_50");
|
|
|
|
if (hasResponse4)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 8);
|
|
|
|
npcStartConversation (player, npc, "legacy_button_bastra", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] D1
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "cough_polite");
|
|
|
|
legacy_button_bastra_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: So is Imperial Intelligence sending younglings to check up on me now?
|
|
string_id message = new string_id (c_stringFile, "s_805");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am not an Imperial agent. I was the one that helped Solo.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_bastra_condition_onButtonStart (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sorry I didn't mean to bother you.
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_bastra_condition__defaultCondition (player, npc))
|
|
{
|
|
++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_115");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_116");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_button_bastra.branchId", 14);
|
|
|
|
npcStartConversation (player, npc, "legacy_button_bastra", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "legacy_button_bastra")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
if (branchId == 2 && legacy_button_bastra_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && legacy_button_bastra_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && legacy_button_bastra_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && legacy_button_bastra_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && legacy_button_bastra_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && legacy_button_bastra_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && legacy_button_bastra_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && legacy_button_bastra_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 20 && legacy_button_bastra_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.legacy_button_bastra.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|