mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
497 lines
14 KiB
Plaintext
497 lines
14 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// nym_technician_2.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.25 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.space_flags;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/nym_technician_2";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean nym_technician_2_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean nym_technician_2_condition_isOnStormSquadronQuest (obj_id player, obj_id npc)
|
|
{
|
|
return space_flags.hasSpaceFlag(player, "ss.findingAgent");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int nym_technician_2_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I'm really, really busy. It's a complete mess around here. The Empire has been laying it into Nym for some reason and the damaged ships keep rolling in. I've had to replace two engine cores today alone!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm sorry to hear that.
|
|
if (response == "s_8358e7c8")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yeah, well it's my sob story. Beat it so I can get to work. I don't think you're supposed to be back here anyway.
|
|
string_id message = new string_id (c_stringFile, "s_4c3cb236");
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm here to clean the antimatter condenser.
|
|
if (response == "s_67a590c3")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Clean the antimatter condenser? Well...yeah I suppose it's probably getting a little jammed with all of the work we've been putting it through. You can find the Snaff Grease in the back. Hurry up though, there's probably a bunch of ships waiting to be fueled up.
|
|
string_id message = new string_id (c_stringFile, "s_cbb1bec7");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Uh...okay...
|
|
boolean hasResponse0 = false;
|
|
if (nym_technician_2_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_76ac95c");
|
|
|
|
setObjVar (player, "conversation.nym_technician_2.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm here to scrub the plasma injector.
|
|
if (response == "s_62f865dd")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Scrub the? Excuse me?
|
|
string_id message = new string_id (c_stringFile, "s_501ea131");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm here to scrub the plasma injector.
|
|
boolean hasResponse0 = false;
|
|
if (nym_technician_2_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_62f865dd");
|
|
|
|
setObjVar (player, "conversation.nym_technician_2.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm here to wax the matter inducer.
|
|
if (response == "s_f49a789f")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hahaha! That's funny stuff!
|
|
string_id message = new string_id (c_stringFile, "s_60900624");
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int nym_technician_2_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Clean the antimatter condenser? Well...yeah I suppose it's probably getting a little jammed with all of the work we've been putting it through. You can find the Snaff Grease in the back. Hurry up though, there's probably a bunch of ships waiting to be fueled up.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Uh...okay...
|
|
if (response == "s_76ac95c")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Get moving now.
|
|
string_id message = new string_id (c_stringFile, "s_b7141451");
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int nym_technician_2_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Scrub the? Excuse me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm here to scrub the plasma injector.
|
|
if (response == "s_62f865dd")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What? You don't scrub a plasma injector. Those things are stored in sealed containers and fused into engines. Is this some kind of joke? Did Jeffy put you up to this?
|
|
string_id message = new string_id (c_stringFile, "s_b0c60048");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Uh...yeah Jeffy. Funny huh?
|
|
boolean hasResponse0 = false;
|
|
if (nym_technician_2_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_5afecbb7");
|
|
|
|
setObjVar (player, "conversation.nym_technician_2.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int nym_technician_2_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What? You don't scrub a plasma injector. Those things are stored in sealed containers and fused into engines. Is this some kind of joke? Did Jeffy put you up to this?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Uh...yeah Jeffy. Funny huh?
|
|
if (response == "s_5afecbb7")
|
|
{
|
|
//-- [NOTE]
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I don't get it. Look, I'm really busy. Can you come back later?
|
|
string_id message = new string_id (c_stringFile, "s_b44f916c");
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.nym_technician_2");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setCondition( self, CONDITION_SPACE_INTERESTING );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setCondition( self, CONDITION_SPACE_INTERESTING );
|
|
|
|
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);
|
|
|
|
faceTo( self, player );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.nym_technician_2");
|
|
|
|
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 (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'm really, really busy. It's a complete mess around here. The Empire has been laying it into Nym for some reason and the damaged ships keep rolling in. I've had to replace two engine cores today alone!
|
|
string_id message = new string_id (c_stringFile, "s_6aa58622");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm sorry to hear that.
|
|
boolean hasResponse0 = false;
|
|
if (nym_technician_2_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm here to clean the antimatter condenser.
|
|
boolean hasResponse1 = false;
|
|
if (nym_technician_2_condition_isOnStormSquadronQuest (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm here to scrub the plasma injector.
|
|
boolean hasResponse2 = false;
|
|
if (nym_technician_2_condition_isOnStormSquadronQuest (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm here to wax the matter inducer.
|
|
boolean hasResponse3 = false;
|
|
if (nym_technician_2_condition_isOnStormSquadronQuest (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_8358e7c8");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_67a590c3");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_62f865dd");
|
|
|
|
if (hasResponse3)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_f49a789f");
|
|
|
|
setObjVar (player, "conversation.nym_technician_2.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "nym_technician_2", 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 != "nym_technician_2")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = getIntObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
if (branchId == 1 && nym_technician_2_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && nym_technician_2_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && nym_technician_2_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && nym_technician_2_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
removeObjVar (player, "conversation.nym_technician_2.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|