mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
1259 lines
37 KiB
Plaintext
1259 lines
37 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// c_ddroid_droid.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.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/c_ddroid_droid";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean c_ddroid_droid_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean c_ddroid_droid_condition_playernotdoneQ2 (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/c_darndroid1");
|
|
int questId2 = questGetQuestId("quest/c_darndroid2");
|
|
|
|
boolean onQuest = (questIsQuestActive(questId1, player) || questIsQuestComplete(questId1, player))
|
|
&& !questIsQuestComplete(questId2, player);
|
|
|
|
return onQuest;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean c_ddroid_droid_condition_quest2complete (obj_id player, obj_id npc)
|
|
{
|
|
int questId = questGetQuestId("quest/c_darndroid2");
|
|
return questIsTaskActive(questId, 6, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean c_ddroid_droid_condition_memwiped (obj_id player, obj_id npc)
|
|
{
|
|
int questId = questGetQuestId("quest/c_darndroid2");
|
|
return questIsQuestComplete(questId, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean c_ddroid_droid_condition_playerhasquest (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/c_darndroid1");
|
|
|
|
boolean onQuest = questIsQuestActive(questId1, player) || questIsQuestComplete(questId1, player);
|
|
|
|
return onQuest;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void c_ddroid_droid_action_givequest1 (obj_id player, obj_id npc)
|
|
{
|
|
int questId = questGetQuestId("quest/c_darndroid1");
|
|
|
|
groundquests.grantQuest(questId, player, npc, true);
|
|
|
|
obj_id top=getTopMostContainer(player);
|
|
location loc = getLocation(top);
|
|
loc.x = 4796;
|
|
loc.y = 20;
|
|
loc.z = -4696;
|
|
obj_id waypoint = createWaypointInDatapad(player, loc);
|
|
setObjVar(player, "quest.general.quest/c_darndroid1.moeniastarport", waypoint);
|
|
setWaypointName(waypoint, "Moenia Starport");
|
|
setWaypointActive(waypoint, true);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void c_ddroid_droid_action_faceplayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void c_ddroid_droid_action_memwipedroid (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "c_darndroid2_memwipe");
|
|
|
|
obj_id waypoint1 = getObjIdObjVar(player, "quest.general.quest/c_darndroid2.droid");
|
|
if (waypoint1 != null)
|
|
{
|
|
destroyWaypointInDatapad(waypoint1, player);
|
|
}
|
|
removeObjVar(player, "quest.general.quest/c_darndroid2.droid");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int c_ddroid_droid_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh dear, oh dear. My poor master! Can you help me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you need help with?
|
|
if (response == "s_54")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: My master, Valance Serth is missing! He was supposed to land at the Starport here an hour ago. I'm afraid something really bad happened and it would be entirely my fault!
|
|
string_id message = new string_id (c_stringFile, "s_56");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What are you talking about? How would it be your fault?
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I will help you find your master.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sorry, too busy. He may have taken another ship.
|
|
boolean hasResponse2 = false;
|
|
if (c_ddroid_droid_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_58");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_94");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_98");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No. Who would want to help a droid?
|
|
if (response == "s_102")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: It isn't me that you would be helping, but my master. Please, please come back if you change your mind. Otherwise, he will be doomed!
|
|
string_id message = new string_id (c_stringFile, "s_104");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: My master, Valance Serth is missing! He was supposed to land at the Starport here an hour ago. I'm afraid something really bad happened and it would be entirely my fault!
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What are you talking about? How would it be your fault?
|
|
if (response == "s_58")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Everything is my fault! My master was supposed to come here and meet me. I tried to find out what happened, but no one at the Starport will talk to me. I'm afraid that something terrible has happened to him.
|
|
string_id message = new string_id (c_stringFile, "s_60");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What would make you say that?
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Could he have just left you here?
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_62");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_74");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will help you find your master.
|
|
if (response == "s_94")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_givequest1 (player, npc);
|
|
|
|
//-- NPC: Oh thank you! Please go to the Moenia Starport. There is a lady named Selan Ellison. Maybe she could help you. Please hurry. Who knows what may have eaten him!
|
|
string_id message = new string_id (c_stringFile, "s_96");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sorry, too busy. He may have taken another ship.
|
|
if (response == "s_98")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: He's never late! My master hates to be late. That's why I am worried.
|
|
string_id message = new string_id (c_stringFile, "s_100");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Everything is my fault! My master was supposed to come here and meet me. I tried to find out what happened, but no one at the Starport will talk to me. I'm afraid that something terrible has happened to him.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What would make you say that?
|
|
if (response == "s_62")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Someone was looking for him. They needed to give him an urgent message from some prince. Once I told them what ship he was traveling on, they told me not to expect him. Can you help him?
|
|
string_id message = new string_id (c_stringFile, "s_64");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I can help you find your master.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No. I'm not into helping droids.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_66");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_70");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Could he have just left you here?
|
|
if (response == "s_74")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: How could you say that? I am a protocol droid! No one would be cruel enough to leave their loyal servant. Anyway, he couldn't do without me. I am fluent in over 1.5 million forms of communication and am excellent in facilitating diplomacy.
|
|
string_id message = new string_id (c_stringFile, "s_76");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Right. I can help you find your master. What can you tell me about him?
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't think I'm interested.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_78");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_90");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Someone was looking for him. They needed to give him an urgent message from some prince. Once I told them what ship he was traveling on, they told me not to expect him. Can you help him?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I can help you find your master.
|
|
if (response == "s_66")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_givequest1 (player, npc);
|
|
|
|
//-- NPC: Oh thank you! His name is Valance Serth. He's from Corellia. There is a lady named Selan Ellison at the Starport. Maybe she could help you.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No. I'm not into helping droids.
|
|
if (response == "s_70")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Maybe someone will come along that is kinder than you and help me find my poor master.
|
|
string_id message = new string_id (c_stringFile, "s_72");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: How could you say that? I am a protocol droid! No one would be cruel enough to leave their loyal servant. Anyway, he couldn't do without me. I am fluent in over 1.5 million forms of communication and am excellent in facilitating diplomacy.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Right. I can help you find your master. What can you tell me about him?
|
|
if (response == "s_78")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: His name is Valance Serth and he's from Corellia. His father was a member of Corsec until he died. His mother...
|
|
string_id message = new string_id (c_stringFile, "s_80");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Valance Serth, right. I'll start looking.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Maybe I will help another time.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_82");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_86");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't think I'm interested.
|
|
if (response == "s_90")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh dear. Please reconsider. My master's life may be on the line!
|
|
string_id message = new string_id (c_stringFile, "s_92");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: His name is Valance Serth and he's from Corellia. His father was a member of Corsec until he died. His mother...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Valance Serth, right. I'll start looking.
|
|
if (response == "s_82")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_givequest1 (player, npc);
|
|
|
|
//-- NPC: Thank you. There is a lady named Selan Ellison at the Starport. Maybe she could help you.
|
|
string_id message = new string_id (c_stringFile, "s_84");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Maybe I will help another time.
|
|
if (response == "s_86")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Another time may be too late! I'll have to find someone else.
|
|
string_id message = new string_id (c_stringFile, "s_88");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh, you are back. Where is my master, have you seen him?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I have seen him. He is on Talus.
|
|
if (response == "s_108")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Talus? What did you do to him? Oh dear. I should be there for him.
|
|
string_id message = new string_id (c_stringFile, "s_110");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: He was hurt when his ship crashed but he's recovering.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_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_112");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Maybe. I don't think I want to tell you though.
|
|
if (response == "s_136")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh he must be dead. Master, I wasn't there for you! Oh master!
|
|
string_id message = new string_id (c_stringFile, "s_138");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: There's nothing that I can tell you that would be of any use right now.
|
|
if (response == "s_140")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Please go find out what happened to him. I'm sure he needs help.
|
|
string_id message = new string_id (c_stringFile, "s_142");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Talus? What did you do to him? Oh dear. I should be there for him.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: He was hurt when his ship crashed but he's recovering.
|
|
if (response == "s_112")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh thank the maker! He will be all right. I won't be a droid without a master after all. After those men came here threatening me and you too! They wanted to know when you started looking for my master.
|
|
string_id message = new string_id (c_stringFile, "s_114");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: They did?
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Why did you tell them anything?!
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_116");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_128");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh thank the maker! He will be all right. I won't be a droid without a master after all. After those men came here threatening me and you too! They wanted to know when you started looking for my master.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: They did?
|
|
if (response == "s_116")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh yes. When I told them that you were going to look for him immediately, they left in a hurry. I do hope you are well.
|
|
string_id message = new string_id (c_stringFile, "s_118");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Well enough. Master Serth wants you to run this program.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, no thanks to you. Run this program through your banks.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_120");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_124");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 18);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Why did you tell them anything?!
|
|
if (response == "s_128")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Was I not supposed to say anything? At first I thought they were going to help you find him. How am I supposed to know?
|
|
string_id message = new string_id (c_stringFile, "s_130");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Never mind. Master Serth wants you to run this program.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_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_132");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 21);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch18 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh yes. When I told them that you were going to look for him immediately, they left in a hurry. I do hope you are well.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well enough. Master Serth wants you to run this program.
|
|
if (response == "s_120")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_memwipedroid (player, npc);
|
|
|
|
//-- NPC: Certainly, if my master wants it...oh my, what was I saying? How strange. Here, I am supposed to give this to you, I think.
|
|
string_id message = new string_id (c_stringFile, "s_122");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, no thanks to you. Run this program through your banks.
|
|
if (response == "s_124")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_memwipedroid (player, npc);
|
|
|
|
//-- NPC: Oh dear, I hope it's safe. I wouldn't want to jeopardize...hmm, what was I saying? I think I am supposed to give this to you.
|
|
string_id message = new string_id (c_stringFile, "s_126");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int c_ddroid_droid_handleBranch21 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Was I not supposed to say anything? At first I thought they were going to help you find him. How am I supposed to know?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Never mind. Master Serth wants you to run this program.
|
|
if (response == "s_132")
|
|
{
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
c_ddroid_droid_action_memwipedroid (player, npc);
|
|
|
|
//-- NPC: Certainly, if my master wants it...oh my, what was I saying? How strange. Here, I am supposed to give this to you, I think.
|
|
string_id message = new string_id (c_stringFile, "s_134");
|
|
utils.removeScriptVar (player, "conversation.c_ddroid_droid.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_droid");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "C-3TC");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "C-3TC");
|
|
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_droid");
|
|
|
|
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_droid_condition_playerhasquest (player, npc))
|
|
{
|
|
c_ddroid_droid_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Oh dear, oh dear. My poor master! Can you help me?
|
|
string_id message = new string_id (c_stringFile, "s_52");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do you need help with?
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No. Who would want to help a droid?
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_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_54");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_102");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "c_ddroid_droid", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition_playernotdoneQ2 (player, npc))
|
|
{
|
|
c_ddroid_droid_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Oh, you are back. Where is my master, have you seen him?
|
|
string_id message = new string_id (c_stringFile, "s_106");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I have seen him. He is on Talus.
|
|
boolean hasResponse0 = false;
|
|
if (c_ddroid_droid_condition_quest2complete (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Maybe. I don't think I want to tell you though.
|
|
boolean hasResponse1 = false;
|
|
if (c_ddroid_droid_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: There's nothing that I can tell you that would be of any use right now.
|
|
boolean hasResponse2 = false;
|
|
if (c_ddroid_droid_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_108");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_136");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_140");
|
|
|
|
utils.setScriptVar (player, "conversation.c_ddroid_droid.branchId", 15);
|
|
|
|
npcStartConversation (player, npc, "c_ddroid_droid", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (c_ddroid_droid_condition_memwiped (player, npc))
|
|
{
|
|
c_ddroid_droid_action_faceplayer (player, npc);
|
|
|
|
//-- NPC: Hello! I seem to be a bit lost. Droids need masters, but I don't have one. How odd. Maybe someone will come for me soon.
|
|
string_id message = new string_id (c_stringFile, "s_144");
|
|
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_droid")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.c_ddroid_droid.branchId");
|
|
|
|
if (branchId == 1 && c_ddroid_droid_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && c_ddroid_droid_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && c_ddroid_droid_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && c_ddroid_droid_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && c_ddroid_droid_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && c_ddroid_droid_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && c_ddroid_droid_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && c_ddroid_droid_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && c_ddroid_droid_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 18 && c_ddroid_droid_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 21 && c_ddroid_droid_handleBranch21 (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_droid.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|