Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/npe_officer.script
T

1407 lines
42 KiB
Plaintext

// ======================================================================
//
// npe_officer.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.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/npe_officer";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_officer_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_wantsOff (obj_id player, obj_id npc)
{
return npe_officer_condition_isOffTemplate(player, npc);
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_busy (obj_id player, obj_id npc)
{
return ( groundquests.isQuestActive(player, "npe_new_artisan_quest")||
groundquests.isQuestActive(player, "npe_brawler_1hand")||
groundquests.isQuestActive(player, "npe_brawler_2hand")||
groundquests.isQuestActive(player, "npe_brawler_polearm")||
groundquests.isQuestActive(player, "npe_brawler_unarmed")||
groundquests.isQuestActive(player, "npe_scout_1")||
groundquests.isQuestActive(player, "npe_entertainer_1")||
groundquests.isQuestActive(player, "npe_marksman_carbine")||
groundquests.isQuestActive(player, "npe_marksman_pistol")||
groundquests.isQuestActive(player, "npe_marksman_rifle")||
groundquests.isQuestActive(player, "npe_medic")||
space_quest.hasQuest( player, "patrol", "npe_training_1" )||
space_quest.hasQuest( player, "patrol", "npe_training_2" )||
space_quest.hasQuest( player, "escort", "npe_training_3" ));
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_completedFirstQuest (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_officer_try") &&
!groundquests.hasCompletedQuest(player, "npe_officer_try_2"));
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_quest2Active (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "npe_officer_try_2");
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_isActiveOffQuest (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_officer_try", "basicTraining") ||
groundquests.isTaskActive(player, "npe_officer_try", "freeNeina") ||
groundquests.isTaskActive(player, "npe_officer_try", "hunt") ||
groundquests.isTaskActive(player, "npe_officer_try", "returnRak") ||
groundquests.isTaskActive(player, "npe_officer_try", "goAway") ||
groundquests.isTaskActive(player, "npe_officer_try_2", "gammaTravel") ||
groundquests.isTaskActive(player, "npe_officer_try_2", "findFiles") ||
groundquests.isTaskActive(player, "npe_officer_try_2", "findRak") ||
groundquests.isTaskActive(player, "npe_officer_try_2", "accessDungeonTerminal"));
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_finishedOffTask (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try", "returnAntom");
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_isOffTemplate (obj_id player, obj_id npc)
{
return utils.isProfession(player, utils.OFFICER);
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_completedQuest2 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_officer_try_2", "returnFiles");
}
// ----------------------------------------------------------------------
boolean npe_officer_condition_completedAllQuests (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_officer_try_2");
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_officer_action_giveOffQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_officer_try");
if(!hasObjVar(player, npe.QUEST_REWORK_VAR))
setObjVar(player, npe.QUEST_REWORK_VAR, npe.QUEST_ENUMERATION);
}
// ----------------------------------------------------------------------
void npe_officer_action_finishQuest (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "returnedAntom");
}
// ----------------------------------------------------------------------
void npe_officer_action_grantPointer (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_pointer_officer_template");
}
// ----------------------------------------------------------------------
void npe_officer_action_grantQuest2 (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_officer_try_2");
groundquests.sendSignal(player, "found_officer");
if(!hasObjVar(player, npe.QUEST_REWORK_VAR))
setObjVar(player, npe.QUEST_REWORK_VAR, npe.QUEST_ENUMERATION);
}
// ----------------------------------------------------------------------
void npe_officer_action_foundOfficer (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "found_officer");
}
// ----------------------------------------------------------------------
void npe_officer_action_giveDoneSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "donedone");
groundquests.sendSignal(player, "found_officer");
}
// ----------------------------------------------------------------------
void npe_officer_action_giveAssistantPointer (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_job_pointer_han");
setObjVar(player, "npe.finishedTemplate", 1);
}
// ----------------------------------------------------------------------
void npe_officer_action_grantReward2 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "returnedFiles");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int npe_officer_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Fantastic work again %TU! With these files, I should be able to convince everyone here that the war is meaningless and bring the culprits to justice. I and everyone here on Tansarii is in your debt.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm just glad I could be of any help.
if (response == "s_36")
{
doAnimationAction (player, "shrug_hands");
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: So modest. You will have a long prosperous career ahead of you as an Officer %TU. I also have prepared a small gift as a token of our appreciation.
string_id message = new string_id (c_stringFile, "s_37");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That wasn't necessary but thank you.
boolean hasResponse0 = false;
if (npe_officer_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_38");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 5);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So modest. You will have a long prosperous career ahead of you as an Officer %TU. I also have prepared a small gift as a token of our appreciation.
//-- [RESPONSE NOTE]
//-- PLAYER: That wasn't necessary but thank you.
if (response == "s_38")
{
doAnimationAction (player, "bow");
npe_officer_action_grantReward2 (player, npc);
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
npe_officer_action_giveAssistantPointer (player, npc);
//-- NPC: Think nothing of it. It's been a pleasure working with you. I hope we will see more of each other. If you're looking to help some more people around here, maybe Han Solo has something he needs help with. The man has a knack for getting himself in to trouble.
string_id message = new string_id (c_stringFile, "s_39");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Good, you are back %TU. The conflict between the two stations is escalating quickly. Our luck may be turning though. A Bothan spy sold me some information which points to a local arms dealer being behind pitting our two stations against each other.
//-- [RESPONSE NOTE]
//-- PLAYER: How did he manage to do that?
if (response == "s_26")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: He's bribed several people on both stations to help escalate the conflict, hoping that it will turn in to a war from which he can profit. The Bothan spy believes there to be a computer terminal on Gamma with the necessary files to show who these instigators are and what they are planning to do.
string_id message = new string_id (c_stringFile, "s_27");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Good, let's end this. What will be my role?
boolean hasResponse0 = false;
if (npe_officer_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.npe_officer.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: He's bribed several people on both stations to help escalate the conflict, hoping that it will turn in to a war from which he can profit. The Bothan spy believes there to be a computer terminal on Gamma with the necessary files to show who these instigators are and what they are planning to do.
//-- [RESPONSE NOTE]
//-- PLAYER: Good, let's end this. What will be my role?
if (response == "s_28")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I need you to get to that terminal on Station Gamma, show those files to the Rak'qua Fervent and then bring them back to me so that I can calm down everyone on the station before we have a full scale war. Convince the Fervent that we will bring the masterminds behind this plot to justice and that we expect him to do the same.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will do my best.
boolean hasResponse0 = false;
if (npe_officer_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_30");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need you to get to that terminal on Station Gamma, show those files to the Rak'qua Fervent and then bring them back to me so that I can calm down everyone on the station before we have a full scale war. Convince the Fervent that we will bring the masterminds behind this plot to justice and that we expect him to do the same.
//-- [RESPONSE NOTE]
//-- PLAYER: I will do my best.
if (response == "s_30")
{
doAnimationAction (player, "salute1");
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute2");
npe_officer_action_grantQuest2 (player, npc);
//-- NPC: I know you will %TU and I have all the confidence that you will succeed.
string_id message = new string_id (c_stringFile, "s_31");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: As I expected, you exceeded my expectations %TU. My student is back in one piece and has learned a valuable lesson.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm glad I could assist.
if (response == "s_46")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: Not as glad as I am. If you find that you have time, I have another rather urgent task that could really use your attention. Please come back and see me if you find time to assist.
string_id message = new string_id (c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will be ready.
boolean hasResponse0 = false;
if (npe_officer_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_officer.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not as glad as I am. If you find that you have time, I have another rather urgent task that could really use your attention. Please come back and see me if you find time to assist.
//-- [RESPONSE NOTE]
//-- PLAYER: I will be ready.
if (response == "s_34")
{
doAnimationAction (player, "nod");
npe_officer_action_finishQuest (player, npc);
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
npe_officer_action_grantPointer (player, npc);
//-- NPC: I'm sure of it. I also see that you have learned a new skill, excellent. 'Sure Shot' will serve you well %TU, with its increased damage output.
string_id message = new string_id (c_stringFile, "s_35");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: %TU, any problems?
//-- [RESPONSE NOTE]
//-- PLAYER: None, just letting you know that I'm on my way to Gamma.
if (response == "s_129")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: Excellent, I anxiously await your return.
string_id message = new string_id (c_stringFile, "s_130");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: %TU! I was hoping that you would come and see me. I know that you are probably busy but we have a situation that we could really use your help with.
//-- [RESPONSE NOTE]
//-- PLAYER: I should have some time to spare. What is the problem?
if (response == "s_120")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Not far from the Tansarii Point Station which we are on, there's another outpost, called Gamma. On it live a tribe of xenomorphs called the Rak'qua. There haven't been any hostilities between our two stations, up until lately.
string_id message = new string_id (c_stringFile, "s_121");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What changed?
boolean hasResponse0 = false;
if (npe_officer_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_122");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 18);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not far from the Tansarii Point Station which we are on, there's another outpost, called Gamma. On it live a tribe of xenomorphs called the Rak'qua. There haven't been any hostilities between our two stations, up until lately.
//-- [RESPONSE NOTE]
//-- PLAYER: What changed?
if (response == "s_122")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: I am not sure what set off the troubles, but recently there has even been some violence by both sides. One of my students went over to Gamma to talk to a Rak'qua Fervent, one of their leaders. That was two days ago and we haven't heard from her yet. I fear that negotiating with the Rak'qua was beyond her.
string_id message = new string_id (c_stringFile, "s_123");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What would you have me do?
boolean hasResponse0 = false;
if (npe_officer_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_124");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 19);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am not sure what set off the troubles, but recently there has even been some violence by both sides. One of my students went over to Gamma to talk to a Rak'qua Fervent, one of their leaders. That was two days ago and we haven't heard from her yet. I fear that negotiating with the Rak'qua was beyond her.
//-- [RESPONSE NOTE]
//-- PLAYER: What would you have me do?
if (response == "s_124")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: It's my hope that you with your superior leadership skills, can talk to this Rak'qua Fervent and persuade him to release my young student, maybe even put an end to the hostilities between our two stations.
string_id message = new string_id (c_stringFile, "s_125");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll do my best. Station Gamma is in Ord Mantell Space?
boolean hasResponse0 = false;
if (npe_officer_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_126");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 20);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch20 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It's my hope that you with your superior leadership skills, can talk to this Rak'qua Fervent and persuade him to release my young student, maybe even put an end to the hostilities between our two stations.
//-- [RESPONSE NOTE]
//-- PLAYER: I'll do my best. Station Gamma is in Ord Mantell Space?
if (response == "s_126")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, not far from here at all. Go to Hangar Bay 1 and take the shuttle to Gamma there.
string_id message = new string_id (c_stringFile, "s_127");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Perfect, I will be on my way immediately.
boolean hasResponse0 = false;
if (npe_officer_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_133");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 21);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes, not far from here at all. Go to Hangar Bay 1 and take the shuttle to Gamma there.
//-- [RESPONSE NOTE]
//-- PLAYER: Perfect, I will be on my way immediately.
if (response == "s_133")
{
npe_officer_action_giveDoneSignal (player, npc);
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
npe_officer_action_giveOffQuest (player, npc);
//-- NPC: I'm in your debt %TU.
string_id message = new string_id (c_stringFile, "s_134");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_officer_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: %TT, how may I help?
//-- [RESPONSE NOTE]
//-- PLAYER: Just looking around. Sorry!
if (response == "s_80")
{
//-- [NOTE]
if (npe_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: Not a problem, always a pleasure. Take care!
string_id message = new string_id (c_stringFile, "s_82");
utils.removeScriptVar (player, "conversation.npe_officer.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_officer");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setName (self, "Antom Moria (Officer)");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setName (self, "Antom Moria (Officer)");
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_officer");
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_officer_condition_isOffTemplate (player, npc))
{
doAnimationAction (npc, "salute2");
//-- NPC: %TU! Too bad you're not an officer, you would have been a great one. Be safe!
string_id message = new string_id (c_stringFile, "s_69");
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_officer_condition_completedAllQuests (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: Great to see you again %TU. We are already seeing the repercussions of your work my friend. Peace negotiations have begun between the two stations and it looks like everything is going to be just fine after all. Everyone is in great debt to you.
string_id message = new string_id (c_stringFile, "s_59");
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_officer_condition_busy (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: It seems that you are busy, %TU. Return when you have your hands free.
string_id message = new string_id (c_stringFile, "s_42");
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_officer_condition_completedQuest2 (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: Fantastic work again %TU! With these files, I should be able to convince everyone here that the war is meaningless and bring the culprits to justice. I and everyone here on Tansarii is in your debt.
string_id message = new string_id (c_stringFile, "s_33");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm just glad I could be of any help.
boolean hasResponse0 = false;
if (npe_officer_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_36");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 4);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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_officer_condition_quest2Active (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: There isn't much time before the war gets started %TU, please hurry in finishing your task on Station Gamma.
string_id message = new string_id (c_stringFile, "s_32");
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_officer_condition_completedFirstQuest (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: Good, you are back %TU. The conflict between the two stations is escalating quickly. Our luck may be turning though. A Bothan spy sold me some information which points to a local arms dealer being behind pitting our two stations against each other.
string_id message = new string_id (c_stringFile, "s_49");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How did he manage to do that?
boolean hasResponse0 = false;
if (npe_officer_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_26");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 8);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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_officer_condition_finishedOffTask (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: As I expected, you exceeded my expectations %TU. My student is back in one piece and has learned a valuable lesson.
string_id message = new string_id (c_stringFile, "s_44");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm glad I could assist.
boolean hasResponse0 = false;
if (npe_officer_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_46");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 12);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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_officer_condition_isActiveOffQuest (player, npc))
{
doAnimationAction (npc, "salute2");
doAnimationAction (player, "salute1");
//-- NPC: %TU, any problems?
string_id message = new string_id (c_stringFile, "s_128");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: None, just letting you know that I'm on my way to Gamma.
boolean hasResponse0 = false;
if (npe_officer_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_129");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 15);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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_officer_condition_wantsOff (player, npc))
{
doAnimationAction (npc, "salute2");
//-- NPC: %TU! I was hoping that you would come and see me. I know that you are probably busy but we have a situation that we could really use your help with.
string_id message = new string_id (c_stringFile, "s_119");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I should have some time to spare. What is the problem?
boolean hasResponse0 = false;
if (npe_officer_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_120");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 17);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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_officer_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "bow");
//-- NPC: %TT, how may I help?
string_id message = new string_id (c_stringFile, "s_78");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just looking around. Sorry!
boolean hasResponse0 = false;
if (npe_officer_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_80");
utils.setScriptVar (player, "conversation.npe_officer.branchId", 23);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_officer", 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;
}
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_officer")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_officer.branchId");
if (branchId == 4 && npe_officer_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && npe_officer_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && npe_officer_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && npe_officer_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && npe_officer_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && npe_officer_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && npe_officer_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && npe_officer_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && npe_officer_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && npe_officer_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && npe_officer_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 20 && npe_officer_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && npe_officer_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && npe_officer_handleBranch23 (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_officer.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================