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

1433 lines
42 KiB
Plaintext

// ======================================================================
//
// c_ddroid_valance.script
//
//
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.features;
include library.groundquests;
include library.space_quest;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/c_ddroid_valance";
// ======================================================================
// Script Conditions
// ======================================================================
boolean c_ddroid_valance_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_hasSpaceExpansion (obj_id player, obj_id npc)
{
return ( features.isSpaceEdition( player ) );
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_playeronquest1 (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid1");
return questIsQuestActive(questId, player);
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_playeronquest2part1 (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid2");
return questIsTaskActive(questId, 0, player) ||
questIsTaskActive(questId, 1, player) ||
questIsTaskActive(questId, 2, player) ||
questIsTaskActive(questId, 3, player);
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_completedq2p2 (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid2");
return questIsTaskActive(questId, 4, player) &&
questIsTaskComplete(questId, 1, player) &&
questIsTaskComplete(questId, 2, player) &&
questIsTaskComplete(questId, 3, player);
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_readyforquest2 (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid1");
int questId2 = questGetQuestId("quest/c_darndroid2");
return questIsQuestComplete(questId, player)&&
!questIsQuestActive(questId2, player);
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_failedSpace (obj_id player, obj_id npc)
{
if ( space_quest.hasAbortedQuest( player, "assassinate", "c_darndroidspace" ) ||
space_quest.hasFailedQuest( player, "assassinate", "c_darndroidspace" ) )
return true;
return false;
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_completedspace (obj_id player, obj_id npc)
{
if (space_quest.hasWonQuest( player, "assassinate", "c_darndroidspace" ))
return true;
else
return false;
}
// ----------------------------------------------------------------------
boolean c_ddroid_valance_condition_completedAll (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid1");
int questId2 = questGetQuestId("quest/c_darndroid2");
return questIsQuestComplete(questId, player)&&
questIsQuestComplete(questId2, player);
}
// ======================================================================
// Script Actions
// ======================================================================
void c_ddroid_valance_action_giveddroidquest2 (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/c_darndroid2");
groundquests.grantQuest(questId, player, npc, true);
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = 5353;
loc.y = 131;
loc.z = 5632;
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/c_darndroid2.staging", waypoint);
setWaypointName(waypoint, "Black Sun Staging Camp");
setWaypointActive(waypoint, true);
location loc1 = getLocation(top);
loc1.x = -2380;
loc1.y = 0;
loc1.z = 2031;
obj_id waypoint1 = createWaypointInDatapad(player, loc1);
setObjVar(player, "quest.general.quest/c_darndroid2.valance", waypoint1);
setWaypointName(waypoint1, "Valance Serth");
// setWaypointActive(waypoint1, true);
}
// ----------------------------------------------------------------------
void c_ddroid_valance_action_nojtlCompleteQuest (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "c_darndroid2_campdead");
groundquests.sendSignal(player, "c_darndroid2_spacedone");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
}
// ----------------------------------------------------------------------
void c_ddroid_valance_action_giveSpaceQuest (obj_id player, obj_id npc)
{
space_quest.grantQuest( player, "assassinate", "c_darndroidspace" );
groundquests.sendSignal(player, "c_darndroid2_campdead");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
}
// ----------------------------------------------------------------------
void c_ddroid_valance_action_completespace (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "c_darndroid2_spacedone");
obj_id top=getTopMostContainer(player);
location loc = getLocation(top);
loc.x = 4723;
loc.y = 3;
loc.z = -4935;
loc.area = "naboo";
obj_id waypoint = createWaypointInDatapad(player, loc);
setObjVar(player, "quest.general.quest/c_darndroid2.droid", waypoint);
setWaypointName(waypoint, "C-3TC");
setWaypointActive(waypoint, true);
}
// ----------------------------------------------------------------------
void c_ddroid_valance_action_completequest1 (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "c_darndroid1_valance");
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
if (waypoint1 != null)
{
destroyWaypointInDatapad(waypoint1, player);
}
removeObjVar(player, "quest.general.quest/c_darndroid1.taluscrash");
}
// ----------------------------------------------------------------------
void c_ddroid_valance_action_faceplayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int c_ddroid_valance_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Thank you! Once those pirates get roused, there's nothing to stop them.
//-- [RESPONSE NOTE]
//-- PLAYER: I'm happy I could help.
if (response == "s_1172")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_completequest1 (player, npc);
//-- NPC: I owe you my life, but this is all that I have been able to salvage from the flight. I hope it will help you out. I have one more favor to ask, if possible.
string_id message = new string_id (c_stringFile, "s_1174");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm expecting a little in return.
if (response == "s_1176")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_completequest1 (player, npc);
//-- NPC: Of course you are! Unfortunately, this is all that I have been able to salvage from the flight. I know that I shouldn't be asking, but I need another favor.
string_id message = new string_id (c_stringFile, "s_1178");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need a favor...for the good of the Empire, or its people, or whatever you believe in. Either way, innocent people will get hurt if you can't help me.
//-- [RESPONSE NOTE]
//-- PLAYER: What is the favor?
if (response == "s_1182")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: What do you know about the Black Sun?
string_id message = new string_id (c_stringFile, "s_1184");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Not all that much. Just rumors really.
boolean hasResponse0 = false;
if (c_ddroid_valance_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_1186");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: What do you know about the Black Sun?
//-- [RESPONSE NOTE]
//-- PLAYER: Not all that much. Just rumors really.
if (response == "s_1186")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Well, the rumors are probably true. They are vile, nasty criminals that live only for themselves and the control of anything that may make them money. And destroy anything that could put that in jeopardy.
string_id message = new string_id (c_stringFile, "s_1188");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Why were they going after you?
boolean hasResponse0 = false;
if (c_ddroid_valance_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_1190");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, the rumors are probably true. They are vile, nasty criminals that live only for themselves and the control of anything that may make them money. And destroy anything that could put that in jeopardy.
//-- [RESPONSE NOTE]
//-- PLAYER: Why were they going after you?
if (response == "s_1190")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: I came across some information about one of their latest schemes. They plan to taint a major shipment of medicinal spice. I want to stop them, but I'm hurt.
string_id message = new string_id (c_stringFile, "s_1192");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Tainted medicinal spice?
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I will help.
boolean hasResponse1 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: I don't have time right now.
boolean hasResponse2 = false;
if (c_ddroid_valance_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_1194");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1206");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_1210");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I came across some information about one of their latest schemes. They plan to taint a major shipment of medicinal spice. I want to stop them, but I'm hurt.
//-- [RESPONSE NOTE]
//-- PLAYER: Tainted medicinal spice?
if (response == "s_1194")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Yes. There's an outbreak of Ourim Flu on several planets. People are dying. The Sun will use the tainted spice to addict the sick people to their chemicals.
string_id message = new string_id (c_stringFile, "s_1196");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I will help.
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't have the time right now.
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1198");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1202");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I will help.
if (response == "s_1206")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_giveddroidquest2 (player, npc);
//-- NPC: Oh thank you! Here is the last known location of their base. Here are coordinates of a spot near their base. You should be able to see them from this spot. Kill them if you must, but stop them.
string_id message = new string_id (c_stringFile, "s_1208");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't have time right now.
if (response == "s_1210")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: I'm sorry to hear that. I hope I'll be able to find someone that will help me resolve this dangerous situation.
string_id message = new string_id (c_stringFile, "s_1212");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes. There's an outbreak of Ourim Flu on several planets. People are dying. The Sun will use the tainted spice to addict the sick people to their chemicals.
//-- [RESPONSE NOTE]
//-- PLAYER: I will help.
if (response == "s_1198")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_giveddroidquest2 (player, npc);
//-- NPC: Oh thank you! Here are coordinates of a spot near their base. You should be able to see them from this spot. Kill them if you must, but stop them.
string_id message = new string_id (c_stringFile, "s_1200");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't have the time right now.
if (response == "s_1202")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: I'm sorry to hear that. I hope I'll be able to find someone to help me resolve this dangerous situation.
string_id message = new string_id (c_stringFile, "s_1204");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome back.
//-- [RESPONSE NOTE]
//-- PLAYER: I took care of the Black Sun Camp
if (response == "s_1216")
{
//-- [NOTE]
if (!c_ddroid_valance_condition_hasSpaceExpansion (player, npc))
{
c_ddroid_valance_action_nojtlCompleteQuest (player, npc);
//-- NPC: Great! You stopped their nasty little plot cold. There's only one loose end. Please let me know if you are interested.
string_id message = new string_id (c_stringFile, "s_1218");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_hasSpaceExpansion (player, npc))
{
//-- NPC: I'm afraid they must have had early warning! They launched their transport already. The only hope left is to intercept the transport in space.
string_id message = new string_id (c_stringFile, "s_1220");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ok, tell me more, I'm always ready for a trip into space.
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Give me a moment to get myself ready.
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1222");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1226");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I'm not done yet.
if (response == "s_1230")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: They are probably pretty tough. Please hurry as much as you safely can.
string_id message = new string_id (c_stringFile, "s_1232");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm afraid they must have had early warning! They launched their transport already. The only hope left is to intercept the transport in space.
//-- [RESPONSE NOTE]
//-- PLAYER: Ok, tell me more, I'm always ready for a trip into space.
if (response == "s_1222")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_giveSpaceQuest (player, npc);
//-- NPC: What else can I tell you? Get to a Starport and into space. Go blow up that transport and anything that stands in the way. I should be able to arrange for you to get some coordinates to help.
string_id message = new string_id (c_stringFile, "s_1224");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Give me a moment to get myself ready.
if (response == "s_1226")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: All right, but hurry.
string_id message = new string_id (c_stringFile, "s_1228");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hello, my friend. Thank you for all your help so far. I shouldn't ask, but...well...you recall the droid that sent you to me, C-3TC?
//-- [RESPONSE NOTE]
//-- PLAYER: He's rather difficult to forget.
if (response == "s_1236")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Yes, well...he's also the one responsible for getting me into trouble in the first place and I'm tired of it. If you head back to Moenia anytime soon, would you talk to him and have him run this program for me? It will wipe his memory and I won't have to worry about Black Sun goons anymore.
string_id message = new string_id (c_stringFile, "s_1238");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can do that if you like.
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What?! After all that he did to help you...
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1240");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1244");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 20);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Oh no! I'm not going anywhere near that thing again!
if (response == "s_1248")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Well, much as it saved my life, I can't say that I blame you. If you change your mind, come back and talk to me.
string_id message = new string_id (c_stringFile, "s_1250");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch20 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes, well...he's also the one responsible for getting me into trouble in the first place and I'm tired of it. If you head back to Moenia anytime soon, would you talk to him and have him run this program for me? It will wipe his memory and I won't have to worry about Black Sun goons anymore.
//-- [RESPONSE NOTE]
//-- PLAYER: I can do that if you like.
if (response == "s_1240")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_completespace (player, npc);
//-- NPC: I would appreciate it. He's probably fretting his bolts off.
string_id message = new string_id (c_stringFile, "s_1242");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What?! After all that he did to help you...
if (response == "s_1244")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Whoa! Remember, he's a droid. I'll just be doing both him and myself a favor. If you don't want to do it, that's your business. When you change your mind, talk to me.
string_id message = new string_id (c_stringFile, "s_1246");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch25 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ouch, you don't look too good. The first of the transports got away. This isn't the end of the galaxy. The majority still haven't gotten out of the system. Are you ready to go after them again?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm ready!
if (response == "s_1256")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
c_ddroid_valance_action_giveSpaceQuest (player, npc);
//-- NPC: Good luck!
string_id message = new string_id (c_stringFile, "s_1258");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Give me some time.
if (response == "s_1260")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: Please hurry. It's still a trek back to the starport.
string_id message = new string_id (c_stringFile, "s_1262");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int c_ddroid_valance_handleBranch28 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hello my friend. You saved many, many innocent people.
//-- [RESPONSE NOTE]
//-- PLAYER: What are you still doing here?
if (response == "s_1266")
{
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: I like it here. It's exciting! Heh. Actually, I need to make sure that my stuff on this ship is taken care of.
string_id message = new string_id (c_stringFile, "s_1268");
utils.removeScriptVar (player, "conversation.c_ddroid_valance.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.c_ddroid_valance");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Valance Serth");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Valance Serth");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
return SCRIPT_CONTINUE;
}
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
{
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
menuInfoData.setServerNotify (false);
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnIncapacitated (obj_id killer)
{
clearCondition (self, CONDITION_CONVERSABLE);
detachScript (self, "conversation.c_ddroid_valance");
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_ddroid_valance_condition_playeronquest1 (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Thank you! Once those pirates get roused, there's nothing to stop them.
string_id message = new string_id (c_stringFile, "s_1170");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm happy I could help.
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm expecting a little in return.
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1172");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1176");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 1);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_readyforquest2 (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: I need a favor...for the good of the Empire, or its people, or whatever you believe in. Either way, innocent people will get hurt if you can't help me.
string_id message = new string_id (c_stringFile, "s_1180");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What is the favor?
boolean hasResponse0 = false;
if (c_ddroid_valance_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_1182");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 4);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_completedq2p2 (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Welcome back.
string_id message = new string_id (c_stringFile, "s_1214");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I took care of the Black Sun Camp
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I'm not done yet.
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1216");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1230");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 13);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_completedspace (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Hello, my friend. Thank you for all your help so far. I shouldn't ask, but...well...you recall the droid that sent you to me, C-3TC?
string_id message = new string_id (c_stringFile, "s_1234");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: He's rather difficult to forget.
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Oh no! I'm not going anywhere near that thing again!
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1236");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1248");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 19);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_playeronquest2part1 (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Please go eliminate that staging camp.
string_id message = new string_id (c_stringFile, "s_1252");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_failedSpace (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Ouch, you don't look too good. The first of the transports got away. This isn't the end of the galaxy. The majority still haven't gotten out of the system. Are you ready to go after them again?
string_id message = new string_id (c_stringFile, "s_1254");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm ready!
boolean hasResponse0 = false;
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Give me some time.
boolean hasResponse1 = false;
if (c_ddroid_valance_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_1256");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_1260");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 25);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition_completedAll (player, npc))
{
c_ddroid_valance_action_faceplayer (player, npc);
//-- NPC: Hello my friend. You saved many, many innocent people.
string_id message = new string_id (c_stringFile, "s_1264");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What are you still doing here?
boolean hasResponse0 = false;
if (c_ddroid_valance_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_1266");
utils.setScriptVar (player, "conversation.c_ddroid_valance.branchId", 28);
npcStartConversation (player, npc, "c_ddroid_valance", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (c_ddroid_valance_condition__defaultCondition (player, npc))
{
//-- NPC: It's going to take me forever to fix this ship!
string_id message = new string_id (c_stringFile, "s_1269");
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_ddroid_valance")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.c_ddroid_valance.branchId");
if (branchId == 1 && c_ddroid_valance_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && c_ddroid_valance_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && c_ddroid_valance_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && c_ddroid_valance_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && c_ddroid_valance_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && c_ddroid_valance_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && c_ddroid_valance_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && c_ddroid_valance_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && c_ddroid_valance_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 20 && c_ddroid_valance_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 25 && c_ddroid_valance_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 28 && c_ddroid_valance_handleBranch28 (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_ddroid_valance.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================