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

2354 lines
68 KiB
Plaintext

// ======================================================================
//
// npe_marksman_questgiver.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.npe;
include library.space_quest;
include library.static_item;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/npe_marksman_questgiver";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_marksman_questgiver_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedCarbine (obj_id player, obj_id npc)
{
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_carbine");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskCompeteMain (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_marksman", "npe_marksman_wait");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedPistol (obj_id player, obj_id npc)
{
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_pistol");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedRifle (obj_id player, obj_id npc)
{
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_rifle");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskActiveAny (obj_id player, obj_id npc)
{
return (groundquests.isTaskActive(player, "npe_marksman_pistol", "npe_marksman_pistol_droid") ||
groundquests.isTaskActive(player, "npe_marksman_carbine", "npe_marksman_carbine_droid") ||
groundquests.isTaskActive(player, "npe_marksman_rifle", "npe_marksman_rifle_droid") ||
groundquests.isTaskActive(player, "npe_marksman", 0) ||
groundquests.isTaskActive(player, "npe_marksman", "npe_marksman_main_droid") ||
groundquests.isTaskActive(player, "npe_side_hutt_slicers", 0) ||
groundquests.isTaskActive(player, "npe_side_hutt_slicers", "npe_side_hutt_hackers_takeout") ||
groundquests.isTaskActive(player, "npe_side_hutt_slicers", "npe_side_hutt_slicer_boss"));
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedAll (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_marksman_pistol") &&
groundquests.hasCompletedQuest(player, "npe_marksman_carbine") &&
groundquests.hasCompletedQuest(player, "npe_marksman_rifle"));
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedAnyTraining (obj_id player, obj_id npc)
{
return ((groundquests.hasCompletedQuest(player, "npe_marksman_pistol") ||
groundquests.hasCompletedQuest(player, "npe_marksman_carbine") ||
groundquests.hasCompletedQuest(player, "npe_marksman_rifle")) &&
(!groundquests.isQuestActiveOrComplete(player, "npe_marksman")));
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskCompletePistol (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_marksman_pistol", "npe_marksman_pistol_wait");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedMyDroid (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_marksman") && !groundquests.hasCompletedQuest(player, "npe_side3"));
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskCompleteRifle (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_marksman_rifle", "npe_marksman_rifle_wait");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskCompleteCarbine (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_marksman_carbine", "npe_marksman_carbine_wait");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasTakenAnyQuests (obj_id player, obj_id npc)
{
return (groundquests.isQuestActiveOrComplete(player, "npe_marksman_pistol") ||
groundquests.isQuestActiveOrComplete(player, "npe_marksman_carbine") ||
groundquests.isQuestActiveOrComplete(player, "npe_marksman_rifle") ||
groundquests.isQuestActiveOrComplete(player, "npe_side_hutt_slicers") ||
groundquests.isQuestActiveOrComplete(player, "npe_marksman"));
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedTemplate (obj_id player, obj_id npc)
{
return hasObjVar(player, "npe.finishedTemplate");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_canStillTrain (obj_id player, obj_id npc)
{
return !npe_marksman_questgiver_condition_hasCompletedAll(player, npc);
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasCompletedDroidEng (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_side3") && !groundquests.isQuestActiveOrComplete(player, "npe_side_hutt_slicers");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_isTaskCompleteSlice (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_side_hutt_slicers", "npe_side_hutt_slicer_return");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_cantHelp (obj_id player, obj_id npc)
{
return !npe_marksman_questgiver_condition_pointedToHere(player, npc) && !npe_marksman_questgiver_condition_hasCompletedTemplate(player, npc);
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_pointedToHere (obj_id player, obj_id npc)
{
return groundquests.isQuestActive(player, "npe_pointer_marksman");
}
// ----------------------------------------------------------------------
boolean npe_marksman_questgiver_condition_hasFinishedAllQuests (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_side_hutt_slicers");
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_marksman_questgiver_action_giveRifleQuest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_marksman_rifle");
groundquests.sendSignal(player, "talked_to_loche");
npe.giveRiflePopUp(player, npc);
npe.giveAutoPopUp(player, npc);
boolean hasItem = false;
obj_id[] weapons = new obj_id[1];
obj_id[] playerStuff = getInventoryAndEquipment(player);
//loop thru players inventory, make sure they dont have the item already.
for(int i =0; i < playerStuff.length; i++)
{
string templateName = static_item.getStaticItemName(playerStuff[i]);
if(templateName != null)
{
if(templateName == "weapon_rifle_02_02")
hasItem = true;
}
}
if(hasItem == false)
{
obj_id rifle = static_item.createNewItemFunction("weapon_rifle_02_02", player);
weapons[0] = rifle;
showLootBox(player, weapons);
}
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSignalDroidPistol (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_marksman_main_pistol");
obj_id pInv = utils.getInventoryContainer(player);
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//static_item.createNewItemFunction("weapon_pistol_02_03", pInv);
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveCarbineQuest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_marksman_carbine");
groundquests.sendSignal(player, "talked_to_loche");
npe.giveCarbinePopUp(player, npc);
npe.giveAutoPopUp(player, npc);
boolean hasItem = false;
obj_id[] weapons = new obj_id[1];
obj_id[] playerStuff = getInventoryAndEquipment(player);
//loop thru players inventory, make sure they dont have the item already.
for(int i =0; i < playerStuff.length; i++)
{
string templateName = static_item.getStaticItemName(playerStuff[i]);
if(templateName != null)
{
if(templateName == "weapon_carbine_02_02")
hasItem = true;
}
}
if(hasItem == false)
{
obj_id carbine = static_item.createNewItemFunction("weapon_carbine_02_02", player);
weapons[0] = carbine;
showLootBox(player, weapons);
}
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_givePistolQuest (obj_id player, obj_id npc)
{
// Apply the first quest to the player here
groundquests.grantQuest(player, "npe_marksman_pistol");
groundquests.sendSignal(player, "talked_to_loche");
//npe.givePistolPopUp(player, npc);
npe.giveAutoPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveDroidQuest (obj_id player, obj_id npc)
{
groundquests.requestGrantQuest(player, "npe_marksman");
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSingalPistol (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_marksman_pistol");
groundquests.sendSignal(player, "finished_loche");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSignalRifle (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_marksman_rifle");
groundquests.sendSignal(player, "finished_loche");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSignalCarbine (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_marksman_carbine");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
//npe.giveCreditPopUp(player, npc);
groundquests.sendSignal(player, "finished_loche");
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_pointDroidEng (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_job_pointer_droid_engineer");
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSlicerQuest (obj_id player, obj_id npc)
{
groundquests.requestGrantQuest(player, "npe_side_hutt_slicers");
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_action_giveSignalSliceComplete (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "npe_side_hutt_slicer_return");
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
}
// ----------------------------------------------------------------------
void npe_marksman_questgiver_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_marksman_questgiver_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have no other tasks that need to be performed. Thank you for everything, %TU.
//-- [RESPONSE NOTE]
//-- PLAYER: My pleasure.
if (response == "s_255")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: I will never forget what you have done for us.
string_id message = new string_id (c_stringFile, "s_257");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What do you want? You haven't even finished the task I gave you.
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, sir. I will come back when I am done!
if (response == "s_89")
{
doAnimationAction (player, "apologize");
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: Good. Go to it.
string_id message = new string_id (c_stringFile, "s_90");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Seeing as how you are back, I can only assume we needn't worry about the slicers anymore?
//-- [RESPONSE NOTE]
//-- PLAYER: Their leader has been dealt with.
if (response == "s_231")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSignalSliceComplete (player, npc);
//-- NPC: Thank you so much. You have done us a great service, %TU. As a reward, please choose a weapon from my collection. I have gathered many useful weapons over the years.
string_id message = new string_id (c_stringFile, "s_440");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_442");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 6);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Thank you so much. You have done us a great service, %TU. As a reward, please choose a weapon from my collection. I have gathered many useful weapons over the years.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_442")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: You have earned it. Thanks to you, I can rest soundly knowing that our systems are safe.
string_id message = new string_id (c_stringFile, "s_444");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The results are back. It looks like they were deliberately tampered with by the Black Sun pirates.
//-- [RESPONSE NOTE]
//-- PLAYER: Why?
if (response == "s_191")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: It was supposed to be a diversion, for some of their slicers.
string_id message = new string_id (c_stringFile, "s_195");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So what are we going to do about it?
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: So they can slice into your systems?
boolean hasResponse1 = false;
if (npe_marksman_questgiver_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_438");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_199");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It was supposed to be a diversion, for some of their slicers.
//-- [RESPONSE NOTE]
//-- PLAYER: So what are we going to do about it?
if (response == "s_438")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSlicerQuest (player, npc);
//-- NPC: Exactly. What I need you to do is go to the lower level and find the slicers and their boss. Most likely, they are in the Data Storage room. The boss will be more difficult to defeat than his underlings, so be careful. Inaldra has given us permission to use any force necessary to deal with them. They cannot gain access to our systems.
string_id message = new string_id (c_stringFile, "s_219");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: All too easy.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_marksman_questgiver.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: So they can slice into your systems?
if (response == "s_199")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Exactly! I knew there was a reason I liked you %TU.
string_id message = new string_id (c_stringFile, "s_203");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So what are we going to do about it?
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_207");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 10);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcSpeak (player, pp);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Exactly! I knew there was a reason I liked you %TU.
//-- [RESPONSE NOTE]
//-- PLAYER: So what are we going to do about it?
if (response == "s_207")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: We are going to do nothing. I cannot get away from training the guards. I need someone else to handle this. Someone I can trust.
string_id message = new string_id (c_stringFile, "s_215");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Someone like me?
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I am not going to do this alone. Find someone else.
boolean hasResponse1 = false;
if (npe_marksman_questgiver_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_217");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_225");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: We are going to do nothing. I cannot get away from training the guards. I need someone else to handle this. Someone I can trust.
//-- [RESPONSE NOTE]
//-- PLAYER: Someone like me?
if (response == "s_217")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSlicerQuest (player, npc);
//-- NPC: Exactly. What I need you to do is go to the lower level and find the slicers and their boss. Most likely, they are in the Data Storage room. The boss will be more difficult to defeat than his underlings, so be careful. Inaldra has given us permission to use any force necessary to deal with them. They cannot gain access to our systems.
string_id message = new string_id (c_stringFile, "s_219");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: All too easy.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_marksman_questgiver.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I am not going to do this alone. Find someone else.
if (response == "s_225")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: I guess you aren't the type of person I thought you were, %TU. Come back when you decide you are.
string_id message = new string_id (c_stringFile, "s_227");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcEndConversationWithMessage (player, pp);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Exactly. What I need you to do is go to the lower level and find the slicers and their boss. Most likely, they are in the Data Storage room. The boss will be more difficult to defeat than his underlings, so be careful. Inaldra has given us permission to use any force necessary to deal with them. They cannot gain access to our systems.
//-- [RESPONSE NOTE]
//-- PLAYER: All too easy.
if (response == "s_221")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Don't get a big head. This will not be easy.
string_id message = new string_id (c_stringFile, "s_223");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Good to see you again, %TU. There is some news. Speak to the Droid Engineer. He has the results from the memory modules.
//-- [RESPONSE NOTE]
//-- PLAYER: Okay.
if (response == "s_247")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_pointDroidEng (player, npc);
//-- NPC: He doesn't seem happy about them either.
string_id message = new string_id (c_stringFile, "s_248");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah, you have returned, %TU. Well, let's have a look at those memory modules.
//-- [RESPONSE NOTE]
//-- PLAYER: Here you are, sir.
if (response == "s_127")
{
doAnimationAction (player, "feed_creature_medium");
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Very good. I will send those to some engineers for them to study. As a way of saying thanks for your help, please choose your reward.
string_id message = new string_id (c_stringFile, "s_133");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you, sir.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_marksman_questgiver.branchId", 18);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Very good. I will send those to some engineers for them to study. As a way of saying thanks for your help, please choose your reward.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you, sir.
if (response == "s_135")
{
doAnimationAction (player, "bow");
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSignalDroidPistol (player, npc);
//-- NPC: Use it well.
string_id message = new string_id (c_stringFile, "s_433");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch20 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well done. I am surprised you felt you needed the practice.
//-- [RESPONSE NOTE]
//-- PLAYER: Never good to let yourself get rusty.
if (response == "s_156")
{
doAnimationAction (player, "bow");
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSignalRifle (player, npc);
//-- NPC: Too true.
string_id message = new string_id (c_stringFile, "s_157");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch22 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You are starting to hold that carbine like a pro.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_164")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSignalCarbine (player, npc);
//-- NPC: I am very impressed.
string_id message = new string_id (c_stringFile, "s_165");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch24 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You are a pretty quick shot.
//-- [RESPONSE NOTE]
//-- PLAYER: My skills seem to be improving.
if (response == "s_160")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveSingalPistol (player, npc);
//-- NPC: Indeed they are.
string_id message = new string_id (c_stringFile, "s_161");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch26 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: %TU! I am glad to see you. I have a task perfectly suited for you, if you feel you are ready.
//-- [RESPONSE NOTE]
//-- PLAYER: I am ready. What would you have me do?
if (response == "s_190")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: I need you to bring me some memory modules from the malfunctioning droids in the lower levels.
string_id message = new string_id (c_stringFile, "s_192");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will do it.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Why those droids?
boolean hasResponse1 = false;
if (npe_marksman_questgiver_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_194");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_429");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice more.
if (response == "s_83")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Very well. What would you like to practice with?
string_id message = new string_id (c_stringFile, "s_84");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I would like to practice with the pistol.
boolean hasResponse0 = false;
if (!npe_marksman_questgiver_condition_hasCompletedPistol (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like to practice with the carbine.
boolean hasResponse1 = false;
if (!npe_marksman_questgiver_condition_hasCompletedCarbine (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I would like to practice with the rifle.
boolean hasResponse2 = false;
if (!npe_marksman_questgiver_condition_hasCompletedRifle (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_85");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_91");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_95");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 30);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch27 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need you to bring me some memory modules from the malfunctioning droids in the lower levels.
//-- [RESPONSE NOTE]
//-- PLAYER: I will do it.
if (response == "s_194")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveDroidQuest (player, npc);
//-- NPC: Good. When you are done, come back to me.
string_id message = new string_id (c_stringFile, "s_196");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Why those droids?
if (response == "s_429")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Those droids seem to have gone haywire. We need to understand what happened to them. I will need you to go down there and bring me some of their memory modules. I will then turn those in to the Droid Engineer for study.
string_id message = new string_id (c_stringFile, "s_430");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will do it.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Why those droids?
boolean hasResponse1 = false;
if (npe_marksman_questgiver_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_194");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_429");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch29 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Those droids seem to have gone haywire. We need to understand what happened to them. I will need you to go down there and bring me some of their memory modules. I will then turn those in to the Droid Engineer for study.
//-- [RESPONSE NOTE]
//-- PLAYER: I will do it.
if (response == "s_194")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveDroidQuest (player, npc);
//-- NPC: Good. When you are done, come back to me.
string_id message = new string_id (c_stringFile, "s_196");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Why those droids?
if (response == "s_429")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Those droids seem to have gone haywire. We need to understand what happened to them. I will need you to go down there and bring me some of their memory modules. I will then turn those in to the Droid Engineer for study.
string_id message = new string_id (c_stringFile, "s_430");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will do it.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Why those droids?
boolean hasResponse1 = false;
if (npe_marksman_questgiver_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_194");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_429");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch30 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Very well. What would you like to practice with?
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice with the pistol.
if (response == "s_85")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Looks like you already have a decent pistol, so try practicing with it on these droids.
string_id message = new string_id (c_stringFile, "s_98");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_107");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 31);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice with the carbine.
if (response == "s_91")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Here. Take this carbine and try practicing on some of the droids here.
string_id message = new string_id (c_stringFile, "s_111");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_113");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 33);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I would like to practice with the rifle.
if (response == "s_95")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Here. Take this rifle and try practicing on some of the droids here.
string_id message = new string_id (c_stringFile, "s_117");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Will do!
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_121");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 35);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch31 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Looks like you already have a decent pistol, so try practicing with it on these droids.
//-- [RESPONSE NOTE]
//-- PLAYER: Thank you.
if (response == "s_107")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_givePistolQuest (player, npc);
//-- NPC: Talk to me when you are done.
string_id message = new string_id (c_stringFile, "s_109");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch33 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Here. Take this carbine and try practicing on some of the droids here.
//-- [RESPONSE NOTE]
//-- PLAYER: I will.
if (response == "s_113")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveCarbineQuest (player, npc);
//-- NPC: Talk to me again when you are done.
string_id message = new string_id (c_stringFile, "s_115");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch35 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Here. Take this rifle and try practicing on some of the droids here.
//-- [RESPONSE NOTE]
//-- PLAYER: Will do!
if (response == "s_121")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
npe_marksman_questgiver_action_giveRifleQuest (player, npc);
//-- NPC: Talk to me when you are done.
string_id message = new string_id (c_stringFile, "s_126");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_marksman_questgiver_handleBranch37 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have no work for you now, but come back later and I might.
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, I will.
if (response == "s_181")
{
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Good bye.
string_id message = new string_id (c_stringFile, "s_183");
utils.removeScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_marksman_questgiver");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
//setCondition(self, CONDITION_INTERESTING);
setName( self, "Loche Crestingsky");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable( self, true );
//setCondition( self, CONDITION_INTERESTING );
setName( self, "Loche Crestingsky");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
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_marksman_questgiver");
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_marksman_questgiver_condition_hasFinishedAllQuests (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: I have no other tasks that need to be performed. Thank you for everything, %TU.
string_id message = new string_id (c_stringFile, "s_253");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: My pleasure.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_255");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 1);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_marksman_questgiver", 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_marksman_questgiver_condition_isTaskActiveAny (player, npc))
{
doAnimationAction (npc, "shake_head_disgust");
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: What do you want? You haven't even finished the task I gave you.
string_id message = new string_id (c_stringFile, "s_88");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, sir. I will come back when I am done!
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_89");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 3);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_isTaskCompleteSlice (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: Seeing as how you are back, I can only assume we needn't worry about the slicers anymore?
string_id message = new string_id (c_stringFile, "s_229");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Their leader has been dealt with.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_231");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 5);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_hasCompletedDroidEng (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: The results are back. It looks like they were deliberately tampered with by the Black Sun pirates.
string_id message = new string_id (c_stringFile, "s_187");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Why?
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_191");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 8);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_hasCompletedMyDroid (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: Good to see you again, %TU. There is some news. Speak to the Droid Engineer. He has the results from the memory modules.
string_id message = new string_id (c_stringFile, "s_172");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_marksman_questgiver.branchId", 15);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_marksman_questgiver", 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_marksman_questgiver_condition_isTaskCompeteMain (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: Ah, you have returned, %TU. Well, let's have a look at those memory modules.
string_id message = new string_id (c_stringFile, "s_124");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Here you are, sir.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_127");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 17);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_marksman_questgiver", 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_marksman_questgiver_condition_isTaskCompleteRifle (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: Well done. I am surprised you felt you needed the practice.
string_id message = new string_id (c_stringFile, "s_92");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Never good to let yourself get rusty.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_156");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 20);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_isTaskCompleteCarbine (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: You are starting to hold that carbine like a pro.
string_id message = new string_id (c_stringFile, "s_93");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thank you.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_164");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 22);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_isTaskCompletePistol (player, npc))
{
doAnimationAction (player, "nod");
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: You are a pretty quick shot.
string_id message = new string_id (c_stringFile, "s_94");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: My skills seem to be improving.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_160");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 24);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_hasCompletedTemplate (player, npc))
{
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: %TU! I am glad to see you. I have a task perfectly suited for you, if you feel you are ready.
string_id message = new string_id (c_stringFile, "s_185");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am ready. What would you have me do?
boolean hasResponse0 = false;
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I would like to practice more.
boolean hasResponse1 = false;
if (npe_marksman_questgiver_condition_canStillTrain (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_190");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_83");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 26);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_marksman_questgiver", 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_marksman_questgiver_condition_hasCompletedTemplate (player, npc))
{
doAnimationAction (npc, "check_wrist_device");
npe_marksman_questgiver_action_facePlayer (player, npc);
//-- NPC: I have no work for you now, but come back later and I might.
string_id message = new string_id (c_stringFile, "s_96");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay, I will.
boolean hasResponse0 = false;
if (npe_marksman_questgiver_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_181");
utils.setScriptVar (player, "conversation.npe_marksman_questgiver.branchId", 37);
npcStartConversation (player, npc, "npe_marksman_questgiver", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition_cantHelp (player, npc))
{
//-- NPC: Can I help you with something?
string_id message = new string_id (c_stringFile, "s_258");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_marksman_questgiver_condition__defaultCondition (player, npc))
{
//-- NPC: Can I help you?
string_id message = new string_id (c_stringFile, "s_82");
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_marksman_questgiver")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_marksman_questgiver.branchId");
if (branchId == 1 && npe_marksman_questgiver_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && npe_marksman_questgiver_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && npe_marksman_questgiver_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && npe_marksman_questgiver_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && npe_marksman_questgiver_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && npe_marksman_questgiver_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && npe_marksman_questgiver_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && npe_marksman_questgiver_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && npe_marksman_questgiver_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && npe_marksman_questgiver_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && npe_marksman_questgiver_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && npe_marksman_questgiver_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 20 && npe_marksman_questgiver_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 22 && npe_marksman_questgiver_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 24 && npe_marksman_questgiver_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 26 && npe_marksman_questgiver_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 27 && npe_marksman_questgiver_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 29 && npe_marksman_questgiver_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 30 && npe_marksman_questgiver_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 31 && npe_marksman_questgiver_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 33 && npe_marksman_questgiver_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 35 && npe_marksman_questgiver_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 37 && npe_marksman_questgiver_handleBranch37 (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_marksman_questgiver.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================