mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
1574 lines
45 KiB
Plaintext
1574 lines
45 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// tatooine_eisley_purvis.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// 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/tatooine_eisley_purvis";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean tatooine_eisley_purvis_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_completedRecon (obj_id player, obj_id npc)
|
|
{
|
|
return (groundquests.isTaskActive (player, "quest/purvis_recon_four", "return") ||
|
|
groundquests.hasCompletedQuest(player, "quest/purvis_recon_four"));
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_completedCombatQuests (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest(player, "quest/purvis_kill_warriors"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_isReadyForPurvis (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/c_ranged_combat_trainer") || (groundquests.isQuestActive (player, "quest/c_ranged_combat_trainer")))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_isOnCombatQuests (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isQuestActive(player, "quest/purvis_kill_zealots") || groundquests.isQuestActive(player, "quest/purvis_kill_soldiers") || groundquests.isQuestActive(player, "quest/purvis_kill_warriors") )
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_goSeeMayor (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "quest/purvis_kill_warriors", "newbie_ranged_e7"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_needsACombatQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest(player, "quest/purvis_kill_soldiers") && (!groundquests.hasCompletedQuest (player, "quest/purvis_kill_warriors")))
|
|
{
|
|
if (!groundquests.isQuestActive (player, "quest/purvis_kill_warriors"))
|
|
{
|
|
groundquests.requestGrantQuest(player, "quest/purvis_kill_warriors");
|
|
return true;
|
|
}
|
|
}
|
|
|
|
if (groundquests.hasCompletedQuest(player, "quest/purvis_kill_zealots") && (!groundquests.hasCompletedQuest (player, "quest/purvis_kill_soldiers")))
|
|
{
|
|
if (!groundquests.isQuestActive (player, "quest/purvis_kill_soldiers"))
|
|
{
|
|
groundquests.requestGrantQuest(player, "quest/purvis_kill_soldiers");
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_pickingPurvisPocket (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "quest/steal_speeder", "pickPurvisPocket"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_completedOneRecon (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest(player, "quest/purvis_recon_one") || groundquests.isQuestActive (player, "quest/purvis_recon_one"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_eisley_purvis_condition_senByMayor (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "c_ranged_combat_trainer");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void tatooine_eisley_purvis_action_grantReconQuest1 (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest(player, "quest/purvis_recon_one");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_grantCombatQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest (player, "quest/purvis_kill_zealots");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_startTaskThree (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "start_task_three");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_sendPocketPickSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "purvisPocketPicked");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_checkReconQuestStatus (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/purvis_recon_one") && (!groundquests.hasCompletedQuest (player, "quest/purvis_recon_two") && (!groundquests.isQuestActive (player, "quest/purvis_recon_two"))))
|
|
{
|
|
groundquests.requestGrantQuest (player, "quest/purvis_recon_two");
|
|
return;
|
|
}
|
|
|
|
if (groundquests.hasCompletedQuest (player, "quest/purvis_recon_two") && (!groundquests.hasCompletedQuest (player, "quest/purvis_recon_three") && (!groundquests.isQuestActive (player, "quest/purvis_recon_three"))))
|
|
{
|
|
groundquests.requestGrantQuest (player, "quest/purvis_recon_three");
|
|
return;
|
|
}
|
|
|
|
if (groundquests.hasCompletedQuest (player, "quest/purvis_recon_three") && (!groundquests.hasCompletedQuest (player, "quest/purvis_recon_four") && (!groundquests.isQuestActive (player, "quest/purvis_recon_four"))))
|
|
{
|
|
groundquests.requestGrantQuest (player, "quest/purvis_recon_four");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_endFromMayor (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "newbie_speak_purvis");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_eisley_purvis_action_sendCompleteReconSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "purvis_return");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int tatooine_eisley_purvis_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Recon's exciting, isn't it? No, I guess it's not. So let's get down to something exciting. Combat. Are you ready to battle for Mos Eisley?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Battle? Seriously?
|
|
if (response == "s_200")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We need to do something about your attitude, soldier. I need to hear a 'Yes Sir!'
|
|
string_id message = new string_id (c_stringFile, "s_205");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Um...Yes, sir?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, sir!
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_208");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_67");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I guess I'm ready for combat.
|
|
if (response == "s_203")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: We need to do something about your attitude, soldier. I need to hear a 'Yes Sir!'
|
|
string_id message = new string_id (c_stringFile, "s_205");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Um...Yes, sir?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, sir!
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_208");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_67");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We need to do something about your attitude, soldier. I need to hear a 'Yes Sir!'
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Um...Yes, sir?
|
|
if (response == "s_208")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: No! Put some heart into it. I know you've got more than that. Now give it to me! Let me hear a 'Yes, sir!'
|
|
string_id message = new string_id (c_stringFile, "s_211");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'm not gonna say it.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, sir!
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_213");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_69");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, sir!
|
|
if (response == "s_67")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantCombatQuest (player, npc);
|
|
|
|
//-- NPC: Good! Very good, indeed! Now, let's get you started. Here are your orders, now get out to the field.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: No! Put some heart into it. I know you've got more than that. Now give it to me! Let me hear a 'Yes, sir!'
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm not gonna say it.
|
|
if (response == "s_213")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, come on. Just for me?
|
|
string_id message = new string_id (c_stringFile, "s_216");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I don't think so.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_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_219");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, sir!
|
|
if (response == "s_69")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantCombatQuest (player, npc);
|
|
|
|
//-- NPC: Good! Very good, indeed! Now, let's get you started. Here are your orders, now get out to the field.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh, come on. Just for me?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't think so.
|
|
if (response == "s_219")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: There's not much point in my being a superior officer if I can't get a 'yes, sir' every once in a while is there?
|
|
string_id message = new string_id (c_stringFile, "s_221");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Doesn't matter to me.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Fine. Yes, sir!
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_224");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_250");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: There's not much point in my being a superior officer if I can't get a 'yes, sir' every once in a while is there?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Doesn't matter to me.
|
|
if (response == "s_224")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You're doing it now just to be mean. I mean why else would you stand here arguing with me. You could have just said it and been on your way by now.
|
|
string_id message = new string_id (c_stringFile, "s_227");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You think I'm just being mean?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Ok, I'll think about it.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_229");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_237");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Fine. Yes, sir!
|
|
if (response == "s_250")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantCombatQuest (player, npc);
|
|
|
|
//-- NPC: Good! Very good, indeed! Now, let's get you started. Here are your orders, now get out to the field.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You're doing it now just to be mean. I mean why else would you stand here arguing with me. You could have just said it and been on your way by now.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You think I'm just being mean?
|
|
if (response == "s_229")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Is that what it is? Are you just mean? I mean, seriously, how hard is it to just give me a 'yes, sir!' every once in a while?
|
|
string_id message = new string_id (c_stringFile, "s_232");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok, fine. Yes, sir!
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_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_235");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok, I'll think about it.
|
|
if (response == "s_237")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: What is there to think about? You'll either do it or you won't. I'm just saying I don't think it's too much to ask...
|
|
string_id message = new string_id (c_stringFile, "s_240");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Well, I'm not saying it.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Yes, sir!
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_243");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_248");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Is that what it is? Are you just mean? I mean, seriously, how hard is it to just give me a 'yes, sir!' every once in a while?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok, fine. Yes, sir!
|
|
if (response == "s_235")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantCombatQuest (player, npc);
|
|
|
|
//-- NPC: Good! Very good, indeed! Now, let's get you started. Here are your orders, now get out to the field.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: What is there to think about? You'll either do it or you won't. I'm just saying I don't think it's too much to ask...
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Well, I'm not saying it.
|
|
if (response == "s_243")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, come on. Just for me?
|
|
string_id message = new string_id (c_stringFile, "s_216");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I don't think so.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_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_219");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Yes, sir!
|
|
if (response == "s_248")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantCombatQuest (player, npc);
|
|
|
|
//-- NPC: Good! Very good, indeed! Now, let's get you started. Here are your orders, now get out to the field.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch15 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Don't fool yourself, we are at war. The Tusken Raiders are ready to take this city, and I won't let that happen. I won't let you let that happen either.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Good, I'm looking for work.
|
|
if (response == "s_254")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_endFromMayor (player, npc);
|
|
|
|
//-- NPC: The Tuskens are sneaky. They're living in that junk town just outside the city. I'm going to have you go out there and do some recon.
|
|
string_id message = new string_id (c_stringFile, "s_258");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds simple enough.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Can you explain a little more?
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_260");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_272");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What is it you want me to do?
|
|
if (response == "s_256")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_endFromMayor (player, npc);
|
|
|
|
//-- NPC: The Tuskens are sneaky. They're living in that junk town just outside the city. I'm going to have you go out there and do some recon.
|
|
string_id message = new string_id (c_stringFile, "s_258");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds simple enough.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Can you explain a little more?
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_260");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_272");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 16);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You have me confused with someone else.
|
|
if (response == "s_44")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh. My mistake then. I've gotta stop doing that.
|
|
string_id message = new string_id (c_stringFile, "s_46");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch16 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The Tuskens are sneaky. They're living in that junk town just outside the city. I'm going to have you go out there and do some recon.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds simple enough.
|
|
if (response == "s_260")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good attitude, soldier. I'm giving you a location to scout out, when you're done there I'll give you another one. You ready for this?
|
|
string_id message = new string_id (c_stringFile, "s_262");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll do it.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I think I'm busy right now.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_264");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_268");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Can you explain a little more?
|
|
if (response == "s_272")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I want to know what they're up to. I want you to go scout out their little town and see what it is they're planning.
|
|
string_id message = new string_id (c_stringFile, "s_274");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: That's it?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_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_276");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 20);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch17 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Good attitude, soldier. I'm giving you a location to scout out, when you're done there I'll give you another one. You ready for this?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll do it.
|
|
if (response == "s_264")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_grantReconQuest1 (player, npc);
|
|
|
|
//-- NPC: Good, good. Here's the location. Prepare your report when you arrive and I'll make contact with you when you're done.
|
|
string_id message = new string_id (c_stringFile, "s_266");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I think I'm busy right now.
|
|
if (response == "s_268")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: This war won't end because you're ignoring it. You come back to me when you're ready to do your duty to Mos Eisley.
|
|
string_id message = new string_id (c_stringFile, "s_270");
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_eisley_purvis_handleBranch20 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I want to know what they're up to. I want you to go scout out their little town and see what it is they're planning.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: That's it?
|
|
if (response == "s_276")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Good attitude, soldier. I'm giving you a location to scout out, when you're done there I'll give you another one. You ready for this?
|
|
string_id message = new string_id (c_stringFile, "s_262");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll do it.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I think I'm busy right now.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_264");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_268");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 17);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.tatooine_eisley_purvis");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
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.tatooine_eisley_purvis");
|
|
|
|
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 (tatooine_eisley_purvis_condition_completedCombatQuests (player, npc))
|
|
{
|
|
//-- NPC: You did good work, soldier, but now it's time for you to move on.
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition_goSeeMayor (player, npc))
|
|
{
|
|
//-- NPC: The mayor wants to tell you what a good job you're doing. Not that he'd ever say that to me...
|
|
string_id message = new string_id (c_stringFile, "s_132");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition_needsACombatQuest (player, npc))
|
|
{
|
|
//-- NPC: Don't forget, you're still on assignment.
|
|
string_id message = new string_id (c_stringFile, "s_136");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition_isOnCombatQuests (player, npc))
|
|
{
|
|
//-- NPC: Still dealing with those Tuskens, eh? Ok, well, get back out there. This isn't break time.
|
|
string_id message = new string_id (c_stringFile, "s_70");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition_completedRecon (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_sendCompleteReconSignal (player, npc);
|
|
|
|
//-- NPC: Recon's exciting, isn't it? No, I guess it's not. So let's get down to something exciting. Combat. Are you ready to battle for Mos Eisley?
|
|
string_id message = new string_id (c_stringFile, "s_197");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Battle? Seriously?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I guess I'm ready for combat.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_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_200");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_203");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "tatooine_eisley_purvis", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition_completedOneRecon (player, npc))
|
|
{
|
|
tatooine_eisley_purvis_action_checkReconQuestStatus (player, npc);
|
|
|
|
//-- NPC: What are you doing here? You should be out in the field, reconning those Tuskens!
|
|
string_id message = new string_id (c_stringFile, "s_66");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_eisley_purvis_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Don't fool yourself, we are at war. The Tusken Raiders are ready to take this city, and I won't let that happen. I won't let you let that happen either.
|
|
string_id message = new string_id (c_stringFile, "s_252");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Good, I'm looking for work.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_eisley_purvis_condition_senByMayor (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: What is it you want me to do?
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_eisley_purvis_condition_senByMayor (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: You have me confused with someone else.
|
|
boolean hasResponse2 = false;
|
|
if (!tatooine_eisley_purvis_condition_senByMayor (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_254");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_256");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_44");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_eisley_purvis.branchId", 15);
|
|
|
|
npcStartConversation (player, npc, "tatooine_eisley_purvis", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
trigger OnNpcConversationResponse (string conversationId, obj_id player, string_id response)
|
|
{
|
|
if (conversationId != "tatooine_eisley_purvis")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
if (branchId == 5 && tatooine_eisley_purvis_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && tatooine_eisley_purvis_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && tatooine_eisley_purvis_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && tatooine_eisley_purvis_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && tatooine_eisley_purvis_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && tatooine_eisley_purvis_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && tatooine_eisley_purvis_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && tatooine_eisley_purvis_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 15 && tatooine_eisley_purvis_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 16 && tatooine_eisley_purvis_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 17 && tatooine_eisley_purvis_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 20 && tatooine_eisley_purvis_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.tatooine_eisley_purvis.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|