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

582 lines
18 KiB
Plaintext

// ======================================================================
//
// talus_nashal_tika.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.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/talus_nashal_tika";
// ======================================================================
// Script Conditions
// ======================================================================
boolean talus_nashal_tika_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean talus_nashal_tika_condition_onGatherMissions (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "talus_nashal_find_weakness", "selonian_gather_missions");
}
// ----------------------------------------------------------------------
boolean talus_nashal_tika_condition_onExploit (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_obtain_password") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_smugglers_password") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_slice_computer") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_destroy_lifters") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_destroy_power") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_tika_comm") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_kill_guards") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_kill_elites") ||
groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_kill_leader"));
}
// ----------------------------------------------------------------------
boolean talus_nashal_tika_condition_onReturnTika (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "talus_nashal_exploit_weakness", "selonian_return_tika");
}
// ----------------------------------------------------------------------
boolean talus_nashal_tika_condition_completeExploit (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "talus_nashal_exploit_weakness");
}
// ======================================================================
// Script Actions
// ======================================================================
void talus_nashal_tika_action_grantExploit (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "talus_nashal_exploit_weakness");
}
// ----------------------------------------------------------------------
void talus_nashal_tika_action_signalCompleteExploit (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "selonian_return_tika");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int talus_nashal_tika_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Do not communicate with me unless you have completed your assignment in the smugglers' base.
//-- [RESPONSE NOTE]
//-- PLAYER: I have, Tika. Here is a complete recording of every step.
if (response == "s_26")
{
doAnimationAction (player, "paper");
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
//-- NPC: Kiki was correct. You are skilled and thorough. I understand that my request may have seemed drastic to you, but you have crippled these smugglers in such a way that their competitors will notice and take advantage, thus drawing attention away from my den.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You didn't say anything about killing all those guards before.
boolean hasResponse0 = false;
if (talus_nashal_tika_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_31");
utils.setScriptVar (player, "conversation.talus_nashal_tika.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_tika.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_tika_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Kiki was correct. You are skilled and thorough. I understand that my request may have seemed drastic to you, but you have crippled these smugglers in such a way that their competitors will notice and take advantage, thus drawing attention away from my den.
//-- [RESPONSE NOTE]
//-- PLAYER: You didn't say anything about killing all those guards before.
if (response == "s_31")
{
doAnimationAction (player, "bow2");
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rose");
doAnimationAction (player, "expect_tip");
talus_nashal_tika_action_signalCompleteExploit (player, npc);
//-- NPC: You are correct. It was an unfortunate necessity. I will increase your compensation due to the unexpected request. The den mother's advisor will want to know of your progress.
string_id message = new string_id (c_stringFile, "s_32");
utils.removeScriptVar (player, "conversation.talus_nashal_tika.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_tika_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am Tika of the Sileste sept. Kiki says you have surveyed the smugglers' base and are now returning to do more for our den.
//-- [RESPONSE NOTE]
//-- PLAYER: Yes. I figured, I'm going to be inside anyway.
if (response == "s_18")
{
doAnimationAction (player, "nod_head_once");
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "listen");
//-- NPC: Indeed. I prefer that you take direct action against these smugglers for their abuse of my den.
string_id message = new string_id (c_stringFile, "s_20");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Direct approach. What did you have in mind?
boolean hasResponse0 = false;
if (talus_nashal_tika_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_22");
utils.setScriptVar (player, "conversation.talus_nashal_tika.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_tika.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_tika_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Indeed. I prefer that you take direct action against these smugglers for their abuse of my den.
//-- [RESPONSE NOTE]
//-- PLAYER: Direct approach. What did you have in mind?
if (response == "s_22")
{
doAnimationAction (player, "rub_chin_thoughtful");
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "paper");
//-- NPC: The smugglers are highly dependent on droids. Search the smugglers by whatever means necessary until you find one who carries a password for their main computer. Once you have the password, access this computer and delete the backup behavioral matrices stored there. Once you have done this, there will be no difficulty destroying their droids.
string_id message = new string_id (c_stringFile, "s_24");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Password, main computer, matrices, destroy droids. Got it.
boolean hasResponse0 = false;
if (talus_nashal_tika_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.talus_nashal_tika.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_tika.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_tika_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The smugglers are highly dependent on droids. Search the smugglers by whatever means necessary until you find one who carries a password for their main computer. Once you have the password, access this computer and delete the backup behavioral matrices stored there. Once you have done this, there will be no difficulty destroying their droids.
//-- [RESPONSE NOTE]
//-- PLAYER: Password, main computer, matrices, destroy droids. Got it.
if (response == "s_30")
{
doAnimationAction (player, "nod_head_multiple");
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
talus_nashal_tika_action_grantExploit (player, npc);
//-- NPC: If you return, and return successful. I will compensate you generously for your efforts.
string_id message = new string_id (c_stringFile, "s_34");
utils.removeScriptVar (player, "conversation.talus_nashal_tika.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.talus_nashal_tika");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
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);
faceTo( self, player );
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.talus_nashal_tika");
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 (talus_nashal_tika_condition_completeExploit (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I communicated clearly that I would contact you when I had further work for you. I have not initiated such contact. Your aid was appreciated. 'Chit chat' is not.
string_id message = new string_id (c_stringFile, "s_7");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_tika_condition_onReturnTika (player, npc))
{
doAnimationAction (npc, "wave_finger_warning");
//-- NPC: Do not communicate with me unless you have completed your assignment in the smugglers' base.
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have, Tika. Here is a complete recording of every step.
boolean hasResponse0 = false;
if (talus_nashal_tika_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.talus_nashal_tika.branchId", 2);
npcStartConversation (player, npc, "talus_nashal_tika", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_tika_condition_onExploit (player, npc))
{
doAnimationAction (npc, "dismiss");
//-- NPC: Do not communicate with me unless the assignment in the smugglers' base has been completed.
string_id message = new string_id (c_stringFile, "s_14");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_tika_condition_onGatherMissions (player, npc))
{
doAnimationAction (npc, "greet");
//-- NPC: I am Tika of the Sileste sept. Kiki says you have surveyed the smugglers' base and are now returning to do more for our den.
string_id message = new string_id (c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes. I figured, I'm going to be inside anyway.
boolean hasResponse0 = false;
if (talus_nashal_tika_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_18");
utils.setScriptVar (player, "conversation.talus_nashal_tika.branchId", 6);
npcStartConversation (player, npc, "talus_nashal_tika", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_tika_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_finger_warning");
//-- NPC: My contact with outsiders must purposefully be limited. Unless you have specific business with me, which you do not, do not attempt to interact with me.
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 != "talus_nashal_tika")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.talus_nashal_tika.branchId");
if (branchId == 2 && talus_nashal_tika_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && talus_nashal_tika_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && talus_nashal_tika_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && talus_nashal_tika_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && talus_nashal_tika_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.talus_nashal_tika.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================