mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
484 lines
14 KiB
Plaintext
484 lines
14 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// talus_nashal_lika.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_lika";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean talus_nashal_lika_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean talus_nashal_lika_condition_completeGather (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "talus_nashal_gather_missing");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean talus_nashal_lika_condition_onGather (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_check_supply_bldg") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_check_landing_pad") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_slice_flight_term") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_flight_plan_entry") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_check_quarters") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_talk_smuggler") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_cargo_computer") ||
|
|
groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_search_cargo_database"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean talus_nashal_lika_condition_onGatherMissions (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "talus_nashal_find_weakness", "selonian_gather_missions");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean talus_nashal_lika_condition_onReturnLika (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "talus_nashal_gather_missing", "selonian_return_lika");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void talus_nashal_lika_action_grantGather (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "talus_nashal_gather_missing");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void talus_nashal_lika_action_signalCompleteGather (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "selonian_return_lika");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int talus_nashal_lika_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You have performed your tasks well.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you.
|
|
if (response == "s_13")
|
|
{
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition__defaultCondition (player, npc))
|
|
{
|
|
talus_nashal_lika_action_signalCompleteGather (player, npc);
|
|
|
|
//-- NPC: Please speak to Kiki about the successful resolution of the tasks I have asked of you.
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
utils.removeScriptVar (player, "conversation.talus_nashal_lika.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int talus_nashal_lika_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You have not performed the task I have requested, have you?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No.
|
|
if (response == "s_11")
|
|
{
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Please resume your efforts, else we have nothing to discuss.
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
utils.removeScriptVar (player, "conversation.talus_nashal_lika.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int talus_nashal_lika_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The other have you involved in tasks that they think will help us against the smugglers. The most important way we can escape their control, however is to get our den mates back.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: They have abducted some of your people?
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Correct. The other tasks will help us, but return of our people is paramount. Could you please inspect the smuggler base and look for our den mates?
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sure, I can do that.
|
|
boolean hasResponse0 = false;
|
|
if (talus_nashal_lika_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.talus_nashal_lika.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.talus_nashal_lika.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int talus_nashal_lika_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Correct. The other tasks will help us, but return of our people is paramount. Could you please inspect the smuggler base and look for our den mates?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure, I can do that.
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition__defaultCondition (player, npc))
|
|
{
|
|
talus_nashal_lika_action_grantGather (player, npc);
|
|
|
|
//-- NPC: Thank you. Here are the locations of the buildings I wish you to inspect.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.talus_nashal_lika.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_lika");
|
|
|
|
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_lika");
|
|
|
|
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_lika_condition_completeGather (player, npc))
|
|
{
|
|
//-- NPC: You are a friend to the den and always welcome here.
|
|
string_id message = new string_id (c_stringFile, "s_15");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition_onReturnLika (player, npc))
|
|
{
|
|
//-- NPC: You have performed your tasks well.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you.
|
|
boolean hasResponse0 = false;
|
|
if (talus_nashal_lika_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_13");
|
|
|
|
utils.setScriptVar (player, "conversation.talus_nashal_lika.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "talus_nashal_lika", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition_onGather (player, npc))
|
|
{
|
|
//-- NPC: You have not performed the task I have requested, have you?
|
|
string_id message = new string_id (c_stringFile, "s_9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No.
|
|
boolean hasResponse0 = false;
|
|
if (talus_nashal_lika_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_11");
|
|
|
|
utils.setScriptVar (player, "conversation.talus_nashal_lika.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "talus_nashal_lika", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition_onGatherMissions (player, npc))
|
|
{
|
|
//-- NPC: The other have you involved in tasks that they think will help us against the smugglers. The most important way we can escape their control, however is to get our den mates back.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: They have abducted some of your people?
|
|
boolean hasResponse0 = false;
|
|
if (talus_nashal_lika_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_20");
|
|
|
|
utils.setScriptVar (player, "conversation.talus_nashal_lika.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "talus_nashal_lika", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (talus_nashal_lika_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You have no business with us, outsider.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
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_lika")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.talus_nashal_lika.branchId");
|
|
|
|
if (branchId == 2 && talus_nashal_lika_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && talus_nashal_lika_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && talus_nashal_lika_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && talus_nashal_lika_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_lika.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|