mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
291 lines
9.2 KiB
Plaintext
291 lines
9.2 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// u13_boba_fett.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.conversation;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/u13_boba_fett";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean u13_boba_fett_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean u13_boba_fett_condition_sidequest_active (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "u13_vengeance_sidequest");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean u13_boba_fett_condition_returning_sidequest (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "u13_vengeance_sidequest", "u13_vengeance_sidequest_02") ||
|
|
groundquests.hasCompletedQuest(player, "u13_vengeance_sidequest");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void u13_boba_fett_action_grant_u13_vengeance_sidequest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.requestGrantQuest(player, "u13_vengeance_sidequest");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void u13_boba_fett_action_signal_u13_vengeance_sidequest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "u13_vengeance_sidequest_02");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int u13_boba_fett_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I've heard about you. Taking a lot of jobs that involve getting your hands bloody. Or at least dirty. I'd like to know what the new talent is capable of handling...whether you're a bounty hunter or not. After all, I may have to hunt you some day. So with that in mind, I'm going to throw three bounties your way. I've already done the hard part and tracked them to this bunker. See if you can handle the rest.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I can a handle it.
|
|
if (response == "s_4")
|
|
{
|
|
//-- [NOTE]
|
|
if (u13_boba_fett_condition__defaultCondition (player, npc))
|
|
{
|
|
u13_boba_fett_action_grant_u13_vengeance_sidequest (player, npc);
|
|
|
|
//-- NPC: Well, we'll see, won't we.
|
|
string_id message = new string_id (c_stringFile, "s_5");
|
|
utils.removeScriptVar (player, "conversation.u13_boba_fett.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'm not interested. Go find some other test dummy.
|
|
if (response == "s_6")
|
|
{
|
|
//-- [NOTE]
|
|
if (u13_boba_fett_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I see. You're either frightened or overconfident. Either way, you've already revealed much to me.
|
|
string_id message = new string_id (c_stringFile, "s_7");
|
|
utils.removeScriptVar (player, "conversation.u13_boba_fett.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.u13_boba_fett");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
|
|
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.u13_boba_fett");
|
|
|
|
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 (u13_boba_fett_condition_returning_sidequest (player, npc))
|
|
{
|
|
u13_boba_fett_action_signal_u13_vengeance_sidequest (player, npc);
|
|
|
|
//-- NPC: Passable, I suppose. I'm underwhelmed mostly, but you did manage to complete my bounties. That's something.
|
|
string_id message = new string_id (c_stringFile, "s_9");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (u13_boba_fett_condition_sidequest_active (player, npc))
|
|
{
|
|
//-- NPC: What are you standing around for? We're not here for tea and crumpets. Go.
|
|
string_id message = new string_id (c_stringFile, "s_8");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (u13_boba_fett_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I've heard about you. Taking a lot of jobs that involve getting your hands bloody. Or at least dirty. I'd like to know what the new talent is capable of handling...whether you're a bounty hunter or not. After all, I may have to hunt you some day. So with that in mind, I'm going to throw three bounties your way. I've already done the hard part and tracked them to this bunker. See if you can handle the rest.
|
|
string_id message = new string_id (c_stringFile, "s_3");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I can a handle it.
|
|
boolean hasResponse0 = false;
|
|
if (u13_boba_fett_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'm not interested. Go find some other test dummy.
|
|
boolean hasResponse1 = false;
|
|
if (u13_boba_fett_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_4");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_6");
|
|
|
|
utils.setScriptVar (player, "conversation.u13_boba_fett.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "u13_boba_fett", 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 != "u13_boba_fett")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.u13_boba_fett.branchId");
|
|
|
|
if (branchId == 3 && u13_boba_fett_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.u13_boba_fett.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|