Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/death_watch_technician.script
T

1310 lines
39 KiB
Plaintext

// ======================================================================
//
// death_watch_technician.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.create;
include library.player_structure;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/death_watch_technician";
// ======================================================================
// Script Conditions
// ======================================================================
boolean death_watch_technician_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventOff (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if(hasObjVar(player, "death_watch.air_vent_fail") || hasObjVar(player, "death_watch.air_vent_success"))
{
return false;
}
if (!hasObjVar(structure, "death_watch.air_vent_on") && !hasObjVar(structure, "death_watch.missionTaker"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventOn (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if (hasObjVar(structure, "death_watch.air_vent_on") && !hasObjVar(player, "death_watch.air_vent_success"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventOffCompleted (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if(!hasObjVar(structure, "death_watch.missionTaker"))
{
return false;
}
if (!hasObjVar(structure, "death_watch.air_vent_on") && hasObjVar(player, "death_watch.air_vent_success"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventOffNewPlayer (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if(!hasObjVar(structure, "death_watch.missionTaker"))
{
return false;
}
obj_id taker = getObjIdObjVar(structure, "death_watch.missionTaker");
if (!hasObjVar(structure, "death_watch.air_vent_on") && taker != player)
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventFailure (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if(hasObjVar(structure, "death_watch.missionTaker"))
{
return false;
}
if (!hasObjVar(structure, "death_watch.air_vent_on") && hasObjVar(player, "death_watch.air_vent_fail"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_ventOnOldPlayer (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if (hasObjVar(structure, "death_watch.air_vent_on") && hasObjVar(player, "death_watch.air_vent_success"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_toSoon (obj_id player, obj_id npc)
{
int oldTime = getIntObjVar(player, "death_watch.air_vent_fail");
int refreshTime = oldTime + 1800;
int curTime = getGameTime();
if(curTime < refreshTime)
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_readyToGoAgain (obj_id player, obj_id npc)
{
int oldTime = getIntObjVar(player, "death_watch.air_vent_fail");
int refreshTime = oldTime + 1800;
int curTime = getGameTime();
if(curTime > refreshTime)
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean death_watch_technician_condition_goProtectDroid (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return false;
}
if(!hasObjVar(structure, "death_watch.missionTaker"))
{
return false;
}
obj_id taker = getObjIdObjVar(structure, "death_watch.missionTaker");
if (!hasObjVar(structure, "death_watch.air_vent_on") && taker == player)
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void death_watch_technician_action_startEvent (obj_id player, obj_id npc)
{
obj_id structure = getTopMostContainer (npc);
if(!isIdValid(structure))
{
return;
}
setObjVar(structure, "death_watch.missionTaker", player);
float xCoord = -20.25f;
float yCoord = -52f;
float zCoord = -162.3f;
location myself = getLocation (npc);
string planet = myself.area;
obj_id room = getCellId (structure, "lab64");
location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room);
obj_id spawnedCreature = create.object ("mand_bunker_repair_droid", spawnPoint);
attachScript(spawnedCreature, "theme_park.dungeon.death_watch_bunker.repair_droid");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int death_watch_technician_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hmm, who are you? Actually, nevermind. I don't want to know. If the Mandalorians don't want you here, they can take care of you themselves. It's not like they ever help me. No, not them. They tell me to get a job done and then don't let me do it.
//-- [RESPONSE NOTE]
//-- PLAYER: Having problems with the Mandalorians?
if (response == "s_bb1676fc")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: Now that might be a little bit of an understatement. I always have problems with the Mandalorians. They just don't deal well with others... I am thinking that they probably weren't hugged enough when they were children.
string_id message = new string_id (c_stringFile, "s_f7d4b8be");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I see. So.... what sort of work do you do here?
boolean hasResponse0 = false;
if (death_watch_technician_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_1cc2ceff");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What sort of job do you do?
if (response == "s_d7a232dc")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: I am an exhaust ventilation technician for the mines. It is my job to make sure that the mine's exhaust system is working correctly. Of course, that is when the Mandalorians let me do my job.
string_id message = new string_id (c_stringFile, "s_25e933d3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What happens if the mine's exhaust system isn't working?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What are the Mandalorians doing to stop you from working?
boolean hasResponse1 = false;
if (death_watch_technician_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_c4446dd7");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_24");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Now that might be a little bit of an understatement. I always have problems with the Mandalorians. They just don't deal well with others... I am thinking that they probably weren't hugged enough when they were children.
//-- [RESPONSE NOTE]
//-- PLAYER: I see. So.... what sort of work do you do here?
if (response == "s_1cc2ceff")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: I am an exhaust ventilation technician for the mines. It is my job to make sure that the mine's exhaust system is working correctly. Of course, that is when the Mandalorians let me do my job.
string_id message = new string_id (c_stringFile, "s_25e933d3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What happens if the mine's exhaust system isn't working?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What are the Mandalorians doing to stop you from working?
boolean hasResponse1 = false;
if (death_watch_technician_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_c4446dd7");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_24");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am an exhaust ventilation technician for the mines. It is my job to make sure that the mine's exhaust system is working correctly. Of course, that is when the Mandalorians let me do my job.
//-- [RESPONSE NOTE]
//-- PLAYER: What happens if the mine's exhaust system isn't working?
if (response == "s_c4446dd7")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: The mines fill up with allum gas. That stuff can really mess up the men working inside the mines. So all the miners have to wear the rebreather gear in order to work down there, but those things are not always reliable.
string_id message = new string_id (c_stringFile, "s_45ae332c");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What are the Mandalorians doing to stop you from working?
boolean hasResponse0 = false;
if (death_watch_technician_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_a0c1a32f");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What are the Mandalorians doing to stop you from working?
if (response == "s_24")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: The main exhaust ports are offline and I need to send in a droid to fix it. But everytime I send in one of my droids, these dumb Mandalorians shoot it to pieces. Then, they laugh about it all the while yelling at me for not having the ports back online.
string_id message = new string_id (c_stringFile, "s_a8fb8b64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Maybe I can help you out?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds like you do have it rough.
boolean hasResponse1 = false;
if (death_watch_technician_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_bd5476c4");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_406a4ae2");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The mines fill up with allum gas. That stuff can really mess up the men working inside the mines. So all the miners have to wear the rebreather gear in order to work down there, but those things are not always reliable.
//-- [RESPONSE NOTE]
//-- PLAYER: What are the Mandalorians doing to stop you from working?
if (response == "s_a0c1a32f")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: The main exhaust ports are offline and I need to send in a droid to fix it. But everytime I send in one of my droids, these dumb Mandalorians shoot it to pieces. Then, they laugh about it all the while yelling at me for not having the ports back online.
string_id message = new string_id (c_stringFile, "s_a8fb8b64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Maybe I can help you out?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds like you do have it rough.
boolean hasResponse1 = false;
if (death_watch_technician_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_bd5476c4");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_406a4ae2");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The main exhaust ports are offline and I need to send in a droid to fix it. But everytime I send in one of my droids, these dumb Mandalorians shoot it to pieces. Then, they laugh about it all the while yelling at me for not having the ports back online.
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe I can help you out?
if (response == "s_bd5476c4")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: The only thing that I can think of to help me out is if you go in with the droid and don't let the Mandalorians blow it up. If you are willing to do that, you have way more guts than I would ever have.
string_id message = new string_id (c_stringFile, "s_c74f6e65");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can do that. Send in the droid and I will take care of the Mandalorians.
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Hmmm, I am not going to do that. Those Mandalorians are nasty.
boolean hasResponse1 = false;
if (death_watch_technician_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_17aa7854");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1a05844b");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds like you do have it rough.
if (response == "s_406a4ae2")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: Ain't that the truth. Now, if there isn't anything else, I really need to get back to trying to figure out a way to get those dumb Mandalorians not to trash another one of my droids.
string_id message = new string_id (c_stringFile, "s_bb18b90f");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Maybe I can help you out?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Okay, well, good luck with that.
boolean hasResponse1 = false;
if (death_watch_technician_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_20");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_72f8ec3a");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The only thing that I can think of to help me out is if you go in with the droid and don't let the Mandalorians blow it up. If you are willing to do that, you have way more guts than I would ever have.
//-- [RESPONSE NOTE]
//-- PLAYER: I can do that. Send in the droid and I will take care of the Mandalorians.
if (response == "s_17aa7854")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
death_watch_technician_action_startEvent (player, npc);
//-- NPC: Alright, I am going to release the droid. It has to make a stop over at the tool chest to get some extra tools before it can make the repairs. Keep those Mandalorians off it until it can finish the repairs and these air vents will kick on and clear out the allum gases.
string_id message = new string_id (c_stringFile, "s_fe84832a");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Hmmm, I am not going to do that. Those Mandalorians are nasty.
if (response == "s_1a05844b")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: Can't say I blame you.
string_id message = new string_id (c_stringFile, "s_89b80057");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ain't that the truth. Now, if there isn't anything else, I really need to get back to trying to figure out a way to get those dumb Mandalorians not to trash another one of my droids.
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe I can help you out?
if (response == "s_20")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: The only thing that I can think of to help me out is if you go in with the droid and don't let the Mandalorians blow it up. If you are willing to do that, you have way more guts than I would ever have.
string_id message = new string_id (c_stringFile, "s_c74f6e65");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can do that. Send in the droid and I will take care of the Mandalorians.
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Hmmm, I am not going to do that. Those Mandalorians are nasty.
boolean hasResponse1 = false;
if (death_watch_technician_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_17aa7854");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1a05844b");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, well, good luck with that.
if (response == "s_72f8ec3a")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: Yeah, yeah.
string_id message = new string_id (c_stringFile, "s_3f1a842c");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Blast it! Lost another droid. I swear those Mandalorians are just relentless when they feel the need to torment someone.
//-- [RESPONSE NOTE]
//-- PLAYER: Give me another chance. I know I can keep that droid alive.
if (response == "s_7d875e15")
{
//-- [NOTE]
if (death_watch_technician_condition_toSoon (player, npc))
{
//-- NPC: You are going to have to give me a little while to get another droid put together. Come back and talk to me later. If I still need the help, I will be more than willing to take it.
string_id message = new string_id (c_stringFile, "s_32b29b58");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_readyToGoAgain (player, npc))
{
death_watch_technician_action_startEvent (player, npc);
//-- NPC: Alright, I am going to release the droid. It has to make a stop over at the tool chest to get some extra tools before it can make the repairs. Keep those Mandalorians off it until it can finish the repairs and these air vents will kick on and clear out the allum gases.
string_id message = new string_id (c_stringFile, "s_30");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Those Mandalorians are too much for me.
if (response == "s_3bc0260c")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: You are not the first person to say those words.
string_id message = new string_id (c_stringFile, "s_fc578c95");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int death_watch_technician_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hey, you don't know how happy I am to see you again. The exhaust system went offline again and...that's right...you guessed it...those Mandalorians are at it again. You willing to give me a hand again?
//-- [RESPONSE NOTE]
//-- PLAYER: You know it. I will protect that droid.
if (response == "s_373533eb")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
death_watch_technician_action_startEvent (player, npc);
//-- NPC: I knew I could count on you. Okay, I am going to unleash the droid now. Good luck to you.
string_id message = new string_id (c_stringFile, "s_9a8c12bc");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I am sorry, but I can't right now.
if (response == "s_cbf95857")
{
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: Oh, well, I am sure I will figure something else out. Thanks anyways.
string_id message = new string_id (c_stringFile, "s_aad4d52");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.death_watch_technician");
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
setInvulnerable (self, true);
setName(self, "Labsol Renuffi (a technician)");
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.death_watch_technician");
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 (death_watch_technician_condition_ventOff (player, npc))
{
//-- NPC: Hmm, who are you? Actually, nevermind. I don't want to know. If the Mandalorians don't want you here, they can take care of you themselves. It's not like they ever help me. No, not them. They tell me to get a job done and then don't let me do it.
string_id message = new string_id (c_stringFile, "s_8b67f49d");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Having problems with the Mandalorians?
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What sort of job do you do?
boolean hasResponse1 = false;
if (death_watch_technician_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_bb1676fc");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_d7a232dc");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 1);
npcStartConversation (player, npc, "death_watch_technician", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_ventFailure (player, npc))
{
//-- NPC: Blast it! Lost another droid. I swear those Mandalorians are just relentless when they feel the need to torment someone.
string_id message = new string_id (c_stringFile, "s_bd52a08a");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Give me another chance. I know I can keep that droid alive.
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Those Mandalorians are too much for me.
boolean hasResponse1 = false;
if (death_watch_technician_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_7d875e15");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_3bc0260c");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 11);
npcStartConversation (player, npc, "death_watch_technician", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_ventOn (player, npc))
{
//-- NPC: I am sorry, but I really don't have much time to chat right now. Always too much work to do in to little time. Maybe later I will have a spare moment.
string_id message = new string_id (c_stringFile, "s_ebfed4db");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_ventOffNewPlayer (player, npc))
{
//-- NPC: Give me a few minutes. I just sent out one of my droids on a dangerous mission with an escort. I am hoping that this works.
string_id message = new string_id (c_stringFile, "s_1fb416ce");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_ventOffCompleted (player, npc))
{
//-- NPC: Hey, you don't know how happy I am to see you again. The exhaust system went offline again and...that's right...you guessed it...those Mandalorians are at it again. You willing to give me a hand again?
string_id message = new string_id (c_stringFile, "s_3cab69e3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You know it. I will protect that droid.
boolean hasResponse0 = false;
if (death_watch_technician_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I am sorry, but I can't right now.
boolean hasResponse1 = false;
if (death_watch_technician_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_373533eb");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_cbf95857");
utils.setScriptVar (player, "conversation.death_watch_technician.branchId", 17);
npcStartConversation (player, npc, "death_watch_technician", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition_ventOnOldPlayer (player, npc))
{
//-- NPC: I can't thank you enough for helping me out back there. The exhaust fans are back online and the miners should be safe for a while at least. That exhaust system is pretty iffy and shorts out alot. I think the Mandalorians are breaking it on purpose just so they can have their fun.
string_id message = new string_id (c_stringFile, "s_33381eda");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (death_watch_technician_condition__defaultCondition (player, npc))
{
//-- NPC: What are you doing back here? You are supposed to be protecting that droid. Without your protection, those Mandalorians will blow him to bits.
string_id message = new string_id (c_stringFile, "s_cba682eb");
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 != "death_watch_technician")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.death_watch_technician.branchId");
if (branchId == 1 && death_watch_technician_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && death_watch_technician_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && death_watch_technician_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && death_watch_technician_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && death_watch_technician_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && death_watch_technician_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && death_watch_technician_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && death_watch_technician_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && death_watch_technician_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.death_watch_technician.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================