mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
1490 lines
43 KiB
Plaintext
1490 lines
43 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// npe_pilot_training.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.npe;
|
|
include library.skill;
|
|
include library.space_quest;
|
|
include library.space_utils;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/npe_pilot_training";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean npe_pilot_training_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasFailedTrainMission1 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "failedTraining_1") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "failedTraining_1b"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_isOnMission (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "accessSpace") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_training_2", "launch") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_training_3", "launch"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasWonTrainMission1 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_pilot_first_mission_no_ground") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "returnToSerissu"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_startedEasy (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "npe_pilot_easy_1");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasFailedTrainMission2 (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_pilot_training_2", "failedTraining_2");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasWonTrainMission2 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_pilot_training_2") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_training_2", "report"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasFailedTrainMission3 (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_pilot_training_3", "failedTraining3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_hasWonTrainMission3 (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_pilot_training_3") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_training_3", "report"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_noShip (obj_id player, obj_id npc)
|
|
{
|
|
return (!space_utils.hasShip(player) &&
|
|
groundquests.isQuestActiveOrComplete(player, "npe_pilot_first_mission_no_ground"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_onFirstQuest (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "accessSpace") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "training_1") ||
|
|
groundquests.isTaskActive(player, "npe_pilot_first_mission_no_ground", "training_1b"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean npe_pilot_training_condition_canTakeQuest (obj_id player, obj_id npc)
|
|
{
|
|
return hasObjVar(player, "npe.finishedTemplate");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void npe_pilot_training_action_grantTrainMission1 (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.clearQuestFlags(player, "patrol", "npe_training_1");
|
|
space_quest.clearQuestFlags(player, "patrol", "npe_training_1b");
|
|
groundquests.clearQuest(player, "npe_pilot_first_mission_no_ground");
|
|
groundquests.grantQuest(player, "npe_pilot_first_mission_no_ground");
|
|
if(!hasObjVar(player, npe.QUEST_REWORK_VAR))
|
|
setObjVar(player, npe.QUEST_REWORK_VAR, npe.QUEST_ENUMERATION);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantTrainMission2 (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.clearQuestFlags(player, "patrol", "npe_training_2");
|
|
space_quest.clearQuestFlags(player, "destroy", "npe_training_2a");
|
|
space_quest.clearQuestFlags(player, "patrol", "npe_training_2b");
|
|
groundquests.clearQuest(player, "npe_pilot_training_2");
|
|
groundquests.grantQuest(player, "npe_pilot_training_2");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantTrainMission3 (obj_id player, obj_id npc)
|
|
{
|
|
space_quest.clearQuestFlags(player, "escort", "npe_training_3");
|
|
space_quest.clearQuestFlags(player, "patrol", "npe_training_3a");
|
|
groundquests.clearQuest(player, "npe_pilot_training_3");
|
|
groundquests.grantQuest(player, "npe_pilot_training_3");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantTrainMissionNoGround (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "npe_pilot_first_mission_no_ground");
|
|
if(!hasObjVar(player, npe.QUEST_REWORK_VAR))
|
|
setObjVar(player, npe.QUEST_REWORK_VAR, npe.QUEST_ENUMERATION);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantReward1 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "reported");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantReward2 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "reported");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantReward3 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "reported");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantTalktoLaetin (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "npe_pilot_laetin2");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_giveShip (obj_id player, obj_id npc)
|
|
{
|
|
if (!space_utils.hasShip (player))
|
|
{
|
|
space_quest.grantNewbieShip( player, "neutral");
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_grantNoviceSkill (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "found_serissu");
|
|
groundquests.sendSignal(player, "giveBasicTraining");
|
|
|
|
if (!space_utils.hasShip (player))
|
|
{
|
|
space_quest.grantNewbieShip( player, "neutral");
|
|
}
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void npe_pilot_training_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc,player);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int npe_pilot_training_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I think you're already on one of my assignments. You should get that finished and then come back for more work. You're so eager!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you. I'll return to my duty.
|
|
if (response == "s_297")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "salute1");
|
|
|
|
//-- NPC: Good luck!
|
|
string_id message = new string_id (c_stringFile, "s_298");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE] Get mission 4
|
|
//-- NPC: Ha! You're a great pilot, my friend! Unfortunately, you've cleared all your assignments. Well... at least the ones I can give you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you mean?
|
|
if (response == "s_132")
|
|
{
|
|
npe_pilot_training_action_grantReward3 (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, if you're interested in continuing on in Ord Mantell, you should seek out Laetin. Mind you, he has much more challenging assignments.
|
|
string_id message = new string_id (c_stringFile, "s_134");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Where is he?
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_78");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, if you're interested in continuing on in Ord Mantell, you should seek out Laetin. Mind you, he has much more challenging assignments.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where is he?
|
|
if (response == "s_78")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "wave1");
|
|
|
|
npe_pilot_training_action_grantTalktoLaetin (player, npc);
|
|
|
|
//-- NPC: Oh. He's over there in the offices. I hope to see you around!
|
|
string_id message = new string_id (c_stringFile, "s_79");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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.npe_pilot_training.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh. He's over there in the offices. I hope to see you around!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you.
|
|
if (response == "s_54")
|
|
{
|
|
doAnimationAction (player, "bow");
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good bye now!
|
|
string_id message = new string_id (c_stringFile, "s_55");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: %TU, are you okay? What happened?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I didn't make it. But I'll do it this time. Trust me!
|
|
if (response == "s_281")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
//-- NPC: Okay. Try it again. I hope this time it'll go well for you.
|
|
string_id message = new string_id (c_stringFile, "s_282");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you, ma'am!
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_283");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Okay. Try it again. I hope this time it'll go well for you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you, ma'am!
|
|
if (response == "s_283")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantTrainMission3 (player, npc);
|
|
|
|
//-- NPC: Come back with good news, my friend!
|
|
string_id message = new string_id (c_stringFile, "s_284");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE] Get mission 3
|
|
//-- NPC: I'm glad you are back for more %TU, we could use all the help we can get here.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Not a problem, I'm happy to assist.
|
|
if (response == "s_154")
|
|
{
|
|
npe_pilot_training_action_grantReward2 (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Now on to your next assignment. One of our officers needs an escort from the station to a Hyperspace Point beyond. With all the pirate activity lately, I needed a good pilot to make sure he reaches it safely and you will be perfect.
|
|
string_id message = new string_id (c_stringFile, "s_189");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will do my best.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_193");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Now on to your next assignment. One of our officers needs an escort from the station to a Hyperspace Point beyond. With all the pirate activity lately, I needed a good pilot to make sure he reaches it safely and you will be perfect.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will do my best.
|
|
if (response == "s_193")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantTrainMission3 (player, npc);
|
|
|
|
//-- NPC: Good. Be careful out there, the Black Sun are everywhere lately.
|
|
string_id message = new string_id (c_stringFile, "s_197");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I just heard of your misfortune.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I know. I'm so sorry. The Black Sun are vicious.
|
|
if (response == "s_265")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I fully understand. I have no doubt that they're still there. Go get them!
|
|
string_id message = new string_id (c_stringFile, "s_270");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yes, ma'am! I'm on it!
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_271");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I fully understand. I have no doubt that they're still there. Go get them!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, ma'am! I'm on it!
|
|
if (response == "s_271")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantTrainMission2 (player, npc);
|
|
|
|
//-- NPC: Good to hear. I hope to see you victorious!
|
|
string_id message = new string_id (c_stringFile, "s_272");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE] Get mission 2
|
|
//-- NPC: You did very well out there. Welcome home.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thank you.
|
|
if (response == "s_176")
|
|
{
|
|
npe_pilot_training_action_grantReward1 (player, npc);
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Lately there's been a lot of Black Sun Pirate activity around an abandonded space hulk not far from here. We're not sure what they are doing there but it doesn't matter, pirates are not welcome here! I need you to fly out there and chase off any Black Sun Pirates you find.
|
|
string_id message = new string_id (c_stringFile, "s_201");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll do it!
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_221");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 19);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch19 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Lately there's been a lot of Black Sun Pirate activity around an abandonded space hulk not far from here. We're not sure what they are doing there but it doesn't matter, pirates are not welcome here! I need you to fly out there and chase off any Black Sun Pirates you find.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll do it!
|
|
if (response == "s_221")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantTrainMission2 (player, npc);
|
|
|
|
//-- NPC: Good. Use the Space Terminal to launch in to space and I'll provide you with the coordinates to the abandonded hulk.
|
|
string_id message = new string_id (c_stringFile, "s_223");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch21 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You've come back, but why? Haven't you finished your mission?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I failed. Let me try again.
|
|
if (response == "s_247")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantTrainMission1 (player, npc);
|
|
|
|
//-- NPC: Okay. Well, get back out there! Make us proud.
|
|
string_id message = new string_id (c_stringFile, "s_252");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch24 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What are you doing here, friend?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I was told you could teach me to fly.
|
|
if (response == "s_65")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yes, yes I can. Very well, then. Let's get you started. It would be wise to start on a few training missions. I want to test your skill before we place you on more difficult assignments.
|
|
string_id message = new string_id (c_stringFile, "s_67");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You got it, ma'am!
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_69");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 25);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch25 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yes, yes I can. Very well, then. Let's get you started. It would be wise to start on a few training missions. I want to test your skill before we place you on more difficult assignments.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You got it, ma'am!
|
|
if (response == "s_69")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
npe_pilot_training_action_grantNoviceSkill (player, npc);
|
|
|
|
//-- NPC: I need for you to travel to Station Gamma. We've heard rumors regarding a disturbance. If there isn't a disturbance, however, feel free to land there and check it out if you wish. If not, return, and we'll continue your training.
|
|
string_id message = new string_id (c_stringFile, "s_71");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Understood.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_training.branchId", 26);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int npe_pilot_training_handleBranch26 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I need for you to travel to Station Gamma. We've heard rumors regarding a disturbance. If there isn't a disturbance, however, feel free to land there and check it out if you wish. If not, return, and we'll continue your training.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Understood.
|
|
if (response == "s_73")
|
|
{
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "point_left");
|
|
|
|
npe_pilot_training_action_grantTrainMissionNoGround (player, npc);
|
|
|
|
//-- NPC: Good. Use the green Space Terminal beside me to launch your ship.
|
|
string_id message = new string_id (c_stringFile, "s_75");
|
|
utils.removeScriptVar (player, "conversation.npe_pilot_training.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_training");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setName( self, "Serissu (Pilot Trainer)" );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable( self, true );
|
|
setName( self, "Serissu (Pilot Trainer)" );
|
|
|
|
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);
|
|
faceTo(self, player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.npe_pilot_training");
|
|
|
|
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_training_condition_noShip (player, npc))
|
|
{
|
|
doAnimationAction (npc, "greet");
|
|
|
|
doAnimationAction (player, "greet");
|
|
|
|
npe_pilot_training_action_giveShip (player, npc);
|
|
|
|
//-- NPC: I have your ship repaired and ready %TU. Let me know when you are ready for an assignment.
|
|
string_id message = new string_id (c_stringFile, "s_59");
|
|
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_training_condition_startedEasy (player, npc))
|
|
{
|
|
//-- NPC: Aren't you supposed to be working with Laetin?
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition_isOnMission (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I think you're already on one of my assignments. You should get that finished and then come back for more work. You're so eager!
|
|
string_id message = new string_id (c_stringFile, "s_235");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you. I'll return to my duty.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_297");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Get mission 4
|
|
if (npe_pilot_training_condition_hasWonTrainMission3 (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Ha! You're a great pilot, my friend! Unfortunately, you've cleared all your assignments. Well... at least the ones I can give you.
|
|
string_id message = new string_id (c_stringFile, "s_130");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do you mean?
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_132");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition_hasFailedTrainMission3 (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: %TU, are you okay? What happened?
|
|
string_id message = new string_id (c_stringFile, "s_148");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I didn't make it. But I'll do it this time. Trust me!
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_281");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 9);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", 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] Get mission 3
|
|
if (npe_pilot_training_condition_hasWonTrainMission2 (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I'm glad you are back for more %TU, we could use all the help we can get here.
|
|
string_id message = new string_id (c_stringFile, "s_152");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Not a problem, I'm happy to assist.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_154");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 12);
|
|
|
|
prose_package pp = new prose_package ();
|
|
pp.stringId = message;
|
|
pp.actor.set (player);
|
|
pp.target.set (npc);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", 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_training_condition_hasFailedTrainMission2 (player, npc))
|
|
{
|
|
doAnimationAction (npc, "sigh_deeply");
|
|
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I just heard of your misfortune.
|
|
string_id message = new string_id (c_stringFile, "s_170");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I know. I'm so sorry. The Black Sun are vicious.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_265");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 15);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE] Get mission 2
|
|
if (npe_pilot_training_condition_hasWonTrainMission1 (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You did very well out there. Welcome home.
|
|
string_id message = new string_id (c_stringFile, "s_174");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thank you.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_176");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 18);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition_hasFailedTrainMission1 (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You've come back, but why? Haven't you finished your mission?
|
|
string_id message = new string_id (c_stringFile, "s_188");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I failed. Let me try again.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_247");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 21);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition_onFirstQuest (player, npc))
|
|
{
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You need to use the Green Space Terminal over there to gain access to your ship.
|
|
string_id message = new string_id (c_stringFile, "s_56");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition_canTakeQuest (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod_head_once");
|
|
|
|
npe_pilot_training_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: What are you doing here, friend?
|
|
string_id message = new string_id (c_stringFile, "s_63");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I was told you could teach me to fly.
|
|
boolean hasResponse0 = false;
|
|
if (npe_pilot_training_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_65");
|
|
|
|
utils.setScriptVar (player, "conversation.npe_pilot_training.branchId", 24);
|
|
|
|
npcStartConversation (player, npc, "npe_pilot_training", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (npe_pilot_training_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I am sorry, you must finish your training before you can help me.
|
|
string_id message = new string_id (c_stringFile, "s_77");
|
|
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_training")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.npe_pilot_training.branchId");
|
|
|
|
if (branchId == 3 && npe_pilot_training_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && npe_pilot_training_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && npe_pilot_training_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && npe_pilot_training_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && npe_pilot_training_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && npe_pilot_training_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && npe_pilot_training_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && npe_pilot_training_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && npe_pilot_training_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && npe_pilot_training_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && npe_pilot_training_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 19 && npe_pilot_training_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 21 && npe_pilot_training_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 24 && npe_pilot_training_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 25 && npe_pilot_training_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 26 && npe_pilot_training_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_training.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|