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

515 lines
15 KiB
Plaintext

// ======================================================================
//
// talus_nashal_smuggler.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_smuggler";
// ======================================================================
// Script Conditions
// ======================================================================
boolean talus_nashal_smuggler_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean talus_nashal_smuggler_condition_onTalkSmuggler (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_talk_smuggler");
}
// ----------------------------------------------------------------------
boolean talus_nashal_smuggler_condition_onPostTalk (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_cargo_computer") ||
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_search_cargo_database") ||
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_return_lika"));
}
// ----------------------------------------------------------------------
boolean talus_nashal_smuggler_condition_completeGather (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "talus_nashal_gather_missing");
}
// ======================================================================
// Script Actions
// ======================================================================
void talus_nashal_smuggler_action_signalTalkSmuggler (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "selonian_talk_smuggler");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int talus_nashal_smuggler_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You're helping those Selonians, aren't you?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, I am.
if (response == "s_8")
{
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
//-- NPC: I thought so. I don't agree with what our leader is doing to the Selonians. I think we can make a fine profit without having to exploit them.
string_id message = new string_id (c_stringFile, "s_10");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am looking for some Selonian prisoners, maybe you could help me?
boolean hasResponse0 = false;
if (talus_nashal_smuggler_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_12");
utils.setScriptVar (player, "conversation.talus_nashal_smuggler.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_smuggler_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I thought so. I don't agree with what our leader is doing to the Selonians. I think we can make a fine profit without having to exploit them.
//-- [RESPONSE NOTE]
//-- PLAYER: I am looking for some Selonian prisoners, maybe you could help me?
if (response == "s_12")
{
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
//-- NPC: Sure, you can check the cargo manifest database for their storage location. Here, use this password to gain access to the database.
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks.
boolean hasResponse0 = false;
if (talus_nashal_smuggler_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_smuggler.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_smuggler_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Sure, you can check the cargo manifest database for their storage location. Here, use this password to gain access to the database.
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks.
if (response == "s_18")
{
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
//-- NPC: That's not all. I know there is a traitor in the Selonian den. It's how our leader manipulates the Selonians. Tell the den mother that the Askura deal was fake. She will know what to do.
string_id message = new string_id (c_stringFile, "s_20");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I don't know what that means.
boolean hasResponse0 = false;
if (talus_nashal_smuggler_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_smuggler.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_smuggler_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That's not all. I know there is a traitor in the Selonian den. It's how our leader manipulates the Selonians. Tell the den mother that the Askura deal was fake. She will know what to do.
//-- [RESPONSE NOTE]
//-- PLAYER: I don't know what that means.
if (response == "s_22")
{
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
//-- NPC: Just tell the den mother. She will know what it means.
string_id message = new string_id (c_stringFile, "s_24");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Are you going to be ok here?
boolean hasResponse0 = false;
if (talus_nashal_smuggler_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_smuggler.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.talus_nashal_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int talus_nashal_smuggler_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Just tell the den mother. She will know what it means.
//-- [RESPONSE NOTE]
//-- PLAYER: Are you going to be ok here?
if (response == "s_26")
{
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
talus_nashal_smuggler_action_signalTalkSmuggler (player, npc);
//-- NPC: No, which is why I'll be taking off at the first opportunity. The shuttle sitting on the landing pad will make an excellent ticket to a new life.
string_id message = new string_id (c_stringFile, "s_28");
utils.removeScriptVar (player, "conversation.talus_nashal_smuggler.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_smuggler");
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_smuggler");
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_smuggler_condition_completeGather (player, npc))
{
//-- NPC: I'll leave when I get the codes to that shuttle.
string_id message = new string_id (c_stringFile, "s_16");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_smuggler_condition_onPostTalk (player, npc))
{
//-- NPC: Get out of here! I've told you all I know.
string_id message = new string_id (c_stringFile, "s_15");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_smuggler_condition_onTalkSmuggler (player, npc))
{
//-- NPC: You're helping those Selonians, aren't you?
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, I am.
boolean hasResponse0 = false;
if (talus_nashal_smuggler_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_8");
utils.setScriptVar (player, "conversation.talus_nashal_smuggler.branchId", 3);
npcStartConversation (player, npc, "talus_nashal_smuggler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (talus_nashal_smuggler_condition__defaultCondition (player, npc))
{
//-- NPC: You better leave. The guards around here shoot first and never ask questions.
string_id message = new string_id (c_stringFile, "s_30");
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_smuggler")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.talus_nashal_smuggler.branchId");
if (branchId == 3 && talus_nashal_smuggler_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && talus_nashal_smuggler_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && talus_nashal_smuggler_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && talus_nashal_smuggler_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && talus_nashal_smuggler_handleBranch7 (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_smuggler.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================