mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
1055 lines
31 KiB
Plaintext
1055 lines
31 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// slicer_02_lok.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.prose;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/slicer_02_lok";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean slicer_02_lok_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_isGoingToDungeon (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.isTaskActive(player, "quest_06_conspire_cale", "GoToLabratory");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_isGoingToDathomir (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.isTaskActive(player, "quest_08_dathomir_outpost", "travelDathomir");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_isReadyForDungeon (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.isTaskActive(player, "quest_06_conspire_cale", "TravelToLokOutpost");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_hasCompletedlokDungeon (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.isTaskActive(player, "quest_07_descend_into_labratory", "TakeDataPadCale");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_canceledQuest06 (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return !groundquests.isQuestActiveOrComplete(player, "quest_06_conspire_cale")
|
|
&& (groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_failed_assassin")
|
|
|| groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_success_assassin"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_canceledQuest07 (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.hasCompletedQuest(player, "quest_06_conspire_cale")
|
|
&& !groundquests.isQuestActiveOrComplete(player, "quest_07_descend_into_labratory");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean slicer_02_lok_condition_canceledQuest08 (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
return groundquests.hasCompletedQuest(player, "quest_07_descend_into_labratory")
|
|
&& !groundquests.isQuestActiveOrComplete(player, "quest_08_dathomir_outpost_final");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void slicer_02_lok_action_sendSignalLokDungeon (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
groundquests.sendSignal(player, "TravelToLokOutpostComplete");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void slicer_02_lok_action_grantQuest07WithWaypoint (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
groundquests.grantQuest(player, "quest_07_descend_into_labratory");
|
|
slicer_02_lok_action_giveDungeonWaypoint(player,npc);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void slicer_02_lok_action_sendDathomirSignal (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
groundquests.sendSignal(player, "TookDataPadCale");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void slicer_02_lok_action_giveDungeonWaypoint (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
location loc = new location(-415, 92, 7608, "lok");
|
|
obj_id maraWpt = createWaypointInDatapad(player, loc);
|
|
setWaypointName(maraWpt, "Secret Laboratory");
|
|
setWaypointActive(maraWpt, true);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void slicer_02_lok_action_giveQuest08 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "quest_08_dathomir_outpost_final");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int slicer_02_lok_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I've fully decrypted the data on Derg's disk. Looks like Derg built a remote laboratory here on Lok and was about to conduct some research.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What type of research?
|
|
if (response == "s_131")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Some sort of super soldier experiments.
|
|
string_id message = new string_id (c_stringFile, "s_135");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Oh wow. Bib Fortuna had mentioned this.
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_136");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Some sort of super soldier experiments.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Oh wow. Bib Fortuna had mentioned this.
|
|
if (response == "s_136")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Apparently that lab assistant, Bera Jeza, had loose lips and tried to sell the drug, or whatever it is, to Jabba and possibly other sources.
|
|
string_id message = new string_id (c_stringFile, "s_137");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I see.
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_138");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Apparently that lab assistant, Bera Jeza, had loose lips and tried to sell the drug, or whatever it is, to Jabba and possibly other sources.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I see.
|
|
if (response == "s_138")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: There is a twist. Apparently there is another un-named scientist that provided the super soldier drug to Derg. Derg didn't create this thing.
|
|
string_id message = new string_id (c_stringFile, "s_139");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So, why did Derg contact you?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_140");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: There is a twist. Apparently there is another un-named scientist that provided the super soldier drug to Derg. Derg didn't create this thing.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So, why did Derg contact you?
|
|
if (response == "s_140")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Derg didn't know who to trust so he thought of me. We go back a few years. He wanted me to get to the laboratory and evacuate his staff and destroy evidence before assassin teams arrived.
|
|
string_id message = new string_id (c_stringFile, "s_141");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Assassin teams?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_142");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Derg didn't know who to trust so he thought of me. We go back a few years. He wanted me to get to the laboratory and evacuate his staff and destroy evidence before assassin teams arrived.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Assassin teams?
|
|
if (response == "s_142")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Relax, I've done a scan of the area. There isn't anything larger than a Womp Rat alive. I'm pretty sure that everyone has been evacuated, but you are going to make sure.
|
|
string_id message = new string_id (c_stringFile, "s_143");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Me? Why not both of us?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_144");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Relax, I've done a scan of the area. There isn't anything larger than a Womp Rat alive. I'm pretty sure that everyone has been evacuated, but you are going to make sure.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Me? Why not both of us?
|
|
if (response == "s_144")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I have all the equipment here to monitor the location remotely. If someone comes within 1000 meters I'll be the early warning system.
|
|
string_id message = new string_id (c_stringFile, "s_145");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: If the place is evacuated, why go?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_146");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I have all the equipment here to monitor the location remotely. If someone comes within 1000 meters I'll be the early warning system.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: If the place is evacuated, why go?
|
|
if (response == "s_146")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'd like to get my hands on any clues left behind. We'll split everything 50/50. Sound good?
|
|
string_id message = new string_id (c_stringFile, "s_147");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I guess...
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_148");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'd like to get my hands on any clues left behind. We'll split everything 50/50. Sound good?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I guess...
|
|
if (response == "s_148")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
slicer_02_lok_action_sendSignalLokDungeon (player, npc);
|
|
|
|
//-- NPC: Alright, see you soon.
|
|
string_id message = new string_id (c_stringFile, "s_149");
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Wow this science datapad will be a challenge to decipher. Too bad I don't know any living biologists to help me out.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm fine, thanks for asking.
|
|
if (response == "s_150")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Of course you are fine, you're the hero. I'm just the guy that gets to spend the next several months of his life figuring out what a....'genome' or a 'compound bond' is. You have it easy, trust me.
|
|
string_id message = new string_id (c_stringFile, "s_151");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So what's next then?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_152");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Of course you are fine, you're the hero. I'm just the guy that gets to spend the next several months of his life figuring out what a....'genome' or a 'compound bond' is. You have it easy, trust me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So what's next then?
|
|
if (response == "s_152")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We have a new lead.
|
|
string_id message = new string_id (c_stringFile, "s_155");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Let me guess. I have to infiltrate the Nightsister Stronghold and return with the clan mother's mustache.
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_156");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We have a new lead.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Let me guess. I have to infiltrate the Nightsister Stronghold and return with the clan mother's mustache.
|
|
if (response == "s_156")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Uh, no. But you have the planet correct. While I was slicing the satellites around Lok I intercepted a lot of communication traffic from Dathomir. One of communications came from a 'missing' biologist. On top of that, the area where the communications are coming from seems to have built its own starport and facilities so I am curious what is going on.
|
|
string_id message = new string_id (c_stringFile, "s_157");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So go to Dathomir?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_158");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int slicer_02_lok_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Uh, no. But you have the planet correct. While I was slicing the satellites around Lok I intercepted a lot of communication traffic from Dathomir. One of communications came from a 'missing' biologist. On top of that, the area where the communications are coming from seems to have built its own starport and facilities so I am curious what is going on.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So go to Dathomir?
|
|
if (response == "s_158")
|
|
{
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
slicer_02_lok_action_sendDathomirSignal (player, npc);
|
|
|
|
//-- NPC: Correct. Go to the coordinates I have and report what you see.
|
|
string_id message = new string_id (c_stringFile, "s_159");
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.slicer_02_lok");
|
|
|
|
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.slicer_02_lok");
|
|
|
|
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 (slicer_02_lok_condition_canceledQuest08 (player, npc))
|
|
{
|
|
slicer_02_lok_action_giveQuest08 (player, npc);
|
|
|
|
//-- NPC: Looks like you lost some instructions. Find out what is going on at this location on Dathomir.
|
|
string_id message = new string_id (c_stringFile, "s_36");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_canceledQuest07 (player, npc))
|
|
{
|
|
slicer_02_lok_action_grantQuest07WithWaypoint (player, npc);
|
|
|
|
//-- NPC: Well now, how did this happen? Oh well. Ready to continue? Go to the laboratory and see what you can find.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_canceledQuest06 (player, npc))
|
|
{
|
|
//-- NPC: Meet me back at my place at Mos Taike. We'll have to go over a few things there to fix your situation.
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_isGoingToDungeon (player, npc))
|
|
{
|
|
//-- NPC: Please hurry. I want to loot...I mean procure anything left behind before someone else does.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_isGoingToDathomir (player, npc))
|
|
{
|
|
doAnimationAction (npc, "laugh_cackle");
|
|
|
|
doAnimationAction (player, "shake_head_no");
|
|
|
|
//-- NPC: Let me know when you get to Dathomir. I'm headed back to Mos Taike after I LOK up here. Get it??
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_isReadyForDungeon (player, npc))
|
|
{
|
|
//-- NPC: I've fully decrypted the data on Derg's disk. Looks like Derg built a remote laboratory here on Lok and was about to conduct some research.
|
|
string_id message = new string_id (c_stringFile, "s_127");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What type of research?
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_131");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "slicer_02_lok", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition_hasCompletedlokDungeon (player, npc))
|
|
{
|
|
//-- NPC: Wow this science datapad will be a challenge to decipher. Too bad I don't know any living biologists to help me out.
|
|
string_id message = new string_id (c_stringFile, "s_129");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm fine, thanks for asking.
|
|
boolean hasResponse0 = false;
|
|
if (slicer_02_lok_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_150");
|
|
|
|
utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 15);
|
|
|
|
npcStartConversation (player, npc, "slicer_02_lok", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (slicer_02_lok_condition__defaultCondition (player, npc))
|
|
{
|
|
slicer_02_lok_action_giveQuest08 (player, npc);
|
|
|
|
//-- NPC: You are on private property. In other words I want you to leave.
|
|
string_id message = new string_id (c_stringFile, "s_132");
|
|
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 != "slicer_02_lok")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
if (branchId == 6 && slicer_02_lok_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && slicer_02_lok_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && slicer_02_lok_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && slicer_02_lok_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && slicer_02_lok_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && slicer_02_lok_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && slicer_02_lok_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && slicer_02_lok_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && slicer_02_lok_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && slicer_02_lok_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && slicer_02_lok_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && slicer_02_lok_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|