mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
577 lines
16 KiB
Plaintext
577 lines
16 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// tyrena_lyman_zavala.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/tyrena_lyman_zavala";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean tyrena_lyman_zavala_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_finishedDoolQuests (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest (player, "quest/coronet_captain_dool");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_doingLymanQuests (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive(player, "quest/tyrena_lyman_evidence"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_waitingForLymanFinish (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedTask (player, "quest/tyrena_lyman_olag_greck", "returningToLyman"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_needTakouhliWaypoint (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/tyrena_lyman_olag_greck") && !groundquests.isQuestActiveOrComplete (player, "quest/tyrena_meet_the_meatlumps"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_startedTakouhi (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete (player, "quest/tyrena_meet_the_meatlumps");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_doingOlagQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive(player, "quest/tyrena_lyman_olag_greck"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tyrena_lyman_zavala_condition_finishingOlagQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/tyrena_lyman_olag_greck", "returningToLyman"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void tyrena_lyman_zavala_action_grantLymanQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/tyrena_lyman_evidence");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tyrena_lyman_zavala_action_grantGoToTakouhi (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/tyrena_goto_takouhi");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tyrena_lyman_zavala_action_completeLymanQuests (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "finishLymanQuest");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tyrena_lyman_zavala_action_sendDoolGotoSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "cameFromDool");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tyrena_lyman_zavala_action_sendOlagDeadSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "olagIsDead");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tyrena_lyman_zavala_action_grantKillOlagQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/tyrena_lyman_olag_greck");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int tyrena_lyman_zavala_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Thanks for finishing the quest. Did you get lost?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yep, I'm lost.
|
|
if (response == "s_11")
|
|
{
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition__defaultCondition (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_grantGoToTakouhi (player, npc);
|
|
|
|
//-- NPC: Here's the infos.
|
|
string_id message = new string_id (c_stringFile, "s_12");
|
|
utils.removeScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tyrena_lyman_zavala_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That dude is dead!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I shot him a lot.
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition__defaultCondition (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_grantGoToTakouhi (player, npc);
|
|
|
|
//-- NPC: Go see my man Takouhi.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
utils.removeScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tyrena_lyman_zavala_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You finished hte quest!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes I did.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition__defaultCondition (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_grantKillOlagQuest (player, npc);
|
|
|
|
//-- NPC: Go kill Olag Greck.
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
utils.removeScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tyrena_lyman_zavala_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Ready For a Quest?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes.
|
|
if (response == "s_22")
|
|
{
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition__defaultCondition (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_grantLymanQuest (player, npc);
|
|
|
|
//-- NPC: Here's the first Chirq/Greck Quest.
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.tyrena_lyman_zavala");
|
|
|
|
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.tyrena_lyman_zavala");
|
|
|
|
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 (tyrena_lyman_zavala_condition_startedTakouhi (player, npc))
|
|
{
|
|
//-- NPC: You are teh best.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_needTakouhliWaypoint (player, npc))
|
|
{
|
|
//-- NPC: Thanks for finishing the quest. Did you get lost?
|
|
string_id message = new string_id (c_stringFile, "s_6");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yep, I'm lost.
|
|
boolean hasResponse0 = false;
|
|
if (tyrena_lyman_zavala_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.tyrena_lyman_zavala.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "tyrena_lyman_zavala", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_finishingOlagQuest (player, npc))
|
|
{
|
|
//-- NPC: That dude is dead!
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I shot him a lot.
|
|
boolean hasResponse0 = false;
|
|
if (tyrena_lyman_zavala_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_29");
|
|
|
|
utils.setScriptVar (player, "conversation.tyrena_lyman_zavala.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "tyrena_lyman_zavala", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_doingOlagQuest (player, npc))
|
|
{
|
|
//-- NPC: I need you to take care of that problem we discussed. You know...the Olag Greck problem?
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_waitingForLymanFinish (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_completeLymanQuests (player, npc);
|
|
|
|
//-- NPC: You finished hte quest!
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes I did.
|
|
boolean hasResponse0 = false;
|
|
if (tyrena_lyman_zavala_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_14");
|
|
|
|
utils.setScriptVar (player, "conversation.tyrena_lyman_zavala.branchId", 7);
|
|
|
|
npcStartConversation (player, npc, "tyrena_lyman_zavala", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_doingLymanQuests (player, npc))
|
|
{
|
|
//-- NPC: How come you're not done with the quest?
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition_finishedDoolQuests (player, npc))
|
|
{
|
|
tyrena_lyman_zavala_action_sendDoolGotoSignal (player, npc);
|
|
|
|
//-- NPC: Ready For a Quest?
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes.
|
|
boolean hasResponse0 = false;
|
|
if (tyrena_lyman_zavala_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.tyrena_lyman_zavala.branchId", 10);
|
|
|
|
npcStartConversation (player, npc, "tyrena_lyman_zavala", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tyrena_lyman_zavala_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Default Response.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
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 != "tyrena_lyman_zavala")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
if (branchId == 2 && tyrena_lyman_zavala_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && tyrena_lyman_zavala_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && tyrena_lyman_zavala_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && tyrena_lyman_zavala_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.tyrena_lyman_zavala.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|