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

1206 lines
35 KiB
Plaintext

// ======================================================================
//
// bib_fortuna.script
//
//
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.groundquests;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/bib_fortuna";
// ======================================================================
// Script Conditions
// ======================================================================
boolean bib_fortuna_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_completedBib (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest (player, "quest/jabba_bib_fortuna_v2"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_killedRomoVax (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "returnToBib"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_killingRomoVax (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "killRomoVax"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_takeDisksToBib (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "takeDiskToBib"))
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_dealingWithRomo (obj_id player, obj_id npc)
{
if (groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "speakToRomo") ||
groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "returnToRomo") ||
groundquests.isTaskActive (player, "quest/jabba_bib_fortuna_v2", "getRomosDisks") )
{
return true;
}
return false;
}
// ----------------------------------------------------------------------
boolean bib_fortuna_condition_completedBarada (obj_id player, obj_id npc)
{
if (groundquests.hasCompletedQuest (player, "quest/jabba_barada_v2"))
{
return true;
}
return false;
}
// ======================================================================
// Script Actions
// ======================================================================
void bib_fortuna_action_grantBibsQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest (player, "quest/jabba_bib_fortuna_v2");
}
// ----------------------------------------------------------------------
void bib_fortuna_action_sendGotDisksSignal (obj_id player, obj_id npc)
{
faceTo(npc, player);
groundquests.sendSignal (player, "romosDisksDelivered");
}
// ----------------------------------------------------------------------
void bib_fortuna_action_sendKilledRomoSignal (obj_id player, obj_id npc)
{
faceTo(npc, player);
groundquests.sendSignal (player, "romoVaxKilled");
groundquests.grantQuest(player, "pointer_jabba");
}
// ----------------------------------------------------------------------
void bib_fortuna_action_clearPointer (obj_id player, obj_id npc)
{
faceTo(npc, player);
groundquests.sendSignal (player, "found_bib");
}
// ----------------------------------------------------------------------
void bib_fortuna_action_facePlayer (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int bib_fortuna_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Aha! You've done it! That should take care of that little problem. It's unfortunate that Romo Vax was a spy. My understanding is that it's a name the Sennex pirates have used for many years, with many different agents. We should be more careful in the future.
//-- [RESPONSE NOTE]
//-- PLAYER: So I've completed my part?
if (response == "s_75")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_sendKilledRomoSignal (player, npc);
//-- NPC: For now, yes. Here's a little something for your trouble. I don't want you to think that we fail in our generosity when someone does well. Jabba himself was impressed by this mission, and would like to speak to you as soon as possible.
string_id message = new string_id (c_stringFile, "s_76");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Ah! The data! Yes, this is what I've been waiting for. I'll get this encryption cracked right away. In the meantime, you must answer for your earlier deeds. Those spies that were troubling Romo were working for me. I've long suspected that Romo was double-crossing us.
//-- [RESPONSE NOTE]
//-- PLAYER: Double-crossing you? Why would Romo Vax do that?
if (response == "s_39")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_sendGotDisksSignal (player, npc);
//-- NPC: Because he is working for the Sennex pirates. Despite your interference with my spies in Wayfar, I've been able to verify Romo's association with the Sennex. To make amends to me for killing my spies, you shall go take care of Romo Vax. I want him eliminated.
string_id message = new string_id (c_stringFile, "s_40");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: More and more I hear your name in the Palace. I need things done. You will do them for me, yes?
//-- [RESPONSE NOTE]
//-- PLAYER: I'm not interested in any jobs right now.
if (response == "s_20")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Too bad, too bad. Jabba can always use someone who knows how to get things done. Perhaps if you change your mind you will come back and see me?
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I am definitely here to get things done.
if (response == "s_24")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_grantBibsQuest (player, npc);
//-- NPC: Excellent.Our friend, Romo Vax, has sent me a signal from the city of Wayfar. He has a disk, he would like to sell it to us. You will go and retrieve it.
string_id message = new string_id (c_stringFile, "s_26");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Who are you?
if (response == "s_28")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: I am Bib Fortuna, majordomo to Jabba the Hutt.
string_id message = new string_id (c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What's a majordomo?
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: What do you need done?
boolean hasResponse1 = false;
if (bib_fortuna_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_32");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_58");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I am Bib Fortuna, majordomo to Jabba the Hutt.
//-- [RESPONSE NOTE]
//-- PLAYER: What's a majordomo?
if (response == "s_32")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: I handle the day to day affairs of the Palace. Things Jabba's immense mind should not have to deal with. Minor details of the operations that he need not concern himself with.
string_id message = new string_id (c_stringFile, "s_34");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sounds important.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds like you're a secretary.
boolean hasResponse1 = false;
if (bib_fortuna_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_36");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_46");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What do you need done?
if (response == "s_58")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Romo Vax, a friend to the Palace, has arrived in Wayfar. He has a disk for sale. We wish to purchase it. Someone needs to take him the money. And return, of course, with the disk.
string_id message = new string_id (c_stringFile, "s_60");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can do that.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds like busy work. No thanks.
boolean hasResponse1 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: What's on this disk?
boolean hasResponse2 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_62");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_64");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_66");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I handle the day to day affairs of the Palace. Things Jabba's immense mind should not have to deal with. Minor details of the operations that he need not concern himself with.
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds important.
if (response == "s_36")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: It is. but what's important to me right now is whether or not I can count on you to handle this task. I need money delivered to Romo Vax in Wayfar, and I need the disk he is delivering brought back here. Can you do it?
string_id message = new string_id (c_stringFile, "s_38");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No, thanks. I'm busy.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sure. I'll do it.
boolean hasResponse1 = false;
if (bib_fortuna_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_42");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_44");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 13);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds like you're a secretary.
if (response == "s_46")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: The way things seem and the way things are is not always the same. If you don't understand this, then perhaps you're not cut out to work here after all.
string_id message = new string_id (c_stringFile, "s_48");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Maybe not. See you later.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sorry, I didn't mean to be rude.
boolean hasResponse1 = false;
if (bib_fortuna_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_50");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_52");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 14);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch13 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It is. but what's important to me right now is whether or not I can count on you to handle this task. I need money delivered to Romo Vax in Wayfar, and I need the disk he is delivering brought back here. Can you do it?
//-- [RESPONSE NOTE]
//-- PLAYER: No, thanks. I'm busy.
if (response == "s_42")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Too bad, too bad. Jabba can always use someone who knows how to get things done. Perhaps if you change your mind you will come back and see me?
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. I'll do it.
if (response == "s_44")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_grantBibsQuest (player, npc);
//-- NPC: Excellent.Our friend, Romo Vax, has sent me a signal from the city of Wayfar. He has a disk, he would like to sell it to us. You will go and retrieve it.
string_id message = new string_id (c_stringFile, "s_26");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch14 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The way things seem and the way things are is not always the same. If you don't understand this, then perhaps you're not cut out to work here after all.
//-- [RESPONSE NOTE]
//-- PLAYER: Maybe not. See you later.
if (response == "s_50")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Too bad, too bad. Jabba can always use someone who knows how to get things done. Perhaps if you change your mind you will come back and see me?
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sorry, I didn't mean to be rude.
if (response == "s_52")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: No apology is necessary. Now, can I count on you to do this job? Deliver this money to Wayfar? To Romo Vax? And bring me back the disk?
string_id message = new string_id (c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure. Why not?
boolean hasResponse0 = false;
if (bib_fortuna_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_56");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 15);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: No apology is necessary. Now, can I count on you to do this job? Deliver this money to Wayfar? To Romo Vax? And bring me back the disk?
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. Why not?
if (response == "s_56")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_grantBibsQuest (player, npc);
//-- NPC: Excellent.Our friend, Romo Vax, has sent me a signal from the city of Wayfar. He has a disk, he would like to sell it to us. You will go and retrieve it.
string_id message = new string_id (c_stringFile, "s_26");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Romo Vax, a friend to the Palace, has arrived in Wayfar. He has a disk for sale. We wish to purchase it. Someone needs to take him the money. And return, of course, with the disk.
//-- [RESPONSE NOTE]
//-- PLAYER: I can do that.
if (response == "s_62")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_grantBibsQuest (player, npc);
//-- NPC: Excellent.Our friend, Romo Vax, has sent me a signal from the city of Wayfar. He has a disk, he would like to sell it to us. You will go and retrieve it.
string_id message = new string_id (c_stringFile, "s_26");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds like busy work. No thanks.
if (response == "s_64")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Too bad, too bad. Jabba can always use someone who knows how to get things done. Perhaps if you change your mind you will come back and see me?
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: What's on this disk?
if (response == "s_66")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Do not ask questions when the answers could mean the end of your life. Do you understand what I'm saying?
string_id message = new string_id (c_stringFile, "s_68");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Yes. Fine, I'll go get the disk.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Uh, I think so. This sounds too dangerous for me.
boolean hasResponse1 = false;
if (bib_fortuna_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_70");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_72");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int bib_fortuna_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Do not ask questions when the answers could mean the end of your life. Do you understand what I'm saying?
//-- [RESPONSE NOTE]
//-- PLAYER: Yes. Fine, I'll go get the disk.
if (response == "s_70")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_grantBibsQuest (player, npc);
//-- NPC: Excellent.Our friend, Romo Vax, has sent me a signal from the city of Wayfar. He has a disk, he would like to sell it to us. You will go and retrieve it.
string_id message = new string_id (c_stringFile, "s_26");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Uh, I think so. This sounds too dangerous for me.
if (response == "s_72")
{
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
//-- NPC: Too bad, too bad. Jabba can always use someone who knows how to get things done. Perhaps if you change your mind you will come back and see me?
string_id message = new string_id (c_stringFile, "s_22");
utils.removeScriptVar (player, "conversation.bib_fortuna.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.bib_fortuna");
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
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.bib_fortuna");
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 (bib_fortuna_condition_completedBib (player, npc))
{
bib_fortuna_action_facePlayer (player, npc);
//-- NPC: Be careful, the Palace holds many secrets. Make sure your death is not one of them.
string_id message = new string_id (c_stringFile, "s_4");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition_killedRomoVax (player, npc))
{
//-- NPC: Aha! You've done it! That should take care of that little problem. It's unfortunate that Romo Vax was a spy. My understanding is that it's a name the Sennex pirates have used for many years, with many different agents. We should be more careful in the future.
string_id message = new string_id (c_stringFile, "s_6");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So I've completed my part?
boolean hasResponse0 = false;
if (bib_fortuna_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_75");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 2);
npcStartConversation (player, npc, "bib_fortuna", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition_killingRomoVax (player, npc))
{
bib_fortuna_action_facePlayer (player, npc);
//-- NPC: Why does Romo Vax still draw breath?
string_id message = new string_id (c_stringFile, "s_10");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition_takeDisksToBib (player, npc))
{
//-- NPC: Ah! The data! Yes, this is what I've been waiting for. I'll get this encryption cracked right away. In the meantime, you must answer for your earlier deeds. Those spies that were troubling Romo were working for me. I've long suspected that Romo was double-crossing us.
string_id message = new string_id (c_stringFile, "s_12");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Double-crossing you? Why would Romo Vax do that?
boolean hasResponse0 = false;
if (bib_fortuna_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_39");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 5);
npcStartConversation (player, npc, "bib_fortuna", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition_dealingWithRomo (player, npc))
{
bib_fortuna_action_facePlayer (player, npc);
//-- NPC: Until you have the disk I suggest you get back to Romo Vax. I don't like you working for him, but do whatever needs to be done to get that disk into our hands.
string_id message = new string_id (c_stringFile, "s_16");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition_completedBarada (player, npc))
{
bib_fortuna_action_clearPointer (player, npc);
//-- NPC: More and more I hear your name in the Palace. I need things done. You will do them for me, yes?
string_id message = new string_id (c_stringFile, "s_18");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'm not interested in any jobs right now.
boolean hasResponse0 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I am definitely here to get things done.
boolean hasResponse1 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: Who are you?
boolean hasResponse2 = false;
if (bib_fortuna_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse2 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_20");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_24");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_28");
utils.setScriptVar (player, "conversation.bib_fortuna.branchId", 8);
npcStartConversation (player, npc, "bib_fortuna", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (bib_fortuna_condition__defaultCondition (player, npc))
{
bib_fortuna_action_facePlayer (player, npc);
//-- NPC: Jabba has no time for people today. In fact, unless you'd like to be a Rancor's snack, I suggest you make a hasty exit from here.
string_id message = new string_id (c_stringFile, "s_74");
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 != "bib_fortuna")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.bib_fortuna.branchId");
if (branchId == 2 && bib_fortuna_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && bib_fortuna_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && bib_fortuna_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && bib_fortuna_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && bib_fortuna_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 13 && bib_fortuna_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 14 && bib_fortuna_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && bib_fortuna_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && bib_fortuna_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && bib_fortuna_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.bib_fortuna.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================