mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-12 23:45:12 -04:00
891 lines
25 KiB
Plaintext
891 lines
25 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// tatooine_knives_contact.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.features;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/tatooine_knives_contact";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean tatooine_knives_contact_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_contact_condition_onQuest (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
|
|
boolean OnTask= (questIsQuestActive(questId1, player));
|
|
|
|
return OnTask;
|
|
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_contact_condition_onTask (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
int snitch = groundquests.getTaskId(questId1, "tatooine_knives_thrust_e4");
|
|
|
|
boolean tatooine_knives_contact_condition_onTask = questIsTaskActive(questId1, snitch, player);
|
|
|
|
return tatooine_knives_contact_condition_onTask;
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_contact_condition_questComplete (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_parry");
|
|
int questId2 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
|
|
boolean OnTask = (questIsQuestComplete(questId1, player))||(questIsQuestComplete(questId2, player));
|
|
|
|
return OnTask;
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_contact_condition_onTorP (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/tatoonie_knives_thrust");
|
|
int questId2 = questGetQuestId("quest/tatoonie_knives_parry");
|
|
|
|
boolean OnTask= (questIsQuestActive(questId1, player))||(questIsQuestActive(questId2, player));
|
|
|
|
return OnTask;
|
|
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_contact_condition_isDisabled (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestDisabled ("tatooine_knives_thrust") ||
|
|
groundquests.isQuestDisabled ("tatooine_knives_parry") ||
|
|
groundquests.isQuestDisabled ("tatooine_knives_fencing");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void tatooine_knives_contact_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_knives_contact_action_giveQuest (obj_id player, obj_id npc)
|
|
{
|
|
int questId = questGetQuestId("quest/yavin_meganjobs_hyperdrive");
|
|
|
|
groundquests.grantQuest(questId, player, npc, true);
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_knives_contact_action_signal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "yavin_meganjobs_launch_e14");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int tatooine_knives_contact_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Looks like you have gotten in deep here. Hope things haven't gotten to complex for you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nothing is ever simple at the Lucky Despot.
|
|
if (response == "s_25")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_knives_contact_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You have that right.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well welcome to the Lucky Despot. What are you here for?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Fun, travel, and adventure. Don't care which.
|
|
if (response == "s_8")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well then I expect you can find all of those here. You should talk to either Kavas or Ind here. They work for Lady Valarian.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Maybe I am not ready for that.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_12");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_18");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So what is the story with the Lucky Despot.
|
|
if (response == "s_22")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The Lucky Despot is run by Lady Valarian. A kind and generous patron who has many diverse business interests, some more legitimate than others.
|
|
string_id message = new string_id (c_stringFile, "s_27");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: More or less legitimate?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: If I was looking for work or just something exciting to do, who would I talk to?
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_29");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_44");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well then I expect you can find all of those here. You should talk to either Kavas or Ind here. They work for Lady Valarian.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good.
|
|
if (response == "s_12")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Be careful with those two though. You could get more than you bargained for. There is allot of bad blood between them.
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Thanks.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_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_40");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Maybe I am not ready for that.
|
|
if (response == "s_18")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I fully understand. Nothing is ever simple at the Lucky Despot.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Be careful with those two though. You could get more than you bargained for. There is allot of bad blood between them.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Thanks.
|
|
if (response == "s_40")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: No problem.
|
|
string_id message = new string_id (c_stringFile, "s_42");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The Lucky Despot is run by Lady Valarian. A kind and generous patron who has many diverse business interests, some more legitimate than others.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: More or less legitimate?
|
|
if (response == "s_29")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well yes. For example Kavas is in charge of getting goods on and off planet. Goods that Lady Valarian does not want to pass through customs.
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Is that all?
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_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_33");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: If I was looking for work or just something exciting to do, who would I talk to?
|
|
if (response == "s_44")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well then I expect you can find all of those here. You should talk to either Kavas or Ind here. They work for Lady Valarian.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Maybe I am not ready for that.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_12");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_18");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well yes. For example Kavas is in charge of getting goods on and off planet. Goods that Lady Valarian does not want to pass through customs.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Is that all?
|
|
if (response == "s_33")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Nope. Ind over there runs the gambling operations. Both are always looking for new blood to help them out.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll talk to them. Maybe I can find some excitement and some profit at the same time.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Sounds a bit complex to me.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_37");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_39");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 11);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_contact_handleBranch11 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Nope. Ind over there runs the gambling operations. Both are always looking for new blood to help them out.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll talk to them. Maybe I can find some excitement and some profit at the same time.
|
|
if (response == "s_37")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well then I expect you can find all of those here. You should talk to either Kavas or Ind here. They work for Lady Valarian.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Maybe I am not ready for that.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_12");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_18");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds a bit complex to me.
|
|
if (response == "s_39")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I fully understand. Nothing is ever simple at the Lucky Despot.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.tatooine_knives_contact");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Baboo");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Baboo");
|
|
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_knives_contact");
|
|
|
|
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_knives_contact_condition_isDisabled (player, npc))
|
|
{
|
|
//-- NPC: Welcome to the Lucky Despot.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition_questComplete (player, npc))
|
|
{
|
|
tatooine_knives_contact_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Looks like you have gotten in deep here. Hope things haven't gotten to complex for you.
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Nothing is ever simple at the Lucky Despot.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_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_25");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "tatooine_knives_contact", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_knives_contact_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Well welcome to the Lucky Despot. What are you here for?
|
|
string_id message = new string_id (c_stringFile, "s_41");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Fun, travel, and adventure. Don't care which.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_contact_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: So what is the story with the Lucky Despot.
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_contact_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_8");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_22");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_contact.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "tatooine_knives_contact", 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_knives_contact")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.tatooine_knives_contact.branchId");
|
|
|
|
if (branchId == 2 && tatooine_knives_contact_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && tatooine_knives_contact_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && tatooine_knives_contact_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && tatooine_knives_contact_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && tatooine_knives_contact_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && tatooine_knives_contact_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 11 && tatooine_knives_contact_handleBranch11 (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_knives_contact.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|