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

1151 lines
33 KiB
Plaintext

// ======================================================================
//
// tatooine_eisley_brannix.script
//
//
//
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/tatooine_eisley_brannix";
// ======================================================================
// Script Conditions
// ======================================================================
boolean tatooine_eisley_brannix_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean tatooine_eisley_brannix_condition_cultQuestComplete (obj_id player, obj_id npc)
{
int questId1 = questGetQuestId("quest/tatooine_eisley_krayt_cult");
boolean OnTask = (questIsQuestComplete(questId1, player));
return OnTask;
}
// ----------------------------------------------------------------------
boolean tatooine_eisley_brannix_condition_cultTaskComplete (obj_id player, obj_id npc)
{
int questId1 = questGetQuestId("quest/tatooine_eisley_krayt_cult");
int tat_eisley_krayt_cult_e2 = groundquests.getTaskId(questId1, "tat_eisley_krayt_cult_e2");
boolean onTask = questIsTaskActive(questId1, tat_eisley_krayt_cult_e2, player);
return onTask;
}
// ----------------------------------------------------------------------
boolean tatooine_eisley_brannix_condition_cultOnTask (obj_id player, obj_id npc)
{
int questId1 = questGetQuestId("quest/tatooine_eisley_krayt_cult");
int tat_eisley_krayt_cult_e1 = groundquests.getTaskId(questId1, "tat_eisley_krayt_cult_e1");
boolean onTask = questIsTaskActive(questId1, tat_eisley_krayt_cult_e1, player);
return onTask;
}
// ----------------------------------------------------------------------
boolean tatooine_eisley_brannix_condition_blocker (obj_id player, obj_id npc)
{
return groundquests.isQuestDisabled("tatooine_eisley_krayt_cult");
}
// ======================================================================
// Script Actions
// ======================================================================
void tatooine_eisley_brannix_action_facePlayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ----------------------------------------------------------------------
void tatooine_eisley_brannix_action_grantCultQuest (obj_id player, obj_id npc)
{
int questId = questGetQuestId("quest/tatooine_eisley_krayt_cult");
groundquests.grantQuest(questId, player, npc, true);
}
// ----------------------------------------------------------------------
void tatooine_eisley_brannix_action_signalCultReward (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "tat_eisley_krayt_cult_e2");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int tatooine_eisley_brannix_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Did you get the fetishes?
//-- [RESPONSE NOTE]
//-- PLAYER: Of course. Do you have my money?
if (response == "s_44")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: I can't believe you want to be paid after that. You did yourself a great service by killing those fools. They might have come after your children next.
string_id message = new string_id (c_stringFile, "s_45");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I don't have any children, and I do expect to be paid.
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_46");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I can't believe you want to be paid after that. You did yourself a great service by killing those fools. They might have come after your children next.
//-- [RESPONSE NOTE]
//-- PLAYER: I don't have any children, and I do expect to be paid.
if (response == "s_46")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: Well no worries, I have your credits right here.
string_id message = new string_id (c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks.
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_48");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 5);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well no worries, I have your credits right here.
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks.
if (response == "s_48")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: I know someone that has more work if you're interested.
string_id message = new string_id (c_stringFile, "s_49");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure.
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_61");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I know someone that has more work if you're interested.
//-- [RESPONSE NOTE]
//-- PLAYER: Sure.
if (response == "s_61")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: Her name is Tori. She's a biochemist. Here's her location.
string_id message = new string_id (c_stringFile, "s_62");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Thanks.
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_63");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Her name is Tori. She's a biochemist. Here's her location.
//-- [RESPONSE NOTE]
//-- PLAYER: Thanks.
if (response == "s_63")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
tatooine_eisley_brannix_action_signalCultReward (player, npc);
//-- NPC: Thank you.
string_id message = new string_id (c_stringFile, "s_64");
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I can't believe we have those worthless cultists right here in Mos Eisley. Someone needs to take care of those wackos.
//-- [RESPONSE NOTE]
//-- PLAYER: What cultists are you talking about?
if (response == "s_20")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: The Cult of the Krayt. They dug out a collapsed cave right outside town and now they are in there doing their strange dragon rituals and harassing people to give up technology and come join them. They are Idiots, all of them.
string_id message = new string_id (c_stringFile, "s_22");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What kind of rituals?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What do you mean they give up technology?
boolean hasResponse1 = false;
if (tatooine_eisley_brannix_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_24");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_30");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The Cult of the Krayt. They dug out a collapsed cave right outside town and now they are in there doing their strange dragon rituals and harassing people to give up technology and come join them. They are Idiots, all of them.
//-- [RESPONSE NOTE]
//-- PLAYER: What kind of rituals?
if (response == "s_24")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: I heard they feed their own children to Krayt Dragons. They worship a monster. That is intolerable.
string_id message = new string_id (c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So what do you want me to do about it?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_28");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What do you mean they give up technology?
if (response == "s_30")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: They live in a cave! What more do you need to know? They cook in fire pits, and wear tanned hides. We travel through the stars and take it for granted. They worry about their hide scraping rock breaking. It's not decent.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: They sound like Tuskens
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_34");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I heard they feed their own children to Krayt Dragons. They worship a monster. That is intolerable.
//-- [RESPONSE NOTE]
//-- PLAYER: So what do you want me to do about it?
if (response == "s_28")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: Each of them carries a fetish. A symbol of their devotion to the Krayts. Bring me some of those. I want to be able to show people what to look out for. I want people to be informed when they are asked if they want to join their cult.
string_id message = new string_id (c_stringFile, "s_40");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You only want these fetishes?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_42");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: They live in a cave! What more do you need to know? They cook in fire pits, and wear tanned hides. We travel through the stars and take it for granted. They worry about their hide scraping rock breaking. It's not decent.
//-- [RESPONSE NOTE]
//-- PLAYER: They sound like Tuskens
if (response == "s_34")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: No, the Tuskens don't know any better. It's the best their animal minds can come up with. These null brains do it because they want it that way.
string_id message = new string_id (c_stringFile, "s_36");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So what do you want me to do about it?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_38");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No, the Tuskens don't know any better. It's the best their animal minds can come up with. These null brains do it because they want it that way.
//-- [RESPONSE NOTE]
//-- PLAYER: So what do you want me to do about it?
if (response == "s_38")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: Each of them carries a fetish. A symbol of their devotion to the Krayts. Bring me some of those. I want to be able to show people what to look out for. I want people to be informed when they are asked if they want to join their cult.
string_id message = new string_id (c_stringFile, "s_40");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: You only want these fetishes?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_42");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Each of them carries a fetish. A symbol of their devotion to the Krayts. Bring me some of those. I want to be able to show people what to look out for. I want people to be informed when they are asked if they want to join their cult.
//-- [RESPONSE NOTE]
//-- PLAYER: You only want these fetishes?
if (response == "s_42")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: Well, the trick is, they consider the fetish to be a personal connection with the Krayts. They won't give these up willingly.
string_id message = new string_id (c_stringFile, "s_53");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I see. So you want me to kill them?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_55");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, the trick is, they consider the fetish to be a personal connection with the Krayts. They won't give these up willingly.
//-- [RESPONSE NOTE]
//-- PLAYER: I see. So you want me to kill them?
if (response == "s_55")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: They already feed their children to monstrous beasts. All you will be doing is granting their wish to be closer to that which they worship. Please you must do this before even one more child is abducted and fed to their Dragons!
string_id message = new string_id (c_stringFile, "s_57");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Ok. I'll get your fetishes for you.
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sorry, not interested.
boolean hasResponse1 = false;
if (tatooine_eisley_brannix_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_59");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_67");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_eisley_brannix_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: They already feed their children to monstrous beasts. All you will be doing is granting their wish to be closer to that which they worship. Please you must do this before even one more child is abducted and fed to their Dragons!
//-- [RESPONSE NOTE]
//-- PLAYER: Ok. I'll get your fetishes for you.
if (response == "s_59")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
tatooine_eisley_brannix_action_grantCultQuest (player, npc);
//-- NPC: Here is where you can find their cave.
string_id message = new string_id (c_stringFile, "s_65");
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sorry, not interested.
if (response == "s_67")
{
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: I hope they never come for you.
string_id message = new string_id (c_stringFile, "s_70");
utils.removeScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
chat.chat (npc, player, message);
npcEndConversation (player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.tatooine_eisley_brannix");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
setName (self, "Brannix Tzg'ada");
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, "Brannix Tzg'ada");
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_brannix");
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_brannix_condition_blocker (player, npc))
{
//-- NPC: Sorry, no time to talk.
string_id message = new string_id (c_stringFile, "s_69");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_eisley_brannix_condition_cultQuestComplete (player, npc))
{
//-- NPC: A one person slaughterhouse, that's what you are. Thanks for taking out those cultists.
string_id message = new string_id (c_stringFile, "s_51");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_eisley_brannix_condition_cultTaskComplete (player, npc))
{
//-- NPC: Did you get the fetishes?
string_id message = new string_id (c_stringFile, "s_43");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Of course. Do you have my money?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_44");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 3);
npcStartConversation (player, npc, "tatooine_eisley_brannix", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_eisley_brannix_condition_cultOnTask (player, npc))
{
//-- NPC: You must destroy those cultists. Go now!
string_id message = new string_id (c_stringFile, "s_50");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_eisley_brannix_condition__defaultCondition (player, npc))
{
//-- NPC: I can't believe we have those worthless cultists right here in Mos Eisley. Someone needs to take care of those wackos.
string_id message = new string_id (c_stringFile, "s_18");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What cultists are you talking about?
boolean hasResponse0 = false;
if (tatooine_eisley_brannix_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_20");
utils.setScriptVar (player, "conversation.tatooine_eisley_brannix.branchId", 10);
npcStartConversation (player, npc, "tatooine_eisley_brannix", 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_brannix")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.tatooine_eisley_brannix.branchId");
if (branchId == 3 && tatooine_eisley_brannix_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && tatooine_eisley_brannix_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && tatooine_eisley_brannix_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && tatooine_eisley_brannix_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && tatooine_eisley_brannix_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && tatooine_eisley_brannix_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && tatooine_eisley_brannix_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && tatooine_eisley_brannix_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && tatooine_eisley_brannix_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && tatooine_eisley_brannix_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && tatooine_eisley_brannix_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && tatooine_eisley_brannix_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && tatooine_eisley_brannix_handleBranch17 (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_brannix.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================