mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
1023 lines
28 KiB
Plaintext
1023 lines
28 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// borvos_guard.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.36 - 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/borvos_guard";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean borvos_guard_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_finishedJobONe (obj_id player, obj_id npc)
|
|
{
|
|
if ( groundquests.isTaskActive (player, "quest/borvos_guard_dagorel", "returningFromDagorel") ||
|
|
groundquests.hasCompletedQuest (player, "quest/borvos_guard_dagorel") )
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_finishedJobTwo (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/borvos_guard_frangee", "returningAfterKillingFrangee") ||
|
|
groundquests.hasCompletedQuest (player, "quest/borvos_guard_frangee"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_onJobOne (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive (player, "quest/borvos_guard_dagorel"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_onJobTwo (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive (player, "quest/borvos_guard_frangee"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_onJobThree (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive (player, "quest/borvos_guard_corellia"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_finishedJobThree (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/borvos_guard_corellia", "returningWithBorvosStuff"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_workingForBorvo (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/borvos_guard_corellia"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean borvos_guard_condition_isOnHuffQuest (obj_id player, obj_id npc)
|
|
{
|
|
if ( groundquests.isQuestActive (player, "quest/huffs_guard_rifle") )
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void borvos_guard_action_giveJobOne (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/borvos_guard_dagorel");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void borvos_guard_action_giveJobTwo (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/borvos_guard_frangee");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void borvos_guard_action_giveJobThree (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/borvos_guard_corellia");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void borvos_guard_action_signalJobOneDone (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "finishedJobOne");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void borvos_guard_action_signalJobTwoDone (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "finishedJobTwo");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void borvos_guard_action_signalJobThreeDone (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal (player, "finishedJobThree");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int borvos_guard_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, what do you know? You did it? Excellent. Say, I heard Frangee had a badge on him. I got something else I want you to do.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm game for anything.
|
|
if (response == "s_21")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobThree (player, npc);
|
|
|
|
//-- NPC: Great. Take this badge. Frangee was supposed to report to his superiors. I think he'll still make that meeting, right Detective?
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks, I'm done working for you.
|
|
if (response == "s_22")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you want done now?
|
|
if (response == "s_23")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We've got the snitches badge. I want you to take it to Corellia and meet with his superiors. They likely don't know him on sight. Find out what's going on.
|
|
string_id message = new string_id (c_stringFile, "s_25");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Yeah, I think I can do that.
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Way too dangerous for me.
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_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_26");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_27");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int borvos_guard_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We've got the snitches badge. I want you to take it to Corellia and meet with his superiors. They likely don't know him on sight. Find out what's going on.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yeah, I think I can do that.
|
|
if (response == "s_26")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobThree (player, npc);
|
|
|
|
//-- NPC: Great. Take this badge. Frangee was supposed to report to his superiors. I think he'll still make that meeting, right Detective?
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Way too dangerous for me.
|
|
if (response == "s_27")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int borvos_guard_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Dagorel said the job was a setup. Seems this guy Frangee was an undercover security guy. I want you to make sure he doesn't yap to his bosses.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I hate snitches. I'm on it.
|
|
if (response == "s_18")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobTwo (player, npc);
|
|
|
|
//-- NPC: I thought you looked like our kind of guy. I'll give you the coordinates to his last known location.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: This sounds like trouble.
|
|
if (response == "s_34")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Was Frangee working for Borvo?
|
|
if (response == "s_36")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: One of our most trusted guys! He even trained me. Wait, you're not a cop are you? You take out Frangee and that'll prove you're not a rat snitch yourself.
|
|
string_id message = new string_id (c_stringFile, "s_38");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sure, I'll do it.
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No way, I'm not going against the law!
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_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_40");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int borvos_guard_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: One of our most trusted guys! He even trained me. Wait, you're not a cop are you? You take out Frangee and that'll prove you're not a rat snitch yourself.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure, I'll do it.
|
|
if (response == "s_40")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobTwo (player, npc);
|
|
|
|
//-- NPC: I thought you looked like our kind of guy. I'll give you the coordinates to his last known location.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No way, I'm not going against the law!
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int borvos_guard_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: How ya doin'? So you wanna talk with Borvo? Well that ain't easy. You wanna help us out, then maybe I'll vouch for ya?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What can I do to help?
|
|
if (response == "s_48")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Dagorel's been shot. I need you to deliver a medpack to him. Be careful, I don't know if there are any thugs hanging out around there.
|
|
string_id message = new string_id (c_stringFile, "s_50");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No problem.
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks.
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_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_52");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_54");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks, I didn't want to see Borvo that bad.
|
|
if (response == "s_56")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure, I'll help out.
|
|
if (response == "s_60")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobOne (player, npc);
|
|
|
|
//-- NPC: Great. Here's a medpack. Get it to Dagorel before he passes out.
|
|
string_id message = new string_id (c_stringFile, "s_62");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int borvos_guard_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Dagorel's been shot. I need you to deliver a medpack to him. Be careful, I don't know if there are any thugs hanging out around there.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No problem.
|
|
if (response == "s_52")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
borvos_guard_action_giveJobOne (player, npc);
|
|
|
|
//-- NPC: Great. Here's a medpack. Get it to Dagorel before he passes out.
|
|
string_id message = new string_id (c_stringFile, "s_62");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks.
|
|
if (response == "s_54")
|
|
{
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then why are you wasting my time? Get outta here before you need an image designer to get your face back in order!
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.borvos_guard");
|
|
|
|
messageTo(self, "handleSetConversable", null, 2, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
messageTo(self, "handleSetConversable", null, 2, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler handleSetConversable()
|
|
{
|
|
if ( isInvulnerable(self) )
|
|
{
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setCondition(self, CONDITION_SPACE_INTERESTING);
|
|
}
|
|
else
|
|
{
|
|
clearCondition(self, CONDITION_CONVERSABLE);
|
|
clearCondition(self, CONDITION_SPACE_INTERESTING);
|
|
detachScript(self, "conversation.borvos_guard");
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuRequest (obj_id player, menu_info menuInfo)
|
|
{
|
|
if ( isInvulnerable(self) )
|
|
{
|
|
int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById (menu);
|
|
menuInfoData.setServerNotify (false);
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
faceTo(self, player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.borvos_guard");
|
|
|
|
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 (borvos_guard_condition_workingForBorvo (player, npc))
|
|
{
|
|
//-- NPC: Hey, good to see you again. You can go right in.
|
|
string_id message = new string_id (c_stringFile, "s_32");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_finishedJobThree (player, npc))
|
|
{
|
|
borvos_guard_action_signalJobThreeDone (player, npc);
|
|
|
|
//-- NPC: Fantastic. You brought back the Boss's stolen goods! You can go see Borvo now. Thanks for doing that work for us.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_onJobThree (player, npc))
|
|
{
|
|
//-- NPC: Have you met with the detectives bosses yet?
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_finishedJobTwo (player, npc))
|
|
{
|
|
borvos_guard_action_signalJobTwoDone (player, npc);
|
|
|
|
//-- NPC: Well, what do you know? You did it? Excellent. Say, I heard Frangee had a badge on him. I got something else I want you to do.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm game for anything.
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks, I'm done working for you.
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: What do you want done now?
|
|
boolean hasResponse2 = false;
|
|
if (borvos_guard_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_21");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_22");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_23");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "borvos_guard", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_onJobTwo (player, npc))
|
|
{
|
|
//-- NPC: Did you take care of that detective?
|
|
string_id message = new string_id (c_stringFile, "s_29");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_finishedJobONe (player, npc))
|
|
{
|
|
borvos_guard_action_signalJobOneDone (player, npc);
|
|
|
|
//-- NPC: Dagorel said the job was a setup. Seems this guy Frangee was an undercover security guy. I want you to make sure he doesn't yap to his bosses.
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I hate snitches. I'm on it.
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: This sounds like trouble.
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Was Frangee working for Borvo?
|
|
boolean hasResponse2 = false;
|
|
if (borvos_guard_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_18");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_34");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 8);
|
|
|
|
npcStartConversation (player, npc, "borvos_guard", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_onJobOne (player, npc))
|
|
{
|
|
//-- NPC: Did you deliver that medicine yet?
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition_isOnHuffQuest (player, npc))
|
|
{
|
|
//-- NPC: How ya doin'? So you wanna talk with Borvo? Well that ain't easy. You wanna help us out, then maybe I'll vouch for ya?
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What can I do to help?
|
|
boolean hasResponse0 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: No thanks, I didn't want to see Borvo that bad.
|
|
boolean hasResponse1 = false;
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sure, I'll help out.
|
|
boolean hasResponse2 = false;
|
|
if (borvos_guard_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_48");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_56");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
|
|
|
|
utils.setScriptVar (player, "conversation.borvos_guard.branchId", 12);
|
|
|
|
npcStartConversation (player, npc, "borvos_guard", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (borvos_guard_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Watch your step around here, because you can be certain that I will be watching as well.
|
|
string_id message = new string_id (c_stringFile, "s_64");
|
|
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 != "borvos_guard")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
if (branchId == 4 && borvos_guard_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && borvos_guard_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && borvos_guard_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && borvos_guard_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && borvos_guard_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && borvos_guard_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.borvos_guard.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|