mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
770 lines
22 KiB
Plaintext
770 lines
22 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// npe_side3_questgiver.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.groundquests;
|
|
include library.npe;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/npe_side3_questgiver";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean npe_side3_questgiver_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_side3_questgiver_condition_playerOnQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "npe_side3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_side3_questgiver_condition_playerCompletedQuest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_side3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_side3_questgiver_condition_playerReadyForReward (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_side3", "reward_signal");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_side3_questgiver_condition_playerCompletedMainQuest (obj_id player, obj_id npc)
|
|
{
|
|
return (hasObjVar(player, "npe.finishedTemplate")&&
|
|
groundquests.hasCompletedQuest(player, "npe_marksman"));
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void npe_side3_questgiver_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_side3_questgiver_action_giveQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest(player, "npe_side3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_side3_questgiver_action_giveReward (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "npe_side3_reward");
|
|
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_side3_questgiver_action_giveLochePointer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
groundquests.requestGrantQuest(player, "npe_job_pointer_loche");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int npe_side3_questgiver_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Do you have an intact core yet?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Not yet. They are fragile.
|
|
if (response == "s_15")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: True. Be careful with them!
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. It wasn't easy to get, but here it is.
|
|
if (response == "s_16")
|
|
{
|
|
doAnimationAction (player, "feed_creature_medium");
|
|
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_side3_questgiver_action_giveReward (player, npc);
|
|
|
|
//-- NPC: Wonderful! I'll get to work on it right away. I want to find out who is trying to destroy the station.
|
|
string_id message = new string_id (c_stringFile, "s_17");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Other than the Hutts?
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_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_19");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Wonderful! I'll get to work on it right away. I want to find out who is trying to destroy the station.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Other than the Hutts?
|
|
if (response == "s_19")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That's the obvious answer, isn't it? But I'm not convinced that they are the only suspects. Someone else could be using their attack as a cover.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll keep my eyes open.
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_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_55");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That's the obvious answer, isn't it? But I'm not convinced that they are the only suspects. Someone else could be using their attack as a cover.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll keep my eyes open.
|
|
if (response == "s_55")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Thanks.
|
|
string_id message = new string_id (c_stringFile, "s_56");
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You brought those droid memory modules in, right?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. Is there a problem?
|
|
if (response == "s_25")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yes. The modules showed that there was some kind of sabotage to them, but the saboteur covered his (or her) tracks pretty well. I'm going to need an intact central processing core.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I get an intact core?
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_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_29");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, but I can't talk right now.
|
|
if (response == "s_48")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ok. I'll find someone else to help me with my work.
|
|
string_id message = new string_id (c_stringFile, "s_50");
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes. The modules showed that there was some kind of sabotage to them, but the saboteur covered his (or her) tracks pretty well. I'm going to need an intact central processing core.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I get an intact core?
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You are going to have to disable one of the droids and then check the core. It won't be easy, I'm sorry to say.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How will I know if I have an intact core?
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_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_33");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You are going to have to disable one of the droids and then check the core. It won't be easy, I'm sorry to say.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How will I know if I have an intact core?
|
|
if (response == "s_33")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'll adjust your datapad to scan for one when one of the droids ceases to function. Once you get a core, bring it back to me.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok! I'll come back with the core.
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks. Those droids are scary!
|
|
boolean hasResponse1 = false;
|
|
if (npe_side3_questgiver_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_43");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_side3_questgiver_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'll adjust your datapad to scan for one when one of the droids ceases to function. Once you get a core, bring it back to me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok! I'll come back with the core.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_side3_questgiver_action_giveQuest (player, npc);
|
|
|
|
//-- NPC: Thank you! I'll be here.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks. Those droids are scary!
|
|
if (response == "s_53")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You won't get far in this galaxy if fear guides your actions.
|
|
string_id message = new string_id (c_stringFile, "s_54");
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.npe_side3_questgiver");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
//setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Droid Engineer");
|
|
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, "Droid Engineer");
|
|
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.npe_side3_questgiver");
|
|
|
|
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 (npe_side3_questgiver_condition_playerCompletedQuest (player, npc))
|
|
{
|
|
npe_side3_questgiver_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Talk to Loche. I think he is also pursuing the possible sabotage.
|
|
string_id message = new string_id (c_stringFile, "s_21");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition_playerOnQuest (player, npc))
|
|
{
|
|
npe_side3_questgiver_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Do you have an intact core yet?
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Not yet. They are fragile.
|
|
boolean hasResponse0 = false;
|
|
if (!npe_side3_questgiver_condition_playerReadyForReward (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes. It wasn't easy to get, but here it is.
|
|
boolean hasResponse1 = false;
|
|
if (npe_side3_questgiver_condition_playerReadyForReward (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_15");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_16");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "npe_side3_questgiver", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition_playerCompletedMainQuest (player, npc))
|
|
{
|
|
doAnimationAction (npc, "poke");
|
|
|
|
npe_side3_questgiver_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You brought those droid memory modules in, right?
|
|
string_id message = new string_id (c_stringFile, "s_23");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. Is there a problem?
|
|
boolean hasResponse0 = false;
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, but I can't talk right now.
|
|
boolean hasResponse1 = false;
|
|
if (npe_side3_questgiver_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_25");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_48");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_side3_questgiver.branchId", 7);
|
|
|
|
npcStartConversation (player, npc, "npe_side3_questgiver", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_side3_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_side3_questgiver_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I am a little busy right now. Loche may have something that you can do.
|
|
string_id message = new string_id (c_stringFile, "s_52");
|
|
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 != "npe_side3_questgiver")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
if (branchId == 2 && npe_side3_questgiver_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && npe_side3_questgiver_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && npe_side3_questgiver_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && npe_side3_questgiver_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && npe_side3_questgiver_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && npe_side3_questgiver_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && npe_side3_questgiver_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.npe_side3_questgiver.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|