mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-02 02:15:48 -04:00
495 lines
14 KiB
Plaintext
495 lines
14 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// camp_epsilon_leader.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.features;
|
|
include library.groundquests;
|
|
include library.space_quest;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/camp_epsilon_leader";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean camp_epsilon_leader_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean camp_epsilon_leader_condition_hasRadio (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean camp_epsilon_leader_condition_hasPerfume (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "outbreak_perfume_hidden_content", "hasPerfume");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void camp_epsilon_leader_action_deliverRadioSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasFoundEpsilonContact");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void camp_epsilon_leader_action_hasDeliveredPerfume (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "hasDeliveredPerfume");
|
|
if(!hasCompletedCollectionSlot(player, "hidden_content_perfume"))
|
|
{
|
|
modifyCollectionSlotValue(player, "hidden_content_perfume", 1);
|
|
}
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int camp_epsilon_leader_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hello.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I have something you need bad.
|
|
if (response == "s_14")
|
|
{
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "smell_armpit");
|
|
|
|
camp_epsilon_leader_action_hasDeliveredPerfume (player, npc);
|
|
|
|
//-- NPC: Perfume?? Hey now! Just because you brought me this present doesn't mean....you and I...you know. Well...thanks anyway, I do need it.
|
|
string_id message = new string_id (c_stringFile, "s_15");
|
|
utils.removeScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int camp_epsilon_leader_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You probably want HX-138, I'm just a technicial in borrowed armor.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Actually I have a radio for you.
|
|
if (response == "s_32")
|
|
{
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: A radio? I think I am qualified to use it...is there someone listening for communications?
|
|
string_id message = new string_id (c_stringFile, "s_33");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: The radio is to coordinate supply drops.
|
|
boolean hasResponse0 = false;
|
|
if (camp_epsilon_leader_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_75");
|
|
|
|
utils.setScriptVar (player, "conversation.camp_epsilon_leader.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int camp_epsilon_leader_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A radio? I think I am qualified to use it...is there someone listening for communications?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: The radio is to coordinate supply drops.
|
|
if (response == "s_75")
|
|
{
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
camp_epsilon_leader_action_deliverRadioSignal (player, npc);
|
|
|
|
//-- NPC: Wow...I can finally be of use around here. Thank you...thanks a lot!
|
|
string_id message = new string_id (c_stringFile, "s_76");
|
|
utils.removeScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int camp_epsilon_leader_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yeah?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What happened to your armor?
|
|
if (response == "s_53")
|
|
{
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (player, "explain");
|
|
|
|
//-- NPC: Well, I'm a tech...not really a combatant. All I had was a torn up pair of coveralls. The other guys started to collect armor pieces for me. Judging from the smell, the armor probably came from the undead.
|
|
string_id message = new string_id (c_stringFile, "s_64");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Gross!
|
|
boolean hasResponse0 = false;
|
|
if (camp_epsilon_leader_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_65");
|
|
|
|
utils.setScriptVar (player, "conversation.camp_epsilon_leader.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int camp_epsilon_leader_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, I'm a tech...not really a combatant. All I had was a torn up pair of coveralls. The other guys started to collect armor pieces for me. Judging from the smell, the armor probably came from the undead.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Gross!
|
|
if (response == "s_65")
|
|
{
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You asked.
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
utils.removeScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
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;
|
|
}
|
|
|
|
// ======================================================================
|
|
// 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 (camp_epsilon_leader_condition_hasPerfume (player, npc))
|
|
{
|
|
//-- NPC: Hello.
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I have something you need bad.
|
|
boolean hasResponse0 = false;
|
|
if (camp_epsilon_leader_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.camp_epsilon_leader.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "camp_epsilon_leader", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition_hasRadio (player, npc))
|
|
{
|
|
//-- NPC: You probably want HX-138, I'm just a technicial in borrowed armor.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Actually I have a radio for you.
|
|
boolean hasResponse0 = false;
|
|
if (camp_epsilon_leader_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_32");
|
|
|
|
utils.setScriptVar (player, "conversation.camp_epsilon_leader.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "camp_epsilon_leader", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (camp_epsilon_leader_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yeah?
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What happened to your armor?
|
|
boolean hasResponse0 = false;
|
|
if (camp_epsilon_leader_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_53");
|
|
|
|
utils.setScriptVar (player, "conversation.camp_epsilon_leader.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "camp_epsilon_leader", 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 != "camp_epsilon_leader")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.camp_epsilon_leader.branchId");
|
|
|
|
if (branchId == 1 && camp_epsilon_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && camp_epsilon_leader_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && camp_epsilon_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && camp_epsilon_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && camp_epsilon_leader_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.camp_epsilon_leader.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|