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

1208 lines
37 KiB
Plaintext

// ======================================================================
//
// water_treatment.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// 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.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/water_treatment";
// ======================================================================
// Script Conditions
// ======================================================================
boolean water_treatment_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasInitialQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy")
|| (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_1"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_isFinishingFirstQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "returnChemical")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_mixing_chamber")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_2"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_isFinishingSecondQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "returnValves")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_under_pressure")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_3"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_isFinishingThirdQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "returnRegulator")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_flocculation_chamber")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasFinishedAllQuests (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson");
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasFirstQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasSecondQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasThirdQuest (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent"));
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasNotFixedMixer (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "fixMixingChamber");
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasNotFixedSediment (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "fixSedimentation");
}
// ----------------------------------------------------------------------
boolean water_treatment_condition_hasNotFixedFlocculation (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "fixFlocculation");
}
// ======================================================================
// Script Actions
// ======================================================================
void water_treatment_action_signalMeetingFirstTime (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundFiltrationGuy");
}
// ----------------------------------------------------------------------
void water_treatment_action_giveFirstQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_parts_1");
}
// ----------------------------------------------------------------------
void water_treatment_action_giveSecondQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_parts_2");
}
// ----------------------------------------------------------------------
void water_treatment_action_giveThirdQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_parts_3");
}
// ----------------------------------------------------------------------
void water_treatment_action_finishUpMixingChamber (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasReturnedChemical");
}
// ----------------------------------------------------------------------
void water_treatment_action_grantReturnTownPerson (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_return_townsperson");
}
// ----------------------------------------------------------------------
void water_treatment_action_finishUpFloc (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasReturnedRegulator");
}
// ----------------------------------------------------------------------
void water_treatment_action_finishUpPressure (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasReturnedValves");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int water_treatment_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency!
//-- [RESPONSE NOTE]
//-- PLAYER: Great, great, now what else do I need to get?
if (response == "s_18")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shrug_shoulders");
//-- NPC: A drink of water.
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...?
boolean hasResponse0 = false;
if (water_treatment_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_42");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: A drink of water.
//-- [RESPONSE NOTE]
//-- PLAYER: Well, yeah, that's what this is all abou... oh, you mean...?
if (response == "s_42")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
water_treatment_action_grantReturnTownPerson (player, npc);
//-- NPC: Yes, my friend, you've done it! Let the people know that Nym's Stronghold will have pure clear drinking water in no time; all thanks to %TU!
string_id message = new string_id (c_stringFile, "s_43");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore...
//-- [RESPONSE NOTE]
//-- PLAYER: I know, just follow the pipes, right?
if (response == "s_66")
{
doAnimationAction (player, "standing_placate");
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "udaman");
//-- NPC: How did you guess?
string_id message = new string_id (c_stringFile, "s_67");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now.
//-- [RESPONSE NOTE]
//-- PLAYER: And that means there will be clean water, now, too, yes?
if (response == "s_16")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_no");
//-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly...
string_id message = new string_id (c_stringFile, "s_21");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll go back to Ralia for a Motor Power Regulator.
boolean hasResponse0 = false;
if (water_treatment_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_40");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Uh.. no, not quite yet. The Flocculation Chamber needs to be stirred at just the right speed and time but the Motor Power Regulator is glitching badly...
//-- [RESPONSE NOTE]
//-- PLAYER: I'll go back to Ralia for a Motor Power Regulator.
if (response == "s_40")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
water_treatment_action_giveThirdQuest (player, npc);
//-- NPC: Thanks.
string_id message = new string_id (c_stringFile, "s_41");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Excellent work with the Cationic Chemical Coagulant!
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks. So there will be fresh water now?
if (response == "s_29")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_no");
//-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again.
string_id message = new string_id (c_stringFile, "s_37");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you need Ralia to give you some Flow Control Valves?
boolean hasResponse0 = false;
if (water_treatment_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_38");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I wish! No, not yet. The Flow Control Valves in the Sedimentation Tank are all either completely stopped up or nearly so. Replacing them is the only way to get the water flowing again.
//-- [RESPONSE NOTE]
//-- PLAYER: So you need Ralia to give you some Flow Control Valves?
if (response == "s_38")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod_head_once");
water_treatment_action_giveSecondQuest (player, npc);
//-- NPC: Yes. Good luck, they seem to be in short supply... as in non-existent!
string_id message = new string_id (c_stringFile, "s_39");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So much water and it's all useless! Yes? You need something?
//-- [RESPONSE NOTE]
//-- PLAYER: Are you Nym's Water Treatment Technician?
if (response == "s_45")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: I am, for all the good it does me. Why?
string_id message = new string_id (c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What are you doing out here so far from the Treatment Facility on shore?
boolean hasResponse0 = false;
if (water_treatment_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_49");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 19);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am, for all the good it does me. Why?
//-- [RESPONSE NOTE]
//-- PLAYER: What are you doing out here so far from the Treatment Facility on shore?
if (response == "s_49")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
//-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility.
string_id message = new string_id (c_stringFile, "s_51");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So the water treatment stuff is broken?
boolean hasResponse0 = false;
if (water_treatment_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.water_treatment.branchId", 20);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch20 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Trying to think. I had to get away for a while from that broken-down piece of bantha... I mean, the Treatment Facility.
//-- [RESPONSE NOTE]
//-- PLAYER: So the water treatment stuff is broken?
if (response == "s_53")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "slump_head");
//-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it.
string_id message = new string_id (c_stringFile, "s_55");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Maybe I can help, what do you need?
boolean hasResponse0 = false;
if (water_treatment_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_59");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 21);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes. Things wear out, you know? And I can't get the Quartermaster to get me any of the supplies I need to fix it.
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe I can help, what do you need?
if (response == "s_59")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but...
string_id message = new string_id (c_stringFile, "s_68");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do.
boolean hasResponse0 = false;
if (water_treatment_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_70");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 22);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int water_treatment_handleBranch22 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well the first thing I need is a new supply of Cationic Chemical Coagulant for the Mixing Chamber, but...
//-- [RESPONSE NOTE]
//-- PLAYER: Got it, now point me to the Quartermaster and I'll see what I can do.
if (response == "s_70")
{
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave1");
water_treatment_action_giveFirstQuest (player, npc);
//-- NPC: Okay, I've noted it on your datapad. Good luck, you'll need it!
string_id message = new string_id (c_stringFile, "s_72");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.water_treatment");
setCondition (self, CONDITION_CONVERSABLE);
setCondition( self, CONDITION_INTERESTING );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition( self, CONDITION_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);
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.water_treatment");
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 (water_treatment_condition_hasFinishedAllQuests (player, npc))
{
doAnimationAction (player, "udaman");
//-- NPC: The cistern is filling nicely with pure, clean water, thanks to all your hard work!
string_id message = new string_id (c_stringFile, "s_57");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_isFinishingThirdQuest (player, npc))
{
doAnimationAction (npc, "celebrate1");
water_treatment_action_finishUpFloc (player, npc);
//-- NPC: Wonderful! The Flocculation Chamber is operating at near peak efficiency!
string_id message = new string_id (c_stringFile, "s_17");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Great, great, now what else do I need to get?
boolean hasResponse0 = false;
if (water_treatment_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_18");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 2);
npcStartConversation (player, npc, "water_treatment", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasThirdQuest (player, npc))
{
doAnimationAction (npc, "yawn");
doAnimationAction (player, "explain");
//-- NPC: The motors need to operate smoothly and consistently to provide sufficient turbulence of the mixture to maintain the constituents in suspension and promote flocculation.
string_id message = new string_id (c_stringFile, "s_62");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasNotFixedFlocculation (player, npc))
{
doAnimationAction (npc, "applause_excited");
//-- NPC: Those are still in the box! Excellent! Just follow the instruction and install them. The Focculation Chamber is between the Mixing Chamber and the Sedimentation tank on the shore...
string_id message = new string_id (c_stringFile, "s_65");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I know, just follow the pipes, right?
boolean hasResponse0 = false;
if (water_treatment_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_66");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 6);
npcStartConversation (player, npc, "water_treatment", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_isFinishingSecondQuest (player, npc))
{
doAnimationAction (npc, "thank");
water_treatment_action_finishUpPressure (player, npc);
//-- NPC: Great job on those Valves! The flow is being regulated perfectly within the Sedimentation Chamber, now.
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: And that means there will be clean water, now, too, yes?
boolean hasResponse0 = false;
if (water_treatment_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_16");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 8);
npcStartConversation (player, npc, "water_treatment", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasSecondQuest (player, npc))
{
doAnimationAction (player, "slump_head");
//-- NPC: I wish the existing valves could just be cleaned, but it's gotten so bad that they really need to be replaced.
string_id message = new string_id (c_stringFile, "s_61");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasNotFixedSediment (player, npc))
{
doAnimationAction (npc, "nod_head_multiple");
//-- NPC: Yes those are the correct valves; they should be simple for you to install. The Sedimentation Tank is the last in line over there on the shore; just follow the pipes.
string_id message = new string_id (c_stringFile, "s_64");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_isFinishingFirstQuest (player, npc))
{
doAnimationAction (npc, "applause_polite");
water_treatment_action_finishUpMixingChamber (player, npc);
//-- NPC: Excellent work with the Cationic Chemical Coagulant!
string_id message = new string_id (c_stringFile, "s_27");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks. So there will be fresh water now?
boolean hasResponse0 = false;
if (water_treatment_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.water_treatment.branchId", 13);
npcStartConversation (player, npc, "water_treatment", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasFirstQuest (player, npc))
{
doAnimationAction (npc, "shrug_hands");
//-- NPC: That Mixing Chamber is not going to resupply itself with Cationic Chemical Coagulant, you know. If you haven't talked to her yet then you really should go see if Ralia Reeven has any.
string_id message = new string_id (c_stringFile, "s_58");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasNotFixedMixer (player, npc))
{
doAnimationAction (npc, "standing_placate");
//-- NPC: That's okay, you don't have to give the Cationic Chemical Coagulant to me! Just dump it in the Mixing Chamber over on the shore; follow the pipes and you can't miss it.
string_id message = new string_id (c_stringFile, "s_63");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition_hasInitialQuest (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
water_treatment_action_signalMeetingFirstTime (player, npc);
//-- NPC: So much water and it's all useless! Yes? You need something?
string_id message = new string_id (c_stringFile, "s_36");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Are you Nym's Water Treatment Technician?
boolean hasResponse0 = false;
if (water_treatment_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_45");
utils.setScriptVar (player, "conversation.water_treatment.branchId", 18);
npcStartConversation (player, npc, "water_treatment", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (water_treatment_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sneeze");
//-- NPC: So much sulphur in the water! But at least we don't have an insect problem.
string_id message = new string_id (c_stringFile, "s_74");
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 != "water_treatment")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.water_treatment.branchId");
if (branchId == 2 && water_treatment_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && water_treatment_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && water_treatment_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && water_treatment_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && water_treatment_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && water_treatment_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && water_treatment_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && water_treatment_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && water_treatment_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 20 && water_treatment_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && water_treatment_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 22 && water_treatment_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.water_treatment.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================