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

1386 lines
42 KiB
Plaintext

// ======================================================================
//
// nym_themepark_quatermaster.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.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/nym_themepark_quatermaster";
// ======================================================================
// Script Conditions
// ======================================================================
boolean nym_themepark_quatermaster_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_isOnFirstQuest (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_smuggler_01"));
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_isOnSecondQuest (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 nym_themepark_quatermaster_condition_isOnThridQuest (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 nym_themepark_quatermaster_condition_isAlmostDone (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_safe", "backQuartermaster")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_safe")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_flocculation_chamber"));
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_hasFailedDelivery (obj_id player, obj_id npc)
{
faceTo(npc,player);
return groundquests.isTaskActive(player, "u16_nym_themepark_save_agent_fail", "returnRaliaFail");
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isQuestActive(player, "u16_nym_themepark_smuggler_01");
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isQuestActive(player, "u16_nym_themepark_save_agent");
}
// ----------------------------------------------------------------------
boolean nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (obj_id player, obj_id npc)
{
faceTo(npc, player);
return groundquests.isQuestActive(player, "u16_nym_themepark_under_pressure");
}
// ======================================================================
// Script Actions
// ======================================================================
void nym_themepark_quatermaster_action_signalFirstJumperQuestDone (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundQuartermaster");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_signalSecondJumperQuestDone (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasGoneQuartermaster");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_signalAgentSafe (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasGoneBackQuartermaster");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_grantSmugglerQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_smuggler_01");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_grantAgentQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_save_agent");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_grantPressureQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_under_pressure");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_sendPlayerToFixChamber (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_repair_flocculation_chamber");
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_clearDeliveryFailQuest (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "u16_nym_themepark_save_agent_fail");
groundquests.clearQuest(player, "u16_nym_themepark_save_agent");
nym_themepark_quatermaster_action_grantAgentQuest(player, npc);
}
// ----------------------------------------------------------------------
void nym_themepark_quatermaster_action_signalThirdJumperQuestDone (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasGoneQuartermasterAgain");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int nym_themepark_quatermaster_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks.
//-- [RESPONSE NOTE]
//-- PLAYER: That's what he said. The thanks is welcome but the part would be more so...
if (response == "s_17")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
nym_themepark_quatermaster_action_sendPlayerToFixChamber (player, npc);
//-- NPC: Oh! Yes, of course, of course! Here it is. Tell Phor that I am looking forward to a cold glass and a bath; not necessarily in that order.
string_id message = new string_id (c_stringFile, "s_18");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?!
//-- [RESPONSE NOTE]
//-- PLAYER: I didn't make it in time and the supplies expired.
if (response == "s_20")
{
doAnimationAction (player, "shake_head_disgust");
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_down");
nym_themepark_quatermaster_action_clearDeliveryFailQuest (player, npc);
//-- NPC: Here are some more; you need to move faster this time!
string_id message = new string_id (c_stringFile, "s_21");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What are you still doing here?!
//-- [RESPONSE NOTE]
//-- PLAYER: I... um... I...
if (response == "s_74")
{
doAnimationAction (player, "taken_aback");
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
//-- NPC: You're wasting time you don't have, now GO!
string_id message = new string_id (c_stringFile, "s_75");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh for Nym's sake, what now?!
//-- [RESPONSE NOTE]
//-- PLAYER: Motor Power Regulator. I need one.
if (response == "s_15")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_finger_warning");
//-- NPC: Hold that thought, I'm getting a comm...
string_id message = new string_id (c_stringFile, "s_23");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything...
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_46");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hold that thought, I'm getting a comm...
//-- [RESPONSE NOTE]
//-- PLAYER: Sure, take your time, it's not like anyone's dying of thirst or anything...
if (response == "s_46")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help.
string_id message = new string_id (c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So I forget about the thirsty people and rush to help this guy?
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_48");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well for once, I'm glad to see you. That was from one of our field agents and a clanmate of mine. He's been injured and needs help.
//-- [RESPONSE NOTE]
//-- PLAYER: So I forget about the thirsty people and rush to help this guy?
if (response == "s_48")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment!
string_id message = new string_id (c_stringFile, "s_49");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay, okay, hand over the supplies and point the way.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_50");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Look, I've got the part you need, but Rei needs help NOW! I need you to rush these medical supplies to him. Hurry, they have an exceptionally short viability in this environment!
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, okay, hand over the supplies and point the way.
if (response == "s_50")
{
doAnimationAction (player, "taken_aback");
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
nym_themepark_quatermaster_action_grantAgentQuest (player, npc);
//-- NPC: Already in your datapad, now please hurry!
string_id message = new string_id (c_stringFile, "s_51");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Couldn't take the pressure, eh?
//-- [RESPONSE NOTE]
//-- PLAYER: That was bad. No just taking a break.
if (response == "s_71")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "tap_foot");
//-- NPC: Hope you're not getting thirsty...
string_id message = new string_id (c_stringFile, "s_72");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Back again? Need more chemicals?
//-- [RESPONSE NOTE]
//-- PLAYER: No chemicals; Flow Control Valves, this time.
if (response == "s_36")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky...
string_id message = new string_id (c_stringFile, "s_38");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: And where's that?
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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.nym_themepark_quatermaster.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Huh, I don't have anything like that, sorry. I do know where you might get some but it may be risky...
//-- [RESPONSE NOTE]
//-- PLAYER: And where's that?
if (response == "s_40")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
//-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need...
string_id message = new string_id (c_stringFile, "s_42");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: And how is that risky?
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_44");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: There is a Pressurized Liquid Storage Unit not too far from here that is sure to have the valves you need...
//-- [RESPONSE NOTE]
//-- PLAYER: And how is that risky?
if (response == "s_44")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom!
string_id message = new string_id (c_stringFile, "s_52");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll be careful...
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_54");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, it IS pressurized, after all... remove the flow control valves or tamper with it in any way and the whole thing might go boom!
//-- [RESPONSE NOTE]
//-- PLAYER: I'll be careful...
if (response == "s_54")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
nym_themepark_quatermaster_action_grantPressureQuest (player, npc);
//-- NPC: You'll be dead, but it's your funeral. Here's the location.
string_id message = new string_id (c_stringFile, "s_56");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I doubt you've been all the way out to Mt. Chaolt already...
//-- [RESPONSE NOTE]
//-- PLAYER: Yeah, just going there now.
if (response == "s_68")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "tap_foot");
//-- NPC: Of course.
string_id message = new string_id (c_stringFile, "s_69");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What? Can't you see I'm busy?
//-- [RESPONSE NOTE]
//-- PLAYER: I've come to ask about a requisition for supplies.
if (response == "s_63")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
//-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need?
string_id message = new string_id (c_stringFile, "s_65");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_76");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 22);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch22 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, that's what a Quartermaster is for, after all. But I'm afriad that I don't have much on-hand. What do you need?
//-- [RESPONSE NOTE]
//-- PLAYER: Nym's Water Treatment Technician needs Cationic Chemical Coagulant.
if (response == "s_76")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "rub_chin_thoughtful");
//-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does.
string_id message = new string_id (c_stringFile, "s_78");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just tell me who and where.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_80");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 23);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_quatermaster_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hmm... clean water would be nice for a change. Tell you what, I don't have it, but I know someone who owes Nym a favor who does.
//-- [RESPONSE NOTE]
//-- PLAYER: Just tell me who and where.
if (response == "s_80")
{
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
nym_themepark_quatermaster_action_grantSmugglerQuest (player, npc);
//-- NPC: Here's the location to a Smuggler by the name of Dak. I'm afraid he's way out by Mt. Chaolt...
string_id message = new string_id (c_stringFile, "s_82");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.nym_themepark_quatermaster");
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.nym_themepark_quatermaster");
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_themepark_quatermaster_condition_isAlmostDone (player, npc))
{
doAnimationAction (npc, "celebrate");
nym_themepark_quatermaster_action_signalAgentSafe (player, npc);
//-- NPC: I just heard from Rei and it was a close thing but the supplies made it to him in time. I owe you my thanks.
string_id message = new string_id (c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That's what he said. The thanks is welcome but the part would be more so...
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_17");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 1);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_hasFailedDelivery (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: I just heard from Rei and he's still waiting! What are you doing back here?!
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I didn't make it in time and the supplies expired.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_20");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 3);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (player, npc))
{
doAnimationAction (npc, "point_accusingly");
//-- NPC: What are you still doing here?!
string_id message = new string_id (c_stringFile, "s_73");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I... um... I...
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_74");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 5);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_isOnThridQuest (player, npc))
{
doAnimationAction (npc, "tap_foot");
nym_themepark_quatermaster_action_signalThirdJumperQuestDone (player, npc);
//-- NPC: Oh for Nym's sake, what now?!
string_id message = new string_id (c_stringFile, "s_13");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Motor Power Regulator. I need one.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_15");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 7);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (player, npc))
{
doAnimationAction (npc, "cover_mouth");
//-- NPC: Couldn't take the pressure, eh?
string_id message = new string_id (c_stringFile, "s_70");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That was bad. No just taking a break.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_71");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 12);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_isOnSecondQuest (player, npc))
{
nym_themepark_quatermaster_action_signalSecondJumperQuestDone (player, npc);
//-- NPC: Back again? Need more chemicals?
string_id message = new string_id (c_stringFile, "s_34");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No chemicals; Flow Control Valves, this time.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_36");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 14);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (player, npc))
{
doAnimationAction (npc, "tap_foot");
//-- NPC: I doubt you've been all the way out to Mt. Chaolt already...
string_id message = new string_id (c_stringFile, "s_67");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yeah, just going there now.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_68");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 19);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition_isOnFirstQuest (player, npc))
{
doAnimationAction (npc, "tap_foot");
nym_themepark_quatermaster_action_signalFirstJumperQuestDone (player, npc);
//-- NPC: What? Can't you see I'm busy?
string_id message = new string_id (c_stringFile, "s_61");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I've come to ask about a requisition for supplies.
boolean hasResponse0 = false;
if (nym_themepark_quatermaster_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_63");
utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 21);
npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_quatermaster_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
//-- NPC: I'm too busy for idle chit-chat. Go talk to someone in the Stronghold proper.
string_id message = new string_id (c_stringFile, "s_84");
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_themepark_quatermaster")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
if (branchId == 1 && nym_themepark_quatermaster_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && nym_themepark_quatermaster_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && nym_themepark_quatermaster_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && nym_themepark_quatermaster_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && nym_themepark_quatermaster_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && nym_themepark_quatermaster_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && nym_themepark_quatermaster_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && nym_themepark_quatermaster_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && nym_themepark_quatermaster_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && nym_themepark_quatermaster_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && nym_themepark_quatermaster_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && nym_themepark_quatermaster_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && nym_themepark_quatermaster_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && nym_themepark_quatermaster_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 22 && nym_themepark_quatermaster_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && nym_themepark_quatermaster_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================