mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
307 lines
9.4 KiB
Plaintext
307 lines
9.4 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// quest_u10_c3p0.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.conversation;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/quest_u10_c3p0";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean quest_u10_c3p0_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean quest_u10_c3p0_condition_quest_u10_01_side_02_active (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "quest_u10_01_side", "quest_u10_01_side_02");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean quest_u10_c3p0_condition_quest_u10_01_side_complete (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "quest_u10_01_side");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean quest_u10_c3p0_condition_quest_u10_01_side_active (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "quest_u10_01_side");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void quest_u10_c3p0_action_quest_u10_01_side_grant (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest(player, "quest_u10_01_side");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void quest_u10_c3p0_action_quest_u10_01_side_signal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "quest_u10_01_side_02");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int quest_u10_c3p0_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Good day. I say, you look somewhat familiar...did we perhaps meet near Ord Mantell? On board Tansarii Point Station? Regardless, I wonder if I might convince you to lend us some assistance?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How can I help?
|
|
if (response == "s_40")
|
|
{
|
|
//-- [NOTE]
|
|
if (quest_u10_c3p0_condition__defaultCondition (player, npc))
|
|
{
|
|
quest_u10_c3p0_action_quest_u10_01_side_grant (player, npc);
|
|
|
|
//-- NPC: So much has been said about the resilience of helper droids that we decided to see for ourselves. They never deviate from their assigned tasks. We believe it has something to do with their interface units. Please find us some of these interface units so that we can analyze them further.
|
|
string_id message = new string_id (c_stringFile, "s_41");
|
|
utils.removeScriptVar (player, "conversation.quest_u10_c3p0.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You're on your own, droids.
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (quest_u10_c3p0_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ah, I see. Perhaps it's for the best then. Good day to you.
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
utils.removeScriptVar (player, "conversation.quest_u10_c3p0.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.quest_u10_c3p0");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
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.quest_u10_c3p0");
|
|
|
|
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 (quest_u10_c3p0_condition_quest_u10_01_side_complete (player, npc))
|
|
{
|
|
//-- NPC: I simply cannot wait another minute. We must be going soon, R2. Those helper droids, quite frankly, send a shiver down my circuits.
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (quest_u10_c3p0_condition_quest_u10_01_side_02_active (player, npc))
|
|
{
|
|
quest_u10_c3p0_action_quest_u10_01_side_signal (player, npc);
|
|
|
|
//-- NPC: Well done! These will do nicely.
|
|
string_id message = new string_id (c_stringFile, "s_37");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (quest_u10_c3p0_condition_quest_u10_01_side_active (player, npc))
|
|
{
|
|
//-- NPC: Have you had any luck finding some helper droid interface units?
|
|
string_id message = new string_id (c_stringFile, "s_6");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (quest_u10_c3p0_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good day. I say, you look somewhat familiar...did we perhaps meet near Ord Mantell? On board Tansarii Point Station? Regardless, I wonder if I might convince you to lend us some assistance?
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How can I help?
|
|
boolean hasResponse0 = false;
|
|
if (quest_u10_c3p0_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: You're on your own, droids.
|
|
boolean hasResponse1 = false;
|
|
if (quest_u10_c3p0_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_40");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
utils.setScriptVar (player, "conversation.quest_u10_c3p0.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "quest_u10_c3p0", message, responses);
|
|
}
|
|
else
|
|
{
|
|
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 != "quest_u10_c3p0")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.quest_u10_c3p0.branchId");
|
|
|
|
if (branchId == 4 && quest_u10_c3p0_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.quest_u10_c3p0.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|