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

1638 lines
43 KiB
Plaintext

// ======================================================================
//
// nova_rank3.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.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/nova_rank3";
// ======================================================================
// Script Conditions
// ======================================================================
boolean nova_rank3_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_isNovaAligned (obj_id player, obj_id npc)
{
return hasCompletedCollectionSlot(player, "nova_rank_01_03");
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_onQuest_01 (obj_id player, obj_id npc)
{
return (groundquests.isQuestActive(player, "nova_rank3_02") &&
!groundquests.isTaskActive(player, "nova_rank3_02", "wait_01"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_winQuest_01 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "nova_rank3_02", "wait_01") ||
groundquests.hasCompletedQuest(player, "nova_rank3_02"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_onQuest_02 (obj_id player, obj_id npc)
{
return (groundquests.isQuestActive(player, "nova_rank3_03") &&
!groundquests.isTaskActive(player, "nova_rank3_03", "wait_01"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_winQuest_02 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "nova_rank3_03", "wait_01") ||
groundquests.hasCompletedQuest(player, "nova_rank3_03"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_onQuest_03 (obj_id player, obj_id npc)
{
return (groundquests.isQuestActive(player, "nova_rank3_04") &&
!groundquests.isTaskActive(player, "nova_rank3_04", "wait_01"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_winQuest_03 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "nova_rank3_04", "wait_01") ||
groundquests.hasCompletedQuest(player, "nova_rank3_04"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_onQuest_04 (obj_id player, obj_id npc)
{
return (groundquests.isQuestActive(player, "nova_rank3_05") &&
!groundquests.isTaskActive(player, "nova_rank3_05", "wait_01"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_winQuest_04 (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "nova_rank3_05", "wait_01"));
}
// ----------------------------------------------------------------------
boolean nova_rank3_condition_finishedAll (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "nova_rank3_05");
}
// ======================================================================
// Script Actions
// ======================================================================
void nova_rank3_action_grantQuest_01 (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "nova_rank3_02");
}
// ----------------------------------------------------------------------
void nova_rank3_action_clearRegrant_01 (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "nova_rank3_02");
space_quest.clearQuestFlags(player, "patrol", "nova_rank3_02");
space_quest.clearQuestFlags(player, "rescue", "nova_rank3_01");
groundquests.grantQuest(player, "nova_rank3_02");
}
// ----------------------------------------------------------------------
void nova_rank3_action_sendQuestSignal_01 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "nova_rank3_02");
}
// ----------------------------------------------------------------------
void nova_rank3_action_grantQuest_02 (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "nova_rank3_03");
}
// ----------------------------------------------------------------------
void nova_rank3_action_sendQuestSignal_02 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "nova_rank3_03");
}
// ----------------------------------------------------------------------
void nova_rank3_action_clearRegrant_02 (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "nova_rank3_03");
space_quest.clearQuestFlags(player, "patrol", "nova_rank3_03");
space_quest.clearQuestFlags(player, "survival", "nova_rank3_01");
groundquests.grantQuest(player, "nova_rank3_03");
}
// ----------------------------------------------------------------------
void nova_rank3_action_grantQuest_03 (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "nova_rank3_04");
}
// ----------------------------------------------------------------------
void nova_rank3_action_clearRegrant_03 (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "nova_rank3_04");
space_quest.clearQuestFlags(player, "patrol", "nova_rank3_04");
space_quest.clearQuestFlags(player, "convoy", "nova_rank3_01");
groundquests.grantQuest(player, "nova_rank3_04");
}
// ----------------------------------------------------------------------
void nova_rank3_action_sendQuestSignal_03 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "nova_rank3_04");
}
// ----------------------------------------------------------------------
void nova_rank3_action_grantQuest_04 (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "nova_rank3_05");
}
// ----------------------------------------------------------------------
void nova_rank3_action_clearRegrant_04 (obj_id player, obj_id npc)
{
groundquests.clearQuest(player, "nova_rank3_05");
space_quest.clearQuestFlags(player, "patrol", "nova_rank3_05");
space_quest.clearQuestFlags(player, "destroy_surpriseattack", "nova_rank3_01");
groundquests.grantQuest(player, "nova_rank3_05");
}
// ----------------------------------------------------------------------
void nova_rank3_action_sendQuestSignal_04 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "nova_rank3_05");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int nova_rank3_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Congratulations. Although there is some bad news too.
//-- [RESPONSE NOTE]
//-- PLAYER: What kind of bad news?
if (response == "s_56")
{
nova_rank3_action_sendQuestSignal_04 (player, npc);
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: While you were out there Orion staged an attack and took out one of our top pilots.
string_id message = new string_id (c_stringFile, "s_57");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So I was just a distraction?
boolean hasResponse0 = false;
if (nova_rank3_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_58");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: While you were out there Orion staged an attack and took out one of our top pilots.
//-- [RESPONSE NOTE]
//-- PLAYER: So I was just a distraction?
if (response == "s_58")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: No, I think they meant to take you both out. This means war.
string_id message = new string_id (c_stringFile, "s_59");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: War?
boolean hasResponse0 = false;
if (nova_rank3_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_60");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No, I think they meant to take you both out. This means war.
//-- [RESPONSE NOTE]
//-- PLAYER: War?
if (response == "s_60")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, we can't let them get away with this. You need to get a promotion so we can use you on the front lines. Jonas Nova will be calling shots at that level.
string_id message = new string_id (c_stringFile, "s_61");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How's the hunt coming?
//-- [RESPONSE NOTE]
//-- PLAYER: Just heading out now.
if (response == "s_52")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: They wont see what hit'em.
string_id message = new string_id (c_stringFile, "s_54");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I need those coordinates again.
if (response == "s_53")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_clearRegrant_04 (player, npc);
//-- NPC: Here, stick it to'em.
string_id message = new string_id (c_stringFile, "s_55");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Nice work on getting that convoy in.
//-- [RESPONSE NOTE]
//-- PLAYER: Someone tipped the Orions off.
if (response == "s_48")
{
nova_rank3_action_sendQuestSignal_03 (player, npc);
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: I think so too. It looks like their number one pilot is out to get you, as well.
string_id message = new string_id (c_stringFile, "s_49");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Not if I get them first.
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I think so too. It looks like their number one pilot is out to get you, as well.
//-- [RESPONSE NOTE]
//-- PLAYER: Not if I get them first.
if (response == "s_50")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_grantQuest_04 (player, npc);
//-- NPC: My thoughts exactly. You should head out to the area they were last seen.
string_id message = new string_id (c_stringFile, "s_51");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Why are you here? You should be with the convoy.
//-- [RESPONSE NOTE]
//-- PLAYER: Just gathering supplies.
if (response == "s_44")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: You must hurry.
string_id message = new string_id (c_stringFile, "s_46");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I lost the coordinates.
if (response == "s_45")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_clearRegrant_03 (player, npc);
//-- NPC: Here, now get out there.
string_id message = new string_id (c_stringFile, "s_47");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Wow, great work! They wont be using those hyperspace lanes anytime soon.
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks, it did get a little hairy out there.
if (response == "s_38")
{
nova_rank3_action_sendQuestSignal_02 (player, npc);
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Nothing you couldn't handle, I'm sure.
string_id message = new string_id (c_stringFile, "s_39");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Obviously, what's next?
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Nothing you couldn't handle, I'm sure.
//-- [RESPONSE NOTE]
//-- PLAYER: Obviously, what's next?
if (response == "s_40")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: We are attempting to get resupplied without Orion stopping us.
string_id message = new string_id (c_stringFile, "s_41");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So we need to get a convoy in here?
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We are attempting to get resupplied without Orion stopping us.
//-- [RESPONSE NOTE]
//-- PLAYER: So we need to get a convoy in here?
if (response == "s_42")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_grantQuest_03 (player, npc);
//-- NPC: Exactly! We need you to make sure they get here as safe as possible.
string_id message = new string_id (c_stringFile, "s_62");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You are supposed to be disrupting those shipping lanes.
//-- [RESPONSE NOTE]
//-- PLAYER: I know, I am heading out now.
if (response == "s_66")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Give it to them.
string_id message = new string_id (c_stringFile, "s_68");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I lost the coordinates.
if (response == "s_70")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_clearRegrant_02 (player, npc);
//-- NPC: Here, now get out there.
string_id message = new string_id (c_stringFile, "s_72");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch22 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Congratulations on springing that trap.
//-- [RESPONSE NOTE]
//-- PLAYER: The Orions didn't know what hit them.
if (response == "s_76")
{
nova_rank3_action_sendQuestSignal_01 (player, npc);
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: I bet they didn't. You ready for your next assignment?
string_id message = new string_id (c_stringFile, "s_78");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: More than ready.
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 23);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I bet they didn't. You ready for your next assignment?
//-- [RESPONSE NOTE]
//-- PLAYER: More than ready.
if (response == "s_80")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: This next one will be fun. We have uncovered some shipping routes that Orion thinks he can use.
string_id message = new string_id (c_stringFile, "s_82");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You want me to go there and cause trouble?
boolean hasResponse0 = false;
if (nova_rank3_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_84");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 24);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch24 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: This next one will be fun. We have uncovered some shipping routes that Orion thinks he can use.
//-- [RESPONSE NOTE]
//-- PLAYER: You want me to go there and cause trouble?
if (response == "s_84")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_grantQuest_02 (player, npc);
//-- NPC: Exactly, get out there and teach them that hyperspace is not safe.
string_id message = new string_id (c_stringFile, "s_86");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch26 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What are you doing here? Shouldn't you be out there springing that trap?
//-- [RESPONSE NOTE]
//-- PLAYER: On my way.
if (response == "s_90")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Good, get going.
string_id message = new string_id (c_stringFile, "s_92");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I lost the coordinates.
if (response == "s_94")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_clearRegrant_01 (player, npc);
//-- NPC: Here they are, now get out there.
string_id message = new string_id (c_stringFile, "s_96");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch29 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome to the new Nova Industries.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, it is a pleasure.
if (response == "s_100")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: We have been tasked with making Orion's life miserable. Can you handle that?
string_id message = new string_id (c_stringFile, "s_102");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It would be my pleasure.
boolean hasResponse0 = false;
if (nova_rank3_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_104");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 30);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch30 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We have been tasked with making Orion's life miserable. Can you handle that?
//-- [RESPONSE NOTE]
//-- PLAYER: It would be my pleasure.
if (response == "s_104")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Good. Our first order of business is to rescue one of our freighters that was attacked by 'pirates'.
string_id message = new string_id (c_stringFile, "s_106");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You think it is a trap?
boolean hasResponse0 = false;
if (nova_rank3_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_108");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 31);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nova_rank3_handleBranch31 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Good. Our first order of business is to rescue one of our freighters that was attacked by 'pirates'.
//-- [RESPONSE NOTE]
//-- PLAYER: You think it is a trap?
if (response == "s_108")
{
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
nova_rank3_action_grantQuest_01 (player, npc);
//-- NPC: I know it is. Let's teach them Orions a lesson.
string_id message = new string_id (c_stringFile, "s_110");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.nova_rank3");
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
{
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
menuInfoData.setServerNotify (false);
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.nova_rank3");
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 (nova_rank3_condition_finishedAll (player, npc))
{
//-- NPC: Get your promotion taken care of. We need you out there. Willard can take care of it for you.
string_id message = new string_id (c_stringFile, "s_7");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_winQuest_04 (player, npc))
{
//-- NPC: Congratulations. Although there is some bad news too.
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What kind of bad news?
boolean hasResponse0 = false;
if (nova_rank3_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_56");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 2);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_onQuest_04 (player, npc))
{
//-- NPC: How's the hunt coming?
string_id message = new string_id (c_stringFile, "s_14");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just heading out now.
boolean hasResponse0 = false;
if (nova_rank3_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I need those coordinates again.
boolean hasResponse1 = false;
if (nova_rank3_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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 6);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_winQuest_03 (player, npc))
{
//-- NPC: Nice work on getting that convoy in.
string_id message = new string_id (c_stringFile, "s_20");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Someone tipped the Orions off.
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 9);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_onQuest_03 (player, npc))
{
//-- NPC: Why are you here? You should be with the convoy.
string_id message = new string_id (c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just gathering supplies.
boolean hasResponse0 = false;
if (nova_rank3_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I lost the coordinates.
boolean hasResponse1 = false;
if (nova_rank3_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_44");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_45");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 12);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_winQuest_02 (player, npc))
{
//-- NPC: Wow, great work! They wont be using those hyperspace lanes anytime soon.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks, it did get a little hairy out there.
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 15);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_onQuest_02 (player, npc))
{
//-- NPC: You are supposed to be disrupting those shipping lanes.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I know, I am heading out now.
boolean hasResponse0 = false;
if (nova_rank3_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I lost the coordinates.
boolean hasResponse1 = false;
if (nova_rank3_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_66");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_70");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 19);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_winQuest_01 (player, npc))
{
//-- NPC: Congratulations on springing that trap.
string_id message = new string_id (c_stringFile, "s_74");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: The Orions didn't know what hit them.
boolean hasResponse0 = false;
if (nova_rank3_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.nova_rank3.branchId", 22);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_onQuest_01 (player, npc))
{
//-- NPC: What are you doing here? Shouldn't you be out there springing that trap?
string_id message = new string_id (c_stringFile, "s_88");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: On my way.
boolean hasResponse0 = false;
if (nova_rank3_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I lost the coordinates.
boolean hasResponse1 = false;
if (nova_rank3_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_90");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_94");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 26);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition_isNovaAligned (player, npc))
{
//-- NPC: Welcome to the new Nova Industries.
string_id message = new string_id (c_stringFile, "s_98");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, it is a pleasure.
boolean hasResponse0 = false;
if (nova_rank3_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_100");
utils.setScriptVar (player, "conversation.nova_rank3.branchId", 29);
npcStartConversation (player, npc, "nova_rank3", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nova_rank3_condition__defaultCondition (player, npc))
{
//-- NPC: Shouldn't you be somewhere else?
string_id message = new string_id (c_stringFile, "s_112");
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 != "nova_rank3")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.nova_rank3.branchId");
if (branchId == 2 && nova_rank3_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && nova_rank3_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && nova_rank3_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && nova_rank3_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && nova_rank3_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && nova_rank3_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && nova_rank3_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && nova_rank3_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && nova_rank3_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && nova_rank3_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && nova_rank3_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 22 && nova_rank3_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && nova_rank3_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 24 && nova_rank3_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 26 && nova_rank3_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 29 && nova_rank3_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 30 && nova_rank3_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 31 && nova_rank3_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.nova_rank3.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================