Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/npe_pilot_hard.script
T
2013-09-10 23:17:15 -07:00

1597 lines
45 KiB
Plaintext

// ======================================================================
//
// npe_pilot_hard.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/npe_pilot_hard";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_pilot_hard_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_isOnMission (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_pilot_hard_1", "launch") ||
groundquests.isTaskActive(player, "npe_pilot_hard_1", "onSpaceQuest") ||
groundquests.isTaskActive(player, "npe_pilot_hard_2", "launch") ||
groundquests.isTaskActive(player, "npe_pilot_hard_2", "onSpaceQuest") ||
groundquests.isTaskActive(player, "npe_pilot_hard_3", "launch") ||
groundquests.isTaskActive(player, "npe_pilot_hard_3", "onSpaceQuest"));
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasCompletedMed (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_pilot_medium_4");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_doneWithPilot (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_pilot_hard_3");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasFailedHardMission1 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_pilot_hard_1", "failedHard1");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasWonHardMission1 (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_pilot_hard_1") ||
groundquests.isTaskActive(player,"npe_pilot_hard_1", "report"));
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasFailedHardMission2 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_pilot_hard_2", "failedHard2");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasWonHardMission2 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_pilot_hard_2", "report");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasFailedHardMission3 (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_pilot_hard_3", "failedHard3");
}
// ----------------------------------------------------------------------
boolean npe_pilot_hard_condition_hasWonHardMission3 (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_pilot_hard_3") ||
groundquests.isTaskActive(player, "npe_pilot_hard_3", "report"));
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_pilot_hard_action_grantReward (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "reported");
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_facePlayer (obj_id player, obj_id npc)
{
faceTo(npc,player);
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_removeDartas3 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "talktome");
removeObjVar (player, "dartas3");
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_grantHardMission2 (obj_id player, obj_id npc)
{
//clear space quests
space_quest.clearQuestFlags(player, "destroy", "npe_hard_main_2");
space_quest.clearQuestFlags(player, "assassinate", "npe_hard_main_2a");
space_quest.clearQuestFlags(player, "destroy", "npe_hard_main_2b");
space_quest.clearQuestFlags(player, "assassinate", "npe_hard_main_2c");
space_quest.clearQuestFlags(player, "patrol", "npe_hard_main_2d");
//clear ground quest
groundquests.clearQuest(player, "npe_pilot_hard_2");
//regrant ground quest
groundquests.grantQuest(player, "npe_pilot_hard_2");
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_grantHardMission1 (obj_id player, obj_id npc)
{
//clear the space quests
space_quest.clearQuestFlags(player, "destroy", "npe_hard_main_1");
space_quest.clearQuestFlags(player, "destroy", "npe_hard_main_1a");
space_quest.clearQuestFlags(player, "patrol", "npe_hard_main_1b");
//clear the ground quest
groundquests.clearQuest(player, "npe_pilot_hard_1");
//regrant the groundquest
groundquests.grantQuest(player, "npe_pilot_hard_1");
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_grantHardMission3 (obj_id player, obj_id npc)
{
//clear space quests
space_quest.clearQuestFlags(player, "destroy", "npe_hard_main_3");
space_quest.clearQuestFlags(player, "assassinate", "npe_hard_main_3a");
space_quest.clearQuestFlags(player, "destroy_surpriseattack", "npe_hard_main_3b");
space_quest.clearQuestFlags(player, "space_battle", "npe_hard_main_3c");
space_quest.clearQuestFlags(player, "patrol", "npe_hard_main_3d");
//clear ground quest
groundquests.clearQuest(player, "npe_pilot_hard_3");
//regrant ground quest
groundquests.grantQuest(player, "npe_pilot_hard_3");
faceTo(npc,player);
}
// ----------------------------------------------------------------------
void npe_pilot_hard_action_signalFoundDartas (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "talktome");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int npe_pilot_hard_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah, the hero has returned. I hope all is well with you, my friend.
//-- [RESPONSE NOTE]
//-- PLAYER: Indeed, it is. Just checking on things.
if (response == "s_90")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: Carry on.
string_id message = new string_id (c_stringFile, "s_91");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah ha! The hero of the day! You were great out there! You ensured our victory against the Black Sun.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm glad I could have helped out!
if (response == "s_47")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Indeed. Well, there's nothing more to help with around here. Enjoy the rest the Tansarii Point Station has to offer.
string_id message = new string_id (c_stringFile, "s_48");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, sir. It was great working with you.
boolean hasResponse0 = false;
if (npe_pilot_hard_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.npe_pilot_hard.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Indeed. Well, there's nothing more to help with around here. Enjoy the rest the Tansarii Point Station has to offer.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, sir. It was great working with you.
if (response == "s_49")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute1");
//-- NPC: I feel the same way. Good working with you, kid.
string_id message = new string_id (c_stringFile, "s_50");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Once I'm out of here, how do I continue my piloting?
boolean hasResponse0 = false;
if (npe_pilot_hard_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_73");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I feel the same way. Good working with you, kid.
//-- [RESPONSE NOTE]
//-- PLAYER: Once I'm out of here, how do I continue my piloting?
if (response == "s_73")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: When you return to whatever planet you're destined to, you'll get several messages through the mail system regarding different paths. It should all become apparant once you pick your home.
string_id message = new string_id (c_stringFile, "s_74");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay. Thank you again!
boolean hasResponse0 = false;
if (npe_pilot_hard_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_75");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: When you return to whatever planet you're destined to, you'll get several messages through the mail system regarding different paths. It should all become apparant once you pick your home.
//-- [RESPONSE NOTE]
//-- PLAYER: Okay. Thank you again!
if (response == "s_75")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: Looks like you were brave enough to complete everything that I, Laetin and Aleas gave you to do. We all agree that you deserve this as our token of our eternal gratitude.
string_id message = new string_id (c_stringFile, "s_96");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, sir.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_98");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Looks like you were brave enough to complete everything that I, Laetin and Aleas gave you to do. We all agree that you deserve this as our token of our eternal gratitude.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, sir.
if (response == "s_98")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute1");
npe_pilot_hard_action_grantReward (player, npc);
//-- NPC: Wear it proudly, hero.
string_id message = new string_id (c_stringFile, "s_100");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well done, pilot %TU! Amazing work. You completely destroyed the Dual Moons.
//-- [RESPONSE NOTE]
//-- PLAYER: Glad to be of service.
if (response == "s_112")
{
doAnimationAction (player, "bow");
npe_pilot_hard_action_grantReward (player, npc);
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: Let's launch our final attack. If you have any friends that are pilots, now would be a good time to recruit them to your cause.
string_id message = new string_id (c_stringFile, "s_114");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just put me out there. You'll see I have the skills.
boolean hasResponse0 = false;
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Why?
boolean hasResponse1 = false;
if (npe_pilot_hard_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_88");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_76");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Let's launch our final attack. If you have any friends that are pilots, now would be a good time to recruit them to your cause.
//-- [RESPONSE NOTE]
//-- PLAYER: Just put me out there. You'll see I have the skills.
if (response == "s_88")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute1");
npe_pilot_hard_action_grantHardMission3 (player, npc);
//-- NPC: Then go, and come back safely.
string_id message = new string_id (c_stringFile, "s_85");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Why?
if (response == "s_76")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: We're going to go after the main hub of the Trinity, the Darkveil Eclipse. We too will only be sending our best for this.
string_id message = new string_id (c_stringFile, "s_77");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What's the plan?
boolean hasResponse0 = false;
if (npe_pilot_hard_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_79");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We're going to go after the main hub of the Trinity, the Darkveil Eclipse. We too will only be sending our best for this.
//-- [RESPONSE NOTE]
//-- PLAYER: What's the plan?
if (response == "s_79")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: Destroy their defenses like we did for the Dual Moons. With luck, we'll have enough men to complete this mission.
string_id message = new string_id (c_stringFile, "s_81");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Just put me out there. You'll see I have the skills.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_83");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Destroy their defenses like we did for the Dual Moons. With luck, we'll have enough men to complete this mission.
//-- [RESPONSE NOTE]
//-- PLAYER: Just put me out there. You'll see I have the skills.
if (response == "s_83")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute1");
npe_pilot_hard_action_grantHardMission3 (player, npc);
//-- NPC: Then go, and come back safely.
string_id message = new string_id (c_stringFile, "s_85");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We've got no time to talk about your failures! I don't even want to hear it. Get back out there now.
//-- [RESPONSE NOTE]
//-- PLAYER: But--
if (response == "s_42")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
npe_pilot_hard_action_grantHardMission2 (player, npc);
//-- NPC: Go! When you fall, you get back up. Now do it and succeed this time!
string_id message = new string_id (c_stringFile, "s_43");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Good, you're here. You did well out there. Let's get onto your second assignment.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, sir. What's next?
if (response == "s_104")
{
npe_pilot_hard_action_grantReward (player, npc);
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: It's time to go after the Trinity. We'll finally be rid of the Black Sun once and for all, if we succeed.
string_id message = new string_id (c_stringFile, "s_105");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm ready for anything!
boolean hasResponse0 = false;
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What about their fighters?
boolean hasResponse1 = false;
if (npe_pilot_hard_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_106");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_118");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 19);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It's time to go after the Trinity. We'll finally be rid of the Black Sun once and for all, if we succeed.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm ready for anything!
if (response == "s_106")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
npe_pilot_hard_action_grantHardMission2 (player, npc);
//-- NPC: Good luck out there... You'll be flanked by some of our best pilots, my friend.
string_id message = new string_id (c_stringFile, "s_131");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What about their fighters?
if (response == "s_118")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: We have to destroy the Black Sun fighters that have stationed themselves at each before we go for for the Darkveil Eclipse, the main hub.
string_id message = new string_id (c_stringFile, "s_123");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I understand.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_125");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 21);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We have to destroy the Black Sun fighters that have stationed themselves at each before we go for for the Darkveil Eclipse, the main hub.
//-- [RESPONSE NOTE]
//-- PLAYER: I understand.
if (response == "s_125")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
npe_pilot_hard_action_grantHardMission2 (player, npc);
//-- NPC: Good luck out there... You'll be flanked by some of our best pilots, my friend.
string_id message = new string_id (c_stringFile, "s_131");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch22 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I knew you wouldn't do well. You had that look about you.
//-- [RESPONSE NOTE]
//-- PLAYER: Look. I tried my best up there.
if (response == "s_67")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
//-- NPC: Your best isn't good enough, kid! Now, we still have time to try this again. Go try again!
string_id message = new string_id (c_stringFile, "s_69");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Oh--Yes, sir!
boolean hasResponse0 = false;
if (npe_pilot_hard_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.npe_pilot_hard.branchId", 23);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch23 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Your best isn't good enough, kid! Now, we still have time to try this again. Go try again!
//-- [RESPONSE NOTE]
//-- PLAYER: Oh--Yes, sir!
if (response == "s_71")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
npe_pilot_hard_action_grantHardMission1 (player, npc);
//-- NPC: Rookies these days.
string_id message = new string_id (c_stringFile, "s_80");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch25 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I already have a personal assistant. I don't need another. Now go. I have work to do and you're cluttering up my space.
//-- [RESPONSE NOTE]
//-- PLAYER: Sir, I'm here to fight in the Scarlet Dawn.
if (response == "s_192")
{
npe_pilot_hard_action_signalFoundDartas (player, npc);
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
//-- NPC: I don't have time to argue with you, kid. We're losing pilots left and right! Even if you're fodder, I suppose that'll do. Fine, you're in.
string_id message = new string_id (c_stringFile, "s_133");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What's my first assignment, sir?
boolean hasResponse0 = false;
if (npe_pilot_hard_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_135");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 26);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_pilot_hard_handleBranch26 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I don't have time to argue with you, kid. We're losing pilots left and right! Even if you're fodder, I suppose that'll do. Fine, you're in.
//-- [RESPONSE NOTE]
//-- PLAYER: What's my first assignment, sir?
if (response == "s_135")
{
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
npe_pilot_hard_action_grantHardMission1 (player, npc);
//-- NPC: We need to make precise maneuvers against the Black Sun.
string_id message = new string_id (c_stringFile, "s_137");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_pilot_hard");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
//setCondition( self, CONDITION_SPACE_INTERESTING );
setName( self, "Dartas Pytin (Elite Car'das Pilot)" );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
setName( self, "Dartas Pytin (Elite Car'das Pilot)" );
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.npe_pilot_hard");
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 (npe_pilot_hard_condition_doneWithPilot (player, npc))
{
//-- NPC: Ah, the hero has returned. I hope all is well with you, my friend.
string_id message = new string_id (c_stringFile, "s_89");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Indeed, it is. Just checking on things.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_90");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 1);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_isOnMission (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: You have work to do.
string_id message = new string_id (c_stringFile, "s_235");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasWonHardMission3 (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: Ah ha! The hero of the day! You were great out there! You ensured our victory against the Black Sun.
string_id message = new string_id (c_stringFile, "s_120");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm glad I could have helped out!
boolean hasResponse0 = false;
if (npe_pilot_hard_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_47");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 4);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasFailedHardMission3 (player, npc))
{
npe_pilot_hard_action_grantHardMission3 (player, npc);
//-- NPC: I won't take no for an answer! Do whatever it takes to ensure that we are victorious!
string_id message = new string_id (c_stringFile, "s_119");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasWonHardMission2 (player, npc))
{
doAnimationAction (npc, "salute1");
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: Well done, pilot %TU! Amazing work. You completely destroyed the Dual Moons.
string_id message = new string_id (c_stringFile, "s_111");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Glad to be of service.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_112");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 11);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_pilot_hard", null, pp, responses);
}
else
{
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasFailedHardMission2 (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: We've got no time to talk about your failures! I don't even want to hear it. Get back out there now.
string_id message = new string_id (c_stringFile, "s_110");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: But--
boolean hasResponse0 = false;
if (npe_pilot_hard_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.npe_pilot_hard.branchId", 16);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasWonHardMission1 (player, npc))
{
doAnimationAction (npc, "nod");
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: Good, you're here. You did well out there. Let's get onto your second assignment.
string_id message = new string_id (c_stringFile, "s_102");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, sir. What's next?
boolean hasResponse0 = false;
if (npe_pilot_hard_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.npe_pilot_hard.branchId", 18);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasFailedHardMission1 (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: I knew you wouldn't do well. You had that look about you.
string_id message = new string_id (c_stringFile, "s_101");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Look. I tried my best up there.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_67");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 22);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition_hasCompletedMed (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: I already have a personal assistant. I don't need another. Now go. I have work to do and you're cluttering up my space.
string_id message = new string_id (c_stringFile, "s_190");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sir, I'm here to fight in the Scarlet Dawn.
boolean hasResponse0 = false;
if (npe_pilot_hard_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_192");
utils.setScriptVar (player, "conversation.npe_pilot_hard.branchId", 25);
npcStartConversation (player, npc, "npe_pilot_hard", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_pilot_hard_condition__defaultCondition (player, npc))
{
npe_pilot_hard_action_facePlayer (player, npc);
//-- NPC: Look, I don't have time to deal with you now. If you want to fly for me, start by talking to Serissu.
string_id message = new string_id (c_stringFile, "s_94");
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 != "npe_pilot_hard")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_pilot_hard.branchId");
if (branchId == 1 && npe_pilot_hard_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && npe_pilot_hard_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && npe_pilot_hard_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && npe_pilot_hard_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && npe_pilot_hard_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && npe_pilot_hard_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && npe_pilot_hard_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && npe_pilot_hard_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && npe_pilot_hard_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && npe_pilot_hard_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && npe_pilot_hard_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && npe_pilot_hard_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && npe_pilot_hard_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && npe_pilot_hard_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 22 && npe_pilot_hard_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 23 && npe_pilot_hard_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 25 && npe_pilot_hard_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 26 && npe_pilot_hard_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.npe_pilot_hard.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================