mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-06 22:12:58 -04:00
732 lines
21 KiB
Plaintext
732 lines
21 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// npe_imperial_questgiver.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// 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.skill;
|
|
include library.space_quest;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/npe_imperial_questgiver";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean npe_imperial_questgiver_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_imperial_questgiver_condition_ImpQuestActive (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "npe_imperial_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_imperial_questgiver_condition_ImpQuestComplete (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_imperial_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_imperial_questgiver_condition_RebQuestActiveorComplete (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "npe_rebel_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_imperial_questgiver_condition_onCorrectStep (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedTask(player, "npe_imperial_1", "getdata");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_imperial_questgiver_condition_hasTemplate (obj_id player, obj_id npc)
|
|
{
|
|
return hasObjVar(player, "npe.finishedTemplate");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void npe_imperial_questgiver_action_giveImperialQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest(player, "npe_imperial_1");
|
|
npe.giveStationWaypoint(player);
|
|
if(!hasObjVar(player, npe.QUEST_REWORK_VAR))
|
|
setObjVar(player, npe.QUEST_REWORK_VAR, npe.QUEST_ENUMERATION);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_imperial_questgiver_action_faceplayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_imperial_questgiver_action_completeImperialQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "npe_imperial_1_complete");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_imperial_questgiver_action_groupPopUp (obj_id player, obj_id npc)
|
|
{
|
|
messageTo(player, "groupPopUp1", null, 0, false);
|
|
messageTo(player, "groupPopUp2", null, 5, false);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int npe_imperial_questgiver_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Welcome back, %NU. Do you have what I asked for?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes. I have it right here.
|
|
if (response == "s_31")
|
|
{
|
|
doAnimationAction (player, "feed_creature_medium");
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
//-- NPC: Very good. I will study the information and find out how they locked our communications. They will pay dearly for this. You may yet be a great asset to the Empire.
|
|
string_id message = new string_id (c_stringFile, "s_33");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you.
|
|
boolean hasResponse0 = false;
|
|
if (npe_imperial_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_34");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_imperial_questgiver.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't have it yet.
|
|
if (response == "s_32")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "shoo");
|
|
|
|
//-- NPC: Then stop bothering me.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_imperial_questgiver_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Very good. I will study the information and find out how they locked our communications. They will pay dearly for this. You may yet be a great asset to the Empire.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you.
|
|
if (response == "s_34")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "wave_on_dismissing");
|
|
|
|
npe_imperial_questgiver_action_completeImperialQuest (player, npc);
|
|
|
|
//-- NPC: Now move along and let me work. I have some days to ruin.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_imperial_questgiver_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes? Is there something I can help you with?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Are you an Imperial Officer?
|
|
if (response == "s_15")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "laugh");
|
|
|
|
//-- NPC: Not enough of a disguise? No matter. You are a loyal citizen of the Empire, are you not? My senior officer, Captain Thrawn, has a mission of the utmost importance.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I would be happy to serve the Empire.
|
|
boolean hasResponse0 = false;
|
|
if (!npe_imperial_questgiver_condition_RebQuestActiveorComplete (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm...uh...in the middle of something right now. Sorry.
|
|
boolean hasResponse1 = false;
|
|
if (npe_imperial_questgiver_condition_RebQuestActiveorComplete (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to help, but I'm too busy right now.
|
|
boolean hasResponse2 = false;
|
|
if (npe_imperial_questgiver_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_20");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_28");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_imperial_questgiver.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nothing, just admiring your uniform.
|
|
if (response == "s_43")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "check_wrist_device");
|
|
|
|
//-- NPC: Thank you, but please admire it from elsewhere.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_imperial_questgiver_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Not enough of a disguise? No matter. You are a loyal citizen of the Empire, are you not? My senior officer, Captain Thrawn, has a mission of the utmost importance.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I would be happy to serve the Empire.
|
|
if (response == "s_20")
|
|
{
|
|
doAnimationAction (player, "salute1");
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
//-- NPC: Very good. We have an 'arrangement' with the Rak'qua on Station Gamma which seems to have gone sour. They put a lock on our communication system, which prevents us from communicating with our main fleet. Go there and extract the lockout information from one of their databanks with the code that I'll give you.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll go there now.
|
|
boolean hasResponse0 = false;
|
|
if (npe_imperial_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_24");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_imperial_questgiver.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm...uh...in the middle of something right now. Sorry.
|
|
if (response == "s_28")
|
|
{
|
|
doAnimationAction (player, "shake_head_no");
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "rub_chin_thoughtful");
|
|
|
|
//-- NPC: I see. Not as loyal as I thought you were.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to help, but I'm too busy right now.
|
|
if (response == "s_39")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "huh");
|
|
|
|
//-- NPC: Too busy to serve the Empire? I'm surprised, citizen.
|
|
string_id message = new string_id (c_stringFile, "s_41");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_imperial_questgiver_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Very good. We have an 'arrangement' with the Rak'qua on Station Gamma which seems to have gone sour. They put a lock on our communication system, which prevents us from communicating with our main fleet. Go there and extract the lockout information from one of their databanks with the code that I'll give you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll go there now.
|
|
if (response == "s_24")
|
|
{
|
|
npe_imperial_questgiver_action_groupPopUp (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_imperial_questgiver_action_giveImperialQuest (player, npc);
|
|
|
|
//-- NPC: Good. You can reach the station in a starship. If you don't have one, Serissu can help you.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.npe_imperial_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_imperial_questgiver");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
//setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Agent Falrey");
|
|
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, "Agent Falrey");
|
|
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_imperial_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_imperial_questgiver_condition_ImpQuestComplete (player, npc))
|
|
{
|
|
doAnimationAction (npc, "salute1");
|
|
|
|
npe_imperial_questgiver_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: I hope to see good things from you, %NU.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition_ImpQuestActive (player, npc))
|
|
{
|
|
doAnimationAction (npc, "greet");
|
|
|
|
npe_imperial_questgiver_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Welcome back, %NU. Do you have what I asked for?
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes. I have it right here.
|
|
boolean hasResponse0 = false;
|
|
if (npe_imperial_questgiver_condition_onCorrectStep (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't have it yet.
|
|
boolean hasResponse1 = false;
|
|
if (!npe_imperial_questgiver_condition_onCorrectStep (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_31");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_32");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_imperial_questgiver.branchId", 2);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "npe_imperial_questgiver", null, pp, responses);
|
|
}
|
|
else
|
|
{
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
chat.chat (npc, player, null, null, pp);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition_hasTemplate (player, npc))
|
|
{
|
|
doAnimationAction (npc, "greet");
|
|
|
|
npe_imperial_questgiver_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Yes? Is there something I can help you with?
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Are you an Imperial Officer?
|
|
boolean hasResponse0 = false;
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Nothing, just admiring your uniform.
|
|
boolean hasResponse1 = false;
|
|
if (npe_imperial_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_15");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_43");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_imperial_questgiver.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "npe_imperial_questgiver", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_imperial_questgiver_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "greet");
|
|
|
|
npe_imperial_questgiver_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: I need a skilled operative. When you are done training, I may have work for you.
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
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_imperial_questgiver")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.npe_imperial_questgiver.branchId");
|
|
|
|
if (branchId == 2 && npe_imperial_questgiver_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && npe_imperial_questgiver_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && npe_imperial_questgiver_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && npe_imperial_questgiver_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && npe_imperial_questgiver_handleBranch8 (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_imperial_questgiver.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|