Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/c_sink_reb.script
T

1663 lines
48 KiB
Plaintext

// ======================================================================
//
// c_sink_reb.script
//
//
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.factions;
include library.features;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/c_sink_reb";
// ======================================================================
// Script Conditions
// ======================================================================
boolean c_sink_reb_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_IsRebel1 (obj_id player, obj_id npc)
{
if (!factions.isRebel(player))
return false;
int questId1 = questGetQuestId("quest/c_sink_reb");
boolean OnQuest = questIsQuestActive(questId1, player);
return !OnQuest;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_IsImperial (obj_id player, obj_id npc)
{
if (!factions.isImperial(player))
return false;
return true;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_isNeutral (obj_id player, obj_id npc)
{
if (factions.isImperial(player)||factions.isRebel(player))
return false;
return true;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_broughtPilotBack (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int safesignal = groundquests.getTaskId(questId, "safesignal");
boolean onTask = questIsTaskActive(questId, safesignal, player);
return onTask;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_firstStepofQuest (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int gotocrash = groundquests.getTaskId(questId, "gotocrash");
boolean onTask = questIsTaskActive(questId, gotocrash, player);
return onTask;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_gangKillStepDone (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int spacesignal = groundquests.getTaskId(questId, "spacesignal");
int killloot = groundquests.getTaskId(questId, "killloot");
int kill = groundquests.getTaskId(questId, "kill");
return questIsTaskActive(questId, spacesignal, player) &&
questIsTaskComplete(questId, killloot, player) &&
questIsTaskComplete(questId, kill, player);
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_gangKillStepNotDone (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int spacesignal = groundquests.getTaskId(questId, "spacesignal");
int killloot = groundquests.getTaskId(questId, "killloot");
int kill = groundquests.getTaskId(questId, "kill");
return questIsTaskActive(questId, spacesignal, player) &&
(questIsTaskActive(questId, killloot, player) ||
questIsTaskActive(questId, kill, player));
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_gangKillStepActive (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int spacesignal = groundquests.getTaskId(questId, "spacesignal");
return questIsTaskActive(questId, spacesignal, player);
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_noGangsKilledYet (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int spacesignal = groundquests.getTaskId(questId, "spacesignal");
int killloot = groundquests.getTaskId(questId, "killloot");
int kill = groundquests.getTaskId(questId, "kill");
return questIsTaskActive(questId, spacesignal, player) &&
questIsTaskActive(questId, killloot, player) &&
questIsTaskActive(questId, kill, player);
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_hasJTL (obj_id player, obj_id npc)
{
return ( features.isSpaceEdition( player ) );
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_spaceWon (obj_id player, obj_id npc)
{
if (space_quest.hasWonQuest( player, "assassinate", "c_sink_reb_space" ))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_spaceLost (obj_id player, obj_id npc)
{
if (( space_quest.hasAbortedQuest( player, "assassinate", "c_sink_reb_space" ) ||
space_quest.hasFailedQuest( player, "assassinate", "c_sink_reb_space" ) )&&
(!space_quest.hasWonQuest( player, "assassinate", "c_sink_reb_space" )))
return true;
return false;
}
// ----------------------------------------------------------------------
boolean c_sink_reb_condition_spaceStepActive (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
int spaceactive = groundquests.getTaskId(questId, "spaceactive");
return questIsTaskActive(questId, spaceactive, player);
}
// ======================================================================
// Script Actions
// ======================================================================
void c_sink_reb_action_giveQuest (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
groundquests.grantQuest(questId, player, npc, true);
obj_id waypoint2 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.pilot");
if (waypoint2 != null)
{
destroyWaypointInDatapad(waypoint2, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.pilot");
obj_id waypoint3 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
if (waypoint3 != null)
{
destroyWaypointInDatapad(waypoint3, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = -5463;
loc.y = 0;
loc.z = -930;
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/c_sink_reb.pilot", waypoint);
setWaypointName(waypoint, "Escape Pod Crash Site");
setWaypointActive(waypoint, true);
location loc1 = getLocation(top);
loc1.x = -5200;
loc1.y = 0;
loc1.z = -2575;
obj_id waypoint1 = createWaypointInDatapad(player, loc1);
setObjVar(player, "quest.general.quest/c_sink_reb.questgiver", waypoint1);
setWaypointName(waypoint1, "Acun Solari");
setWaypointActive(waypoint, true);
}
// ----------------------------------------------------------------------
void c_sink_reb_action_faceplayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ----------------------------------------------------------------------
void c_sink_reb_action_forwardQuestAfterEscort (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_sink_reb");
// int escort = groundquests.getTaskId(questId, "escort");
groundquests.sendSignal(player, "c_sink_reb_safe");
// questCompleteTask(questId, escort, player);
obj_id waypoint2 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.pilot");
if (waypoint2 != null)
{
destroyWaypointInDatapad(waypoint2, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.pilot");
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = -4737;
loc.y = 0;
loc.z = -1519;
loc.area = "corellia";
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/c_sink_reb.daggercamp", waypoint);
setWaypointName(waypoint, "Flail Camp");
setWaypointActive(waypoint, true);
location loc1 = getLocation(top);
loc1.x = -1622;
loc1.y = 0;
loc1.z = 618;
loc1.area = "talus";
obj_id waypoint1 = createWaypointInDatapad(player, loc1);
setObjVar(player, "quest.general.quest/c_sink_reb.binayrecamp", waypoint1);
setWaypointName(waypoint1, "Binayre Camp");
setWaypointActive(waypoint, true);
}
// ----------------------------------------------------------------------
void c_sink_reb_action_giveWaypoint (obj_id player, obj_id npc)
{
obj_id waypoint2 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.pilot");
if (waypoint2 != null)
{
destroyWaypointInDatapad(waypoint2, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.pilot");
obj_id waypoint3 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
if (waypoint3 != null)
{
destroyWaypointInDatapad(waypoint3, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = -5463;
loc.y = 0;
loc.z = -930;
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/c_sink_reb.pilot", waypoint);
setWaypointName(waypoint, "Escape Pod Crash Site");
setWaypointActive(waypoint, true);
location loc1 = getLocation(top);
loc1.x = -5200;
loc1.y = 0;
loc1.z = -2565;
obj_id waypoint1 = createWaypointInDatapad(player, loc1);
setObjVar(player, "quest.general.quest/c_sink_reb.questgiver", waypoint1);
setWaypointName(waypoint1, "Acun Solari");
setWaypointActive(waypoint, true);
}
// ----------------------------------------------------------------------
void c_sink_reb_action_rewardSignal (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "c_sink_reb_gospace");
groundquests.sendSignal(player, "c_sink_reb_spacedone");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.questgiver");
obj_id waypoint2 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.daggercamp");
if (waypoint2 != null)
{
destroyWaypointInDatapad(waypoint2, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.daggercamp");
obj_id waypoint3 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.binayrecamp");
if (waypoint3 != null)
{
destroyWaypointInDatapad(waypoint3, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.binayrecamp");
}
// ----------------------------------------------------------------------
void c_sink_reb_action_giveSpace (obj_id player, obj_id npc)
{
space_quest.grantQuest( player, "assassinate", "c_sink_reb_space" );
groundquests.sendSignal(player, "c_sink_reb_gospace");
obj_id waypoint2 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.daggercamp");
if (waypoint2 != null)
{
destroyWaypointInDatapad(waypoint2, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.daggercamp");
obj_id waypoint3 = getObjIdObjVar(player, "quest.general.quest/c_sink_reb.binayrecamp");
if (waypoint3 != null)
{
destroyWaypointInDatapad(waypoint3, player);
}
removeObjVar(player, "quest.general.quest/c_sink_reb.binayrecamp");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int c_sink_reb_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have a simple assignment for you, if you are interested. A good friend of mine needs an escort back here.
//-- [RESPONSE NOTE]
//-- PLAYER: Escort from where? What happened?
if (response == "s_1118")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_up");
//-- NPC: He is a pilot and his ship was attacked. He made it to the escape pod, but now he needs someone to lead him here.
string_id message = new string_id (c_stringFile, "s_1120");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure. Any friend of yours is a friend of mine!
boolean hasResponse0 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: No thank you. I have other things to do. There's a war out there, you know.
boolean hasResponse1 = false;
if (c_sink_reb_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_1122");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1126");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: He is a pilot and his ship was attacked. He made it to the escape pod, but now he needs someone to lead him here.
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. Any friend of yours is a friend of mine!
if (response == "s_1122")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "salute1");
doAnimationAction (player, "salute1");
c_sink_reb_action_giveQuest (player, npc);
//-- NPC: Thank you! I'll be sure to tell the higher-ups of your willingness to help. The pod crashed north of here. I'm sure he's keeping out of sight of the local Imperial forces. I'll radio and let him know you are on your way. He will follow you here. I'll have a reward for you when you get back.
string_id message = new string_id (c_stringFile, "s_1124");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: No thank you. I have other things to do. There's a war out there, you know.
if (response == "s_1126")
{
doAnimationAction (player, "shrug_shoulders");
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_disgust");
//-- NPC: Sure. What's one pilot whose life is in danger when you could be out killing to your heart's content? Are you sure you are in the Rebellion?
string_id message = new string_id (c_stringFile, "s_1128");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome back. Tell me what happened.
//-- [RESPONSE NOTE]
//-- PLAYER: I found a corpse at the crash site and I was attacked by Flails.
if (response == "s_1132")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "pound_fist_palm");
//-- NPC: No! After all that he went through in the war, to get killed by thugs?! That's it! I'm done waiting for someone else to take care of these criminals. It's time to act!
string_id message = new string_id (c_stringFile, "s_1134");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What are you talking about?
boolean hasResponse0 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What do you need me to do?
boolean hasResponse1 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I want no part of your vendetta. One major enemy is enough.
boolean hasResponse2 = false;
if (c_sink_reb_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_1136");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1156");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_1160");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No! After all that he went through in the war, to get killed by thugs?! That's it! I'm done waiting for someone else to take care of these criminals. It's time to act!
//-- [RESPONSE NOTE]
//-- PLAYER: What are you talking about?
if (response == "s_1136")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: These swoop gangs, smugglers, and pirates! Beyond what they are doing to innocent people, they give us a bad name.
string_id message = new string_id (c_stringFile, "s_1138");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do you mean by that?
boolean hasResponse0 = false;
if (c_sink_reb_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_1140");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What do you need me to do?
if (response == "s_1156")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_forwardQuestAfterEscort (player, npc);
//-- NPC: I want you to go after them. I don't expect you to single-handedly eliminate all the criminals in the galaxy, but you can start the ball rolling. Strike at two of the gangs, one here and one on Talus. I'll put more information into your journal and datapad.
string_id message = new string_id (c_stringFile, "s_1158");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I want no part of your vendetta. One major enemy is enough.
if (response == "s_1160")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: If we stand aside while evil people take advantage of others, we lose. But it's your decision. If you change your mind, let me know.
string_id message = new string_id (c_stringFile, "s_1162");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: These swoop gangs, smugglers, and pirates! Beyond what they are doing to innocent people, they give us a bad name.
//-- [RESPONSE NOTE]
//-- PLAYER: What do you mean by that?
if (response == "s_1140")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: Obviously, to the Empire, we are criminals and a threat to their domination. But to the citizens, we Rebels may be viewed as Freedom Fighters...or as the criminals that the Empire is making us to be.
string_id message = new string_id (c_stringFile, "s_1142");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What do the gangs have to do with that?
boolean hasResponse0 = false;
if (c_sink_reb_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_1144");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Obviously, to the Empire, we are criminals and a threat to their domination. But to the citizens, we Rebels may be viewed as Freedom Fighters...or as the criminals that the Empire is making us to be.
//-- [RESPONSE NOTE]
//-- PLAYER: What do the gangs have to do with that?
if (response == "s_1144")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: The more the actual pirates and criminal elements terrorize citizens while we do nothing to help them, the more we are lumped in with their ilk.
string_id message = new string_id (c_stringFile, "s_1146");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So, what do you want me to do about it?
boolean hasResponse0 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I want no part of your vendetta. One major enemy is enough.
boolean hasResponse1 = false;
if (c_sink_reb_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_1148");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1152");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The more the actual pirates and criminal elements terrorize citizens while we do nothing to help them, the more we are lumped in with their ilk.
//-- [RESPONSE NOTE]
//-- PLAYER: So, what do you want me to do about it?
if (response == "s_1148")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_forwardQuestAfterEscort (player, npc);
//-- NPC: I want you to go after them. I know that you cannot eliminate the whole threat yourself, but strike at them. I have identified two gangs here and on Talus that are strong enough to do some real damage, but not as strong as, say, the Hutt Syndicate.
string_id message = new string_id (c_stringFile, "s_1150");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I want no part of your vendetta. One major enemy is enough.
if (response == "s_1152")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: If we stand aside while evil people take advantage of others, we lose. But it's your decision. If you change your mind, let me know.
string_id message = new string_id (c_stringFile, "s_1154");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I don't see my friend with you. I guess you should be heading out to get him.
//-- [RESPONSE NOTE]
//-- PLAYER: I need the location again.
if (response == "s_1166")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
c_sink_reb_action_giveWaypoint (player, npc);
//-- NPC: Go north and look for the crashed Escape Pod.
string_id message = new string_id (c_stringFile, "s_1168");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: How did it go?
//-- [RESPONSE NOTE]
//-- PLAYER: I haven't started yet.
if (response == "s_1172")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: Then maybe you should get to it.
string_id message = new string_id (c_stringFile, "s_1174");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm still working my way through the bad guys.
if (response == "s_1176")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: I have nothing else to offer you now. Get going!
string_id message = new string_id (c_stringFile, "s_1178");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I have the marks and you have heard about the Flails, I assume.
if (response == "s_1180")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: I did indeed and I'm glad to see that you are as enthusiastic as I am about stopping the growing gang problem.
string_id message = new string_id (c_stringFile, "s_1182");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'd like to do more to help.
boolean hasResponse0 = false;
if (c_sink_reb_condition_hasJTL (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I am happy to do my part.
boolean hasResponse1 = false;
if (!c_sink_reb_condition_hasJTL (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_1184");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1188");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 21);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch21 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I did indeed and I'm glad to see that you are as enthusiastic as I am about stopping the growing gang problem.
//-- [RESPONSE NOTE]
//-- PLAYER: I'd like to do more to help.
if (response == "s_1184")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_giveSpace (player, npc);
//-- NPC: Good. I want you to head into space then. The Hidden Daggers have taken it into their heads to terrorize innocent pilots heading to Corellia. Destroy them and then I'll reward you properly for your hard work.
string_id message = new string_id (c_stringFile, "s_1186");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I am happy to do my part.
if (response == "s_1188")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_rewardSignal (player, npc);
//-- NPC: Let me give you your reward for a job well done. I think that I'm going to make this my cause. Let Mon Mothma deal with the Empire. I want to make sure that if we win, there is something worth having. Come back to me sometime and I may have something for you to do.
string_id message = new string_id (c_stringFile, "s_1190");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch24 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What happened up there?
//-- [RESPONSE NOTE]
//-- PLAYER: I haven't been up there yet.
if (response == "s_1194")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: Then I suggest you get going.
string_id message = new string_id (c_stringFile, "s_1196");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I failed the mission.
if (response == "s_1198")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_giveSpace (player, npc);
//-- NPC: It's like falling off a bantha. You have to dust yourself off, get back on and finish the job!
string_id message = new string_id (c_stringFile, "s_1200");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I completed the mission.
if (response == "s_1202")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: Great!! You dealt the Daggers one hell of a blow. They will be picking up pieces of their ships for weeks.
string_id message = new string_id (c_stringFile, "s_1204");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It felt good.
boolean hasResponse0 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm done with this now. No more.
boolean hasResponse1 = false;
if (c_sink_reb_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_1206");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1210");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 27);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch27 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Great!! You dealt the Daggers one hell of a blow. They will be picking up pieces of their ships for weeks.
//-- [RESPONSE NOTE]
//-- PLAYER: It felt good.
if (response == "s_1206")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_rewardSignal (player, npc);
//-- NPC: It should. You are helping the innocent people of the galaxy. All I can give you is my thanks and these credits. I'll make sure that your deeds are known. Come back to me soon and I will try to have more for you to do.
string_id message = new string_id (c_stringFile, "s_1208");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm done with this now. No more.
if (response == "s_1210")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
c_sink_reb_action_rewardSignal (player, npc);
//-- NPC: Let me give you your reward for a job well done, at least. I think that I'm going to make this my cause. Let Mon Mothma deal with the Empire. I want to make sure that if we win, there is something worth having. If you want to be a part of it, talk to me later.
string_id message = new string_id (c_stringFile, "s_1212");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_sink_reb_handleBranch30 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I finally have my mission in life. The criminals will not take over while we are at war!
//-- [RESPONSE NOTE]
//-- PLAYER: Do you have anything for me?
if (response == "s_1216")
{
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: Not yet.
string_id message = new string_id (c_stringFile, "s_1218");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.c_sink_reb");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Acun Solari");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Acun Solari");
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.c_sink_reb");
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 (c_sink_reb_condition_IsImperial (player, npc))
{
c_sink_reb_action_faceplayer (player, npc);
//-- NPC: What makes you think I will talk to you, thug?
string_id message = new string_id (c_stringFile, "s_1112");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_isNeutral (player, npc))
{
c_sink_reb_action_faceplayer (player, npc);
//-- NPC: Good afternoon! Nice day, isn't it? I'm sorry, but I don't have anything that you can do. I am looking for someone more sympathetic to the Alliance.
string_id message = new string_id (c_stringFile, "s_1114");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_IsRebel1 (player, npc))
{
c_sink_reb_action_faceplayer (player, npc);
//-- NPC: I have a simple assignment for you, if you are interested. A good friend of mine needs an escort back here.
string_id message = new string_id (c_stringFile, "s_1116");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Escort from where? What happened?
boolean hasResponse0 = false;
if (c_sink_reb_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_1118");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 3);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_broughtPilotBack (player, npc))
{
c_sink_reb_action_faceplayer (player, npc);
//-- NPC: Welcome back. Tell me what happened.
string_id message = new string_id (c_stringFile, "s_1130");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I found a corpse at the crash site and I was attacked by Flails.
boolean hasResponse0 = false;
if (c_sink_reb_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_1132");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 7);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_firstStepofQuest (player, npc))
{
//-- NPC: I don't see my friend with you. I guess you should be heading out to get him.
string_id message = new string_id (c_stringFile, "s_1164");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I need the location again.
boolean hasResponse0 = false;
if (c_sink_reb_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_1166");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 16);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_gangKillStepActive (player, npc))
{
//-- NPC: How did it go?
string_id message = new string_id (c_stringFile, "s_1170");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I haven't started yet.
boolean hasResponse0 = false;
if (c_sink_reb_condition_noGangsKilledYet (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm still working my way through the bad guys.
boolean hasResponse1 = false;
if (!c_sink_reb_condition_noGangsKilledYet (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I have the marks and you have heard about the Flails, I assume.
boolean hasResponse2 = false;
if (c_sink_reb_condition_gangKillStepDone (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_1172");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1176");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_1180");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 18);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition_spaceStepActive (player, npc))
{
//-- NPC: What happened up there?
string_id message = new string_id (c_stringFile, "s_1192");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I haven't been up there yet.
boolean hasResponse0 = false;
if (c_sink_reb_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I failed the mission.
boolean hasResponse1 = false;
if (c_sink_reb_condition_spaceLost (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I completed the mission.
boolean hasResponse2 = false;
if (c_sink_reb_condition_spaceWon (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_1194");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1198");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_1202");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 24);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_sink_reb_condition__defaultCondition (player, npc))
{
//-- NPC: I finally have my mission in life. The criminals will not take over while we are at war!
string_id message = new string_id (c_stringFile, "s_1214");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Do you have anything for me?
boolean hasResponse0 = false;
if (c_sink_reb_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_1216");
utils.setScriptVar (player, "conversation.c_sink_reb.branchId", 30);
npcStartConversation (player, npc, "c_sink_reb", message, responses);
}
else
{
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 != "c_sink_reb")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.c_sink_reb.branchId");
if (branchId == 3 && c_sink_reb_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && c_sink_reb_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && c_sink_reb_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && c_sink_reb_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && c_sink_reb_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && c_sink_reb_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && c_sink_reb_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && c_sink_reb_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && c_sink_reb_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 21 && c_sink_reb_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 24 && c_sink_reb_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 27 && c_sink_reb_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 30 && c_sink_reb_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.c_sink_reb.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================