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

2528 lines
70 KiB
Plaintext

// ======================================================================
//
// village_whip.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.fs_dyn_village;
include library.fs_quests;
include library.quests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/village_whip";
// ======================================================================
// Script Conditions
// ======================================================================
boolean village_whip_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_inprogress (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
if(hasObjVar(player, "quest.fs_reflex1.in_progress")) {
if(!quests.isActive("fs_reflex_rescue_quest_01", player))
return true;
if(hasObjVar(player, "quest.fs_reflex_rescue_quest_01.waypoint")) {
obj_id waypoint = getObjIdObjVar(player, "quest.fs_reflex_rescue_quest_01.waypoint");
obj_id[] wps = getWaypointsInDatapad(player);
boolean match = false;
if(wps != null && wps.length > 0) {
for(int i = 0; i < wps.length; i++) {
if(waypoint == wps[i])
match = true;
}
}
if(!match) {
if(hasObjVar(player, "quest.fs_reflex_rescue_quest_01.selected_location")) {
location loc = getLocationObjVar(player, "quest.fs_reflex_rescue_quest_01.selected_location");
string questName = "fs_reflex_rescue_quest_01";
int x_rand = rand(100, 250);
int z_rand = rand(100, 250);
int x_mod = rand(0, 1);
int z_mod = rand(0, 1);
if(x_mod == 0)
x_rand *= -1;
if(z_mod == 0)
z_rand *= -1;
loc.x += (float)x_rand;
loc.z += (float)z_rand;
obj_id wp = createWaypointInDatapad(player, loc);
string summary = quests.getDataEntry(questName, "JOURNAL_ENTRY_SUMMARY");
if(summary != null && summary.length() > 0) {
setWaypointName(wp, summary);
} else {
setWaypointName(wp, "missing task summary for " + questName);
}
setWaypointColor(wp, "yellow");
setWaypointActive(wp, true);
addLocationTarget(questName + "_waypoint", loc, 32.0f);
setObjVar(player, "quest." + questName + ".waypoint", wp);
}
}
}
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_givequest (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
if (!fs_quests.isVillageEligible(player))
return false;
if (fs_quests.hasQuestAccepted(player))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
return true;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_continue (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
if(hasObjVar(player, "quest.fs_reflex1.continue"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_failed (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
if(hasObjVar(player, "quest.fs_reflex1.failed"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_complete (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
if(quests.isComplete("fs_reflex_rescue_quest_05", player))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_complete (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
if(quests.isComplete("fs_reflex_fetch_quest_04", player))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_continue (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
if(hasObjVar(player, "quest.fs_reflex2.continue"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_failed (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
if(hasObjVar(player, "quest.fs_reflex2.failed"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_givequest (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
if (!fs_quests.isVillageEligible(player))
return false;
if (fs_quests.hasQuestAccepted(player))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
return true;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_inprogress (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
if(hasObjVar(player, "quest.fs_reflex2.in_progress"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase2_aborted (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 2)
return false;
if(hasObjVar(player, "quest.fs_reflex2.aborted"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_not_eligible (obj_id player, obj_id npc)
{
if(!fs_quests.isVillageEligible(player))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase3 (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase == 3)
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase1_aborted (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase != 1)
return false;
if(hasObjVar(player, "quest.fs_reflex1.aborted"))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_quest_accepted (obj_id player, obj_id npc)
{
if(fs_quests.hasQuestAccepted(player))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_quest_completed (obj_id player, obj_id npc)
{
if(fs_quests.hasQuestCompleted(player))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean village_whip_condition_phase4 (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(!isIdValid(master))
return false;
int phase = fs_dyn_village.getCurrentPhaseAuth(master);
if(phase == 4)
return true;
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void village_whip_action_phase1_activate_quest (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(isIdValid(master))
setObjVar(player, "quest.fs_reflex1.master", master);
attachScript(player, "quest.force_sensitive.fs_reflex1_player");
quests.activate("fs_reflex_rescue_quest_00", player, null);
fs_quests.setQuestAccepted(player);
}
// ----------------------------------------------------------------------
void village_whip_action_phase1_continue_quest (obj_id player, obj_id npc)
{
removeObjVar(player, "quest.fs_reflex1.continue");
removeObjVar(player, "quest.fs_reflex1.failed");
removeObjVar(player, "quest.fs_reflex1.aborted");
quests.activate("fs_reflex_rescue_quest_00", player, null);
}
// ----------------------------------------------------------------------
void village_whip_action_phase2_activate_quest (obj_id player, obj_id npc)
{
obj_id master = getObjIdObjVar(npc, "village_master");
if(isIdValid(master))
setObjVar(player, "quest.fs_reflex2.master", master);
attachScript(player, "quest.force_sensitive.fs_reflex2_player");
setObjVar(player, "quest.fs_reflex_fetch_quest_03.target", npc);
quests.activate("fs_reflex_fetch_quest_00", player, null);
fs_quests.setQuestAccepted(player);
}
// ----------------------------------------------------------------------
void village_whip_action_phase2_continue_quest (obj_id player, obj_id npc)
{
removeObjVar(player, "quest.fs_reflex2.continue");
removeObjVar(player, "quest.fs_reflex2.failed");
removeObjVar(player, "quest.fs_reflex2.aborted");
if(utils.playerHasItemByTemplate(player, "object/tangible/item/quest/force_sensitive/fs_reflex_supply_crate.iff")) {
obj_id crate = utils.getItemPlayerHasByTemplate(player, "object/tangible/item/quest/force_sensitive/fs_reflex_supply_crate.iff");
if(isIdValid(crate))
{
removeObjVar (crate, "player");
destroyObject(crate);
}
}
quests.activate("fs_reflex_fetch_quest_00", player, null);
}
// ----------------------------------------------------------------------
void village_whip_action_phase2_abort_in_convo (obj_id player, obj_id npc)
{
removeObjVar(player, "quest.fs_reflex2.in_progress");
setObjVar(player, "quest.fs_reflex2.failed", 1);
for(int i = 0; i <= 6; i++) {
string name = "fs_reflex_fetch_quest_0" + i;
int questId = quests.getQuestId(name);
if(quests.isComplete(name, player)) {
clearCompletedQuest(player, questId);
} else if(quests.isActive(name, player)) {
quests.deactivate(name, player);
}
if(hasObjVar(player, "quest." + name + ".waypoint")) {
obj_id waypoint = getObjIdObjVar(player, "quest." + name + ".waypoint");
if(isIdValid(waypoint))
destroyWaypointInDatapad(waypoint, player);
}
}
obj_id theater = getLastSpawnedTheater(player);
if(isIdValid(theater))
destroyObject(theater);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
int village_whip_tokenDI_villagers_left (obj_id player, obj_id npc)
{
if(!hasObjVar(player, "quest.fs_reflex1.rescued"))
return -1;
int rescued = getIntObjVar(player, "quest.fs_reflex1.rescued");
return (5 - rescued);
}
// ----------------------------------------------------------------------
int village_whip_tokenDI_supplies_left (obj_id player, obj_id npc)
{
if(!hasObjVar(player, "quest.fs_reflex2.rescued"))
return -1;
int rescued = getIntObjVar(player, "quest.fs_reflex2.rescued");
return (6 - rescued);
}
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int village_whip_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Go on now! You've got to go find the missing supplies!
//-- [RESPONSE NOTE]
//-- PLAYER: I need a new beacon location.
if (response == "s_dcf4498e")
{
village_whip_action_phase2_abort_in_convo (player, npc);
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
village_whip_action_phase2_continue_quest (player, npc);
//-- NPC: I understand. Those emergency beacons aren't as reliable as they probably should be. And those Sith Shadows are probably salvaging the last transport as we speak. There, I've loaded a new beacon location for you. Now hurry to Endor before it's too late!
string_id message = new string_id (c_stringFile, "s_e780d201");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Right! I'll get back to it!
if (response == "s_24aab8ee")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Good luck!
string_id message = new string_id (c_stringFile, "s_a80d9308");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It seems like it's one thing after another around here.
//-- [RESPONSE NOTE]
//-- PLAYER: What do you mean?
if (response == "s_77e48d5b")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: The Sith Shadows have been raiding our village for some time now. And now they've taken to attacking our supply transports from Endor.
string_id message = new string_id (c_stringFile, "s_5d4ac8af");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: How does that affect the village?
boolean hasResponse0 = false;
if (village_whip_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_dc446bf8");
utils.setScriptVar (player, "conversation.village_whip.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The Sith Shadows have been raiding our village for some time now. And now they've taken to attacking our supply transports from Endor.
//-- [RESPONSE NOTE]
//-- PLAYER: How does that affect the village?
if (response == "s_dc446bf8")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Well, we haven't received a shipment in some time, and we are in dire need of supplies.
string_id message = new string_id (c_stringFile, "s_550396aa");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Is there anything that I can do to help?
boolean hasResponse0 = false;
if (village_whip_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_a767cb3c");
utils.setScriptVar (player, "conversation.village_whip.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, we haven't received a shipment in some time, and we are in dire need of supplies.
//-- [RESPONSE NOTE]
//-- PLAYER: Is there anything that I can do to help?
if (response == "s_a767cb3c")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: There is, in fact. We are low on manpower and we need someone to go get those supplies for us. We are tracking the emergency beacons from the transports, we just need someone to go there and try to salvage some supplies.
string_id message = new string_id (c_stringFile, "s_6fb14c74");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I think that I can help with that.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: That doesn't sound like something I can do.
boolean hasResponse1 = false;
if (village_whip_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_22d4c864");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_d29a29d0");
utils.setScriptVar (player, "conversation.village_whip.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: There is, in fact. We are low on manpower and we need someone to go get those supplies for us. We are tracking the emergency beacons from the transports, we just need someone to go there and try to salvage some supplies.
//-- [RESPONSE NOTE]
//-- PLAYER: I think that I can help with that.
if (response == "s_22d4c864")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: That's great! If you help us get those supplies, I will help you learn to use the Force to enhance your vehicle control skills.
string_id message = new string_id (c_stringFile, "s_e591b8a3");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, I will go find the missing supplies.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: On second thought, I don't think I can help right now.
boolean hasResponse1 = false;
if (village_whip_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_d9ea288b");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_2fdb8fbd");
utils.setScriptVar (player, "conversation.village_whip.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: That doesn't sound like something I can do.
if (response == "s_d29a29d0")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I understand. Just come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_32");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That's great! If you help us get those supplies, I will help you learn to use the Force to enhance your vehicle control skills.
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, I will go find the missing supplies.
if (response == "s_d9ea288b")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: You must realize that this is not a task to be taken lightly. If you help me with this, you will not be able to assist anyone else for a while. Do you understand?
string_id message = new string_id (c_stringFile, "s_eefb2830");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, that is fine.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Oh, in that case I'd rather not.
boolean hasResponse1 = false;
if (village_whip_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_34ea67b6");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_d7ce4a0d");
utils.setScriptVar (player, "conversation.village_whip.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: On second thought, I don't think I can help right now.
if (response == "s_2fdb8fbd")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I understand. Just come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_29");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You must realize that this is not a task to be taken lightly. If you help me with this, you will not be able to assist anyone else for a while. Do you understand?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, that is fine.
if (response == "s_34ea67b6")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
village_whip_action_phase2_activate_quest (player, npc);
//-- NPC: OK. Here is the location of one of the emergency beacons from a supply transport. Go there, see what you can find, and try to salvage some supplies. But be careful, there are likely to be some Sith Shadows still hanging around.
string_id message = new string_id (c_stringFile, "s_edfab808");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Oh, in that case I'd rather not.
if (response == "s_d7ce4a0d")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I understand. Just come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_106cd909");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch24 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Blast it all, the count is still coming up short. Oh, I'm sorry, hello.
//-- [RESPONSE NOTE]
//-- PLAYER: Hello.
if (response == "s_22a5c907")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Forgive my distraction. It seems we have quite a serious problem on our hands.
string_id message = new string_id (c_stringFile, "s_74140308");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What is the problem?
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm sorry to hear that. Good-bye.
boolean hasResponse1 = false;
if (village_whip_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_7b35cfbc");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_89");
utils.setScriptVar (player, "conversation.village_whip.branchId", 25);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What's the matter?
if (response == "s_a1ba7ed2")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Our struggle against the Sith Shadows has waged for many moons. We just recently repelled an attack against our village, but not without some losses, I'm afraid.
string_id message = new string_id (c_stringFile, "s_39f2cf64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Go on.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm sorry to hear that. Good-bye.
boolean hasResponse1 = false;
if (village_whip_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_edb238bc");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_5d0073c6");
utils.setScriptVar (player, "conversation.village_whip.branchId", 26);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm sorry, I thought you were someone else.
if (response == "s_455e077f")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Very well. Good-bye.
string_id message = new string_id (c_stringFile, "s_a32ebe9e");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch25 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Forgive my distraction. It seems we have quite a serious problem on our hands.
//-- [RESPONSE NOTE]
//-- PLAYER: What is the problem?
if (response == "s_7b35cfbc")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Our struggle against the Sith Shadows has waged for many moons. We just recently repelled an attack against our village, but not without some losses, I'm afraid.
string_id message = new string_id (c_stringFile, "s_39f2cf64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Go on.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm sorry to hear that. Good-bye.
boolean hasResponse1 = false;
if (village_whip_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_edb238bc");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_5d0073c6");
utils.setScriptVar (player, "conversation.village_whip.branchId", 26);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm sorry to hear that. Good-bye.
if (response == "s_89")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Good-bye.
string_id message = new string_id (c_stringFile, "s_91");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch26 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Our struggle against the Sith Shadows has waged for many moons. We just recently repelled an attack against our village, but not without some losses, I'm afraid.
//-- [RESPONSE NOTE]
//-- PLAYER: Go on.
if (response == "s_edb238bc")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I took a head count of both the survivors and the casualties, and the number came up short of what was expected. I fear the worst has happened.
string_id message = new string_id (c_stringFile, "s_40681425");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do you mean?
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I hope they turn up. Good-bye.
boolean hasResponse1 = false;
if (village_whip_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_46");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_8dace66");
utils.setScriptVar (player, "conversation.village_whip.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm sorry to hear that. Good-bye.
if (response == "s_5d0073c6")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Good-bye.
string_id message = new string_id (c_stringFile, "s_c2db6878");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch27 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I took a head count of both the survivors and the casualties, and the number came up short of what was expected. I fear the worst has happened.
//-- [RESPONSE NOTE]
//-- PLAYER: What do you mean?
if (response == "s_46")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I'm afraid that the missing people have been taken prisoner by the Sith Shadows during the last raid on the village. To make matters worse, we don't have enough manpower right now to mount an effective search party to go look for them.
string_id message = new string_id (c_stringFile, "s_e9a9130f");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Is there anything that I can do to help?
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No one noticed they were taken captive?
boolean hasResponse1 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I hope you find them soon. Good-bye.
boolean hasResponse2 = false;
if (village_whip_condition__defaultCondition (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_49");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_551d5a8f");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_80");
utils.setScriptVar (player, "conversation.village_whip.branchId", 28);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I hope they turn up. Good-bye.
if (response == "s_8dace66")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: As do I. Good-bye.
string_id message = new string_id (c_stringFile, "s_85");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch28 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm afraid that the missing people have been taken prisoner by the Sith Shadows during the last raid on the village. To make matters worse, we don't have enough manpower right now to mount an effective search party to go look for them.
//-- [RESPONSE NOTE]
//-- PLAYER: Is there anything that I can do to help?
if (response == "s_49")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I've got my responsibilities here at the village that I need to look after. What we really need is someone that can go out and find the missing people, and bring them back if possible.
string_id message = new string_id (c_stringFile, "s_dc8490a");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That sounds like something that I could do.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Would that be dangerous?
boolean hasResponse1 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: That sounds like a job for someone else.
boolean hasResponse2 = false;
if (village_whip_condition__defaultCondition (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_d18b8c00");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_bf15feab");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_9129fd1b");
utils.setScriptVar (player, "conversation.village_whip.branchId", 29);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No one noticed they were taken captive?
if (response == "s_551d5a8f")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Some of the higher ranking Sith Shadows are gifted in the ways of the Force. It is not unlikely that they were able to influence a few of the weaker members of our village.
string_id message = new string_id (c_stringFile, "s_9359f893");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Is there anything that I can do to help?
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I hope you find them soon. Good-bye.
boolean hasResponse1 = false;
if (village_whip_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_76");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1dac49d2");
utils.setScriptVar (player, "conversation.village_whip.branchId", 38);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I hope you find them soon. Good-bye.
if (response == "s_80")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: As do I. Good-bye.
string_id message = new string_id (c_stringFile, "s_82");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch29 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I've got my responsibilities here at the village that I need to look after. What we really need is someone that can go out and find the missing people, and bring them back if possible.
//-- [RESPONSE NOTE]
//-- PLAYER: That sounds like something that I could do.
if (response == "s_d18b8c00")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: That is excellent news. I appreciate all the help that we can get. There are five people missing from the village. If you can bring them all back alive, I will help you learn to use the Force to enhance your survival skills.
string_id message = new string_id (c_stringFile, "s_8ccc4e47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I understand. I will find the missing villagers.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: On second thought, I don't think I can help right now.
boolean hasResponse1 = false;
if (village_whip_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_d38b8e62");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
utils.setScriptVar (player, "conversation.village_whip.branchId", 30);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Would that be dangerous?
if (response == "s_bf15feab")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I will not deceive you. If the villagers have been captured by the Sith Shadows, there will undoubtedly be guards there. I'm sure they wouldn't let you go without a fight.
string_id message = new string_id (c_stringFile, "s_7e76f08e");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I think that I can help you.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't think that I can help with this task.
boolean hasResponse1 = false;
if (village_whip_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_91bf5d37");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_54d57caf");
utils.setScriptVar (player, "conversation.village_whip.branchId", 35);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: That sounds like a job for someone else.
if (response == "s_9129fd1b")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I understand. Good day to you.
string_id message = new string_id (c_stringFile, "s_72");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch30 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: That is excellent news. I appreciate all the help that we can get. There are five people missing from the village. If you can bring them all back alive, I will help you learn to use the Force to enhance your survival skills.
//-- [RESPONSE NOTE]
//-- PLAYER: I understand. I will find the missing villagers.
if (response == "s_d38b8e62")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: You must realize that this is not a task to be taken lightly. If you help me with this, you will not be able to assist anyone else for a while. Do you understand?
string_id message = new string_id (c_stringFile, "s_55");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes, that is fine.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Oh, in that case I'd rather not.
boolean hasResponse1 = false;
if (village_whip_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_57");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
utils.setScriptVar (player, "conversation.village_whip.branchId", 31);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: On second thought, I don't think I can help right now.
if (response == "s_63")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Oh, I see. Well come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_6bd93e78");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch31 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You must realize that this is not a task to be taken lightly. If you help me with this, you will not be able to assist anyone else for a while. Do you understand?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes, that is fine.
if (response == "s_57")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
village_whip_action_phase1_activate_quest (player, npc);
//-- NPC: Wonderful. You may want to begin by finding where the Sith Shadows went after we drove them away from the village. Our trackers have found a set of tracks leading off in this direction. That would be a good place to start.
string_id message = new string_id (c_stringFile, "s_3e543459");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Oh, in that case I'd rather not.
if (response == "s_60")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I see. Well come back if you change your mind.
string_id message = new string_id (c_stringFile, "s_321d7941");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch35 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I will not deceive you. If the villagers have been captured by the Sith Shadows, there will undoubtedly be guards there. I'm sure they wouldn't let you go without a fight.
//-- [RESPONSE NOTE]
//-- PLAYER: I think that I can help you.
if (response == "s_91bf5d37")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: That is excellent news. I appreciate all the help that we can get. There are five people missing from the village. If you can bring them all back alive, I will help you learn to use the Force to enhance your survival skills.
string_id message = new string_id (c_stringFile, "s_8ccc4e47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I understand. I will find the missing villagers.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: On second thought, I don't think I can help right now.
boolean hasResponse1 = false;
if (village_whip_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_d38b8e62");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
utils.setScriptVar (player, "conversation.village_whip.branchId", 30);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't think that I can help with this task.
if (response == "s_54d57caf")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I understand. Good day to you.
string_id message = new string_id (c_stringFile, "s_981b299f");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int village_whip_handleBranch38 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Some of the higher ranking Sith Shadows are gifted in the ways of the Force. It is not unlikely that they were able to influence a few of the weaker members of our village.
//-- [RESPONSE NOTE]
//-- PLAYER: Is there anything that I can do to help?
if (response == "s_76")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: I've got my responsibilities here at the village that I need to look after. What we really need is someone that can go out and find the missing people, and bring them back if possible.
string_id message = new string_id (c_stringFile, "s_dc8490a");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That sounds like something that I could do.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Would that be dangerous?
boolean hasResponse1 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: That sounds like a job for someone else.
boolean hasResponse2 = false;
if (village_whip_condition__defaultCondition (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_d18b8c00");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_bf15feab");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_9129fd1b");
utils.setScriptVar (player, "conversation.village_whip.branchId", 29);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I hope you find them soon. Good-bye.
if (response == "s_1dac49d2")
{
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: As do I. Good-bye.
string_id message = new string_id (c_stringFile, "s_33b9135e");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.village_whip");
setCondition (self, CONDITION_CONVERSABLE);
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
if(!fs_dyn_village.getRegisteredObjIdFromClusterWideData(fs_dyn_village.CLUSTER_OBJID_KEY_MASTER, "handleMasterIdResponse", self))
messageTo(self, "handleMasterIdRequestRetry", null, 120.0f, false);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
if(!fs_dyn_village.getRegisteredObjIdFromClusterWideData(fs_dyn_village.CLUSTER_OBJID_KEY_MASTER, "handleMasterIdResponse", self))
messageTo(self, "handleMasterIdRequestRetry", null, 120.0f, false);
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.village_whip");
return SCRIPT_CONTINUE;
}
messageHandler handleMasterIdResponse() {
obj_id master = params.getObjId(fs_dyn_village.CLUSTER_OBJID_KEY_MASTER);
if(isIdValid(master))
setObjVar(self, "village_master", master);
else
messageTo(self, "handleMasterIdRequestRetry", null, 120.0f, false);
return SCRIPT_CONTINUE;
}
messageHandler handleMasterIdRequestRetry() {
if(!fs_dyn_village.getRegisteredObjIdFromClusterWideData(fs_dyn_village.CLUSTER_OBJID_KEY_MASTER, "handleMasterIdResponse", self))
messageTo(self, "handleMasterIdRequestRetry", null, 120.0f, false);
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 (village_whip_condition_not_eligible (player, npc))
{
//-- NPC: I don't mean to be rude, but you're getting in my way.
string_id message = new string_id (c_stringFile, "s_b8360516");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_complete (player, npc))
{
//-- NPC: You got all the supplies! That's just great. You have no idea how badly they were needed. You have my eternal thanks.
string_id message = new string_id (c_stringFile, "s_a984d976");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_aborted (player, npc))
{
village_whip_action_phase2_continue_quest (player, npc);
//-- NPC: Uh oh... it looks like something happened during the transmission of the emergency beacon location. Here, let me try again...
string_id message = new string_id (c_stringFile, "s_bfc5a85d");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_failed (player, npc))
{
village_whip_action_phase2_continue_quest (player, npc);
//-- NPC: You lost the supplies? Those supplies are vital to the survival of the village, now more than ever. Here, we've located another lost transport. Try to be more careful this time.
string_id message = new string_id (c_stringFile, "s_af518049");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_continue (player, npc))
{
village_whip_action_phase2_continue_quest (player, npc);
//-- NPC: Excellent work! Supplies! Hey, we've got supplies over here! This is great, but there are still %DI more shipments that we were expecting. We've located another lost transport. Good luck, friend.
string_id message = new string_id (c_stringFile, "s_cc5225b7");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.digitInteger = village_whip_tokenDI_supplies_left (player, npc);
chat.chat (npc, player, null, null, pp);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_inprogress (player, npc))
{
//-- NPC: Go on now! You've got to go find the missing supplies!
string_id message = new string_id (c_stringFile, "s_ed25aceb");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I need a new beacon location.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Right! I'll get back to it!
boolean hasResponse1 = false;
if (village_whip_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_dcf4498e");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_24aab8ee");
utils.setScriptVar (player, "conversation.village_whip.branchId", 6);
npcStartConversation (player, npc, "village_whip", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase2_givequest (player, npc))
{
//-- NPC: It seems like it's one thing after another around here.
string_id message = new string_id (c_stringFile, "s_4d59f240");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do you mean?
boolean hasResponse0 = false;
if (village_whip_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_77e48d5b");
utils.setScriptVar (player, "conversation.village_whip.branchId", 9);
npcStartConversation (player, npc, "village_whip", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_complete (player, npc))
{
//-- NPC: You rescued all the villagers! That's fantastic. There are many families that owe you a debt of gratitude.
string_id message = new string_id (c_stringFile, "s_ab0312ab");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_aborted (player, npc))
{
village_whip_action_phase1_continue_quest (player, npc);
//-- NPC: Uh oh... it looks like something happened during the transmission to your datapad. Here, let me try again...
string_id message = new string_id (c_stringFile, "s_ccc7b5db");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_failed (player, npc))
{
village_whip_action_phase1_continue_quest (player, npc);
//-- NPC: You failed? That is disappointing, but we shouldn't dwell on it. There are still more that are missing. Our trackers have found a new set of tracks leading in this direction.
string_id message = new string_id (c_stringFile, "s_4d0a11ef");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_continue (player, npc))
{
village_whip_action_phase1_continue_quest (player, npc);
//-- NPC: Excellent work, but I still count %DI still missing. Our trackers have found a new set of tracks in this direction. This might help you find the next Shadow camp.
string_id message = new string_id (c_stringFile, "s_6862142d");
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
pp.digitInteger = village_whip_tokenDI_villagers_left (player, npc);
chat.chat (npc, player, null, null, pp);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_inprogress (player, npc))
{
//-- NPC: Go on now! You've got to go find those missing villagers!
string_id message = new string_id (c_stringFile, "s_ea9470bd");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase1_givequest (player, npc))
{
//-- NPC: Blast it all, the count is still coming up short. Oh, I'm sorry, hello.
string_id message = new string_id (c_stringFile, "s_35ee8c91");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Hello.
boolean hasResponse0 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What's the matter?
boolean hasResponse1 = false;
if (village_whip_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I'm sorry, I thought you were someone else.
boolean hasResponse2 = false;
if (village_whip_condition__defaultCondition (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_22a5c907");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_a1ba7ed2");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_455e077f");
utils.setScriptVar (player, "conversation.village_whip.branchId", 24);
npcStartConversation (player, npc, "village_whip", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_quest_completed (player, npc))
{
//-- NPC: Hey there. I heard you've been a big help around here. Great work!
string_id message = new string_id (c_stringFile, "s_de007d6");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_quest_accepted (player, npc))
{
//-- NPC: Say, could you... oh, it looks like you're already pretty busy. On your way then.
string_id message = new string_id (c_stringFile, "s_bfdaca25");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase3 (player, npc))
{
//-- NPC: I don't need anything right now, but if you're looking for something to do, I think that Dageerin could use some help.
string_id message = new string_id (c_stringFile, "s_e46c2ff7");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition_phase4 (player, npc))
{
//-- NPC: Now is not really a good time. If you're looking for some way to help, you should go talk to Captain Sarguillo.
string_id message = new string_id (c_stringFile, "s_32360540");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (village_whip_condition__defaultCondition (player, npc))
{
//-- NPC: Master... I must find the master...
string_id message = new string_id (c_stringFile, "s_3c9eddca");
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 != "village_whip")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.village_whip.branchId");
if (branchId == 6 && village_whip_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && village_whip_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && village_whip_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && village_whip_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && village_whip_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && village_whip_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && village_whip_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 24 && village_whip_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 25 && village_whip_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 26 && village_whip_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 27 && village_whip_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 28 && village_whip_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 29 && village_whip_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 30 && village_whip_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 31 && village_whip_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 35 && village_whip_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 38 && village_whip_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.village_whip.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================