mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
* Code compiles - execution NOT tested * updating gitignore * Removed intellij settings files * Removed more intellij files * Added exclusion for JDK classes. * Fixed purchasing script for vendors that have listed coin types. * Updated script to not kick off until the entire preload is complete. * adds static name entry for Solo movie poster and tcg9 vendor entry * clean up empty and orphaned object templates * adds placeholder black market (static) spawns * corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors * Updated gitignore and removed intellij project files * Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src * Fixed appearance and template for terminal (#2) * Fixed appearance and template for terminal (#3) * Fixed appearance and template for terminal (#4) * Deleted another faulty/orphaned object template * Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges. * Fixed some unneeded java 11 changes
1577 lines
70 KiB
Java
Executable File
1577 lines
70 KiB
Java
Executable File
package script.conversation;
|
|
|
|
import script.library.*;
|
|
import script.*;
|
|
|
|
public class npe_marksman_questgiver extends script.base_script
|
|
{
|
|
public npe_marksman_questgiver()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/npe_marksman_questgiver";
|
|
public boolean npe_marksman_questgiver_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedCarbine(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_carbine");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskCompeteMain(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_marksman", "npe_marksman_wait");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedPistol(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_pistol");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedRifle(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "npe_marksman_rifle");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskActiveAny(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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"));
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedAll(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_marksman_pistol") && groundquests.hasCompletedQuest(player, "npe_marksman_carbine") && groundquests.hasCompletedQuest(player, "npe_marksman_rifle"));
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedAnyTraining(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return ((groundquests.hasCompletedQuest(player, "npe_marksman_pistol") || groundquests.hasCompletedQuest(player, "npe_marksman_carbine") || groundquests.hasCompletedQuest(player, "npe_marksman_rifle")) && (!groundquests.isQuestActiveOrComplete(player, "npe_marksman")));
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskCompletePistol(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_marksman_pistol", "npe_marksman_pistol_wait");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedMyDroid(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "npe_marksman") && !groundquests.hasCompletedQuest(player, "npe_side3"));
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskCompleteRifle(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_marksman_rifle", "npe_marksman_rifle_wait");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskCompleteCarbine(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_marksman_carbine", "npe_marksman_carbine_wait");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasTakenAnyQuests(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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"));
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedTemplate(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return hasObjVar(player, "npe.finishedTemplate");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_canStillTrain(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return !npe_marksman_questgiver_condition_hasCompletedAll(player, npc);
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasCompletedDroidEng(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_side3") && !groundquests.isQuestActiveOrComplete(player, "npe_side_hutt_slicers");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_isTaskCompleteSlice(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isTaskActive(player, "npe_side_hutt_slicers", "npe_side_hutt_slicer_return");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_cantHelp(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return !npe_marksman_questgiver_condition_pointedToHere(player, npc) && !npe_marksman_questgiver_condition_hasCompletedTemplate(player, npc);
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_pointedToHere(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestActive(player, "npe_pointer_marksman");
|
|
}
|
|
public boolean npe_marksman_questgiver_condition_hasFinishedAllQuests(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "npe_side_hutt_slicers");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveRifleQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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);
|
|
for (obj_id obj_id : playerStuff) {
|
|
String templateName = static_item.getStaticItemName(obj_id);
|
|
if (templateName != null) {
|
|
if (templateName.equals("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);
|
|
}
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSignalDroidPistol(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveCarbineQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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);
|
|
for (obj_id obj_id : playerStuff) {
|
|
String templateName = static_item.getStaticItemName(obj_id);
|
|
if (templateName != null) {
|
|
if (templateName.equals("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);
|
|
}
|
|
}
|
|
public void npe_marksman_questgiver_action_givePistolQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "npe_marksman_pistol");
|
|
groundquests.sendSignal(player, "talked_to_loche");
|
|
npe.giveAutoPopUp(player, npc);
|
|
}
|
|
public void npe_marksman_questgiver_action_giveDroidQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.requestGrantQuest(player, "npe_marksman");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSingalPistol(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSignalRifle(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
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");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSignalCarbine(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.sendSignal(player, "npe_marksman_carbine");
|
|
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
|
|
groundquests.sendSignal(player, "finished_loche");
|
|
}
|
|
public void npe_marksman_questgiver_action_pointDroidEng(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "npe_job_pointer_droid_engineer");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSlicerQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.requestGrantQuest(player, "npe_side_hutt_slicers");
|
|
}
|
|
public void npe_marksman_questgiver_action_giveSignalSliceComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.sendSignal(player, "npe_side_hutt_slicer_return");
|
|
npe.sendDelayed3poPopup(player, 3, 11, "sound/c3po_29.snd", "npe", "pop_credits", "npe.credits");
|
|
}
|
|
public void npe_marksman_questgiver_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_255"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_89"))
|
|
{
|
|
doAnimationAction(player, "apologize");
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "nod");
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_231"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSignalSliceComplete(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_440");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_442"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_191"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_195");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_438"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSlicerQuest(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_219");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
}
|
|
if (response.equals("s_199"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_203");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_207"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_215");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_217"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSlicerQuest(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_219");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
}
|
|
if (response.equals("s_225"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_221"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_247"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_pointDroidEng(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_127"))
|
|
{
|
|
doAnimationAction(player, "feed_creature_medium");
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_133");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_135"))
|
|
{
|
|
doAnimationAction(player, "bow");
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSignalDroidPistol(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_156"))
|
|
{
|
|
doAnimationAction(player, "bow");
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSignalRifle(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_164"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSignalCarbine(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_160"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveSingalPistol(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_190"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_192");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
if (response.equals("s_83"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_84");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (!npe_marksman_questgiver_condition_hasCompletedPistol(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (!npe_marksman_questgiver_condition_hasCompletedCarbine(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_194"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveDroidQuest(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_196");
|
|
utils.removeScriptVar(player, "conversation.npe_marksman_questgiver.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_429"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_430");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_194"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveDroidQuest(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_196");
|
|
utils.removeScriptVar(player, "conversation.npe_marksman_questgiver.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_429"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_430");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_85"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_98");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
}
|
|
if (response.equals("s_91"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_111");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
}
|
|
if (response.equals("s_95"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_117");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_107"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_givePistolQuest(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_113"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveCarbineQuest(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_121"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_giveRifleQuest(player, npc);
|
|
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;
|
|
}
|
|
public int npe_marksman_questgiver_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_181"))
|
|
{
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if ((!isMob(self)) || (isPlayer(self)))
|
|
{
|
|
detachScript(self, "conversation.npe_marksman_questgiver");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
setName(self, "Loche Crestingsky");
|
|
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
setName(self, "Loche Crestingsky");
|
|
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException
|
|
{
|
|
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;
|
|
}
|
|
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
|
{
|
|
clearCondition(self, CONDITION_CONVERSABLE);
|
|
detachScript(self, "conversation.npe_marksman_questgiver");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException
|
|
{
|
|
Object[] objects = new Object[responses.length];
|
|
System.arraycopy(responses, 0, objects, 0, responses.length);
|
|
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
|
|
}
|
|
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException
|
|
{
|
|
obj_id npc = self;
|
|
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (npe_marksman_questgiver_condition_hasFinishedAllQuests(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_253");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskActiveAny(player, npc))
|
|
{
|
|
doAnimationAction(npc, "shake_head_disgust");
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_88");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskCompleteSlice(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_229");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_hasCompletedDroidEng(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_187");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_hasCompletedMyDroid(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_172");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskCompeteMain(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_124");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskCompleteRifle(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_92");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskCompleteCarbine(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_93");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_isTaskCompletePistol(player, npc))
|
|
{
|
|
doAnimationAction(player, "nod");
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_94");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_hasCompletedTemplate(player, npc))
|
|
{
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_185");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
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;
|
|
}
|
|
if (!npe_marksman_questgiver_condition_hasCompletedTemplate(player, npc))
|
|
{
|
|
doAnimationAction(npc, "check_wrist_device");
|
|
npe_marksman_questgiver_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_96");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
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;
|
|
}
|
|
if (npe_marksman_questgiver_condition_cantHelp(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_258");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (npe_marksman_questgiver_condition__defaultCondition(player, npc))
|
|
{
|
|
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;
|
|
}
|
|
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException
|
|
{
|
|
if (!conversationId.equals("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;
|
|
}
|
|
}
|