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

606 lines
18 KiB
Plaintext

// ======================================================================
//
// npe_smuggler_jake.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/npe_smuggler_jake";
// ======================================================================
// Script Conditions
// ======================================================================
boolean npe_smuggler_jake_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean npe_smuggler_jake_condition_onFirstStep (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_smuggler_try", "talktojake");
}
// ----------------------------------------------------------------------
boolean npe_smuggler_jake_condition_onRewardStep (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "npe_smuggler_try", "imDone");
}
// ----------------------------------------------------------------------
boolean npe_smuggler_jake_condition_finishedFirstStep (obj_id player, obj_id npc)
{
return groundquests.hasCompletedTask(player, "npe_smuggler_try", "talktojake");
}
// ----------------------------------------------------------------------
boolean npe_smuggler_jake_condition_playerNeedsHanQuest (obj_id player, obj_id npc)
{
return (groundquests.hasCompletedQuest(player, "npe_smuggler_try") &&
!groundquests.isQuestActiveOrComplete(player, "npe_smuggler_try_2"));
}
// ----------------------------------------------------------------------
boolean npe_smuggler_jake_condition_playerFinishedQuest (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "npe_smuggler_try");
}
// ======================================================================
// Script Actions
// ======================================================================
void npe_smuggler_jake_action_sendJobTaken (obj_id player, obj_id npc)
{
groundquests.sendSignal (player, "npe_smuggler_try_take_work");
}
// ----------------------------------------------------------------------
void npe_smuggler_jake_action_sendFinishedJob (obj_id player, obj_id npc)
{
groundquests.sendSignal (player, "reward");
groundquests.grantQuest(player, "npe_smuggler_try_2");
}
// ----------------------------------------------------------------------
void npe_smuggler_jake_action_giveHanQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "npe_smuggler_try_2");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int npe_smuggler_jake_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Excellent work. You are all that your reputation says. I have your payment here and a request.
//-- [RESPONSE NOTE]
//-- PLAYER: What's the request?
if (response == "s_30")
{
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
npe_smuggler_jake_action_sendFinishedJob (player, npc);
//-- NPC: I sent a message to Solo to thank him for sending you to me. He mentioned that he wants to talk to you again. He has something for you, I guess.
string_id message = new string_id (c_stringFile, "s_31");
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_smuggler_jake_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Wait, you're %TU, aren't you? What are you doing here?
//-- [RESPONSE NOTE]
//-- PLAYER: Han Solo thought you might have work for a good smuggler.
if (response == "s_15")
{
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
//-- NPC: I do. And you are a good smuggler, I guess. Maybe I can't afford you.
string_id message = new string_id (c_stringFile, "s_17");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Considering I'm stuck on this station, I think you can.
boolean hasResponse0 = false;
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Let me buy you a Corellian Brandy and we can talk.
boolean hasResponse1 = false;
if (npe_smuggler_jake_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_19");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_23");
utils.setScriptVar (player, "conversation.npe_smuggler_jake.branchId", 6);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_smuggler_jake_handleBranch6 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I do. And you are a good smuggler, I guess. Maybe I can't afford you.
//-- [RESPONSE NOTE]
//-- PLAYER: Considering I'm stuck on this station, I think you can.
if (response == "s_19")
{
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
//-- NPC: I need to move a crate of sliced weapons off Station Gamma. It pays 500 credits. You interested?
string_id message = new string_id (c_stringFile, "s_21");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure. I could use the work.
boolean hasResponse0 = false;
if (npe_smuggler_jake_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_26");
utils.setScriptVar (player, "conversation.npe_smuggler_jake.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Let me buy you a Corellian Brandy and we can talk.
if (response == "s_23")
{
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "snap_finger1");
//-- NPC: I'll take you up on that. Another brandy over here, please! I need to move a specific cargo from Outpost Gamma. It's a crate of sliced weapons. It pays 500 credits. Interested?
string_id message = new string_id (c_stringFile, "s_25");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Sure. I could use the work.
boolean hasResponse0 = false;
if (npe_smuggler_jake_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_26");
utils.setScriptVar (player, "conversation.npe_smuggler_jake.branchId", 7);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_smuggler_jake_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need to move a crate of sliced weapons off Station Gamma. It pays 500 credits. You interested?
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. I could use the work.
if (response == "s_26")
{
npe_smuggler_jake_action_sendJobTaken (player, npc);
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
npe_smuggler_jake_action_sendJobTaken (player, npc);
//-- NPC: Very good! I will add instructions to your journal. Good luck!
string_id message = new string_id (c_stringFile, "s_35");
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int npe_smuggler_jake_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'll take you up on that. Another brandy over here, please! I need to move a specific cargo from Outpost Gamma. It's a crate of sliced weapons. It pays 500 credits. Interested?
//-- [RESPONSE NOTE]
//-- PLAYER: Sure. I could use the work.
if (response == "s_26")
{
npe_smuggler_jake_action_sendJobTaken (player, npc);
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
npe_smuggler_jake_action_sendJobTaken (player, npc);
//-- NPC: Very good! I will add instructions to your journal. Good luck!
string_id message = new string_id (c_stringFile, "s_35");
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.npe_smuggler_jake");
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setName (self, "Jake Felan (Smuggler)");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
setAnimationMood(self, "npc_sitting_chair");
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setInvulnerable (self, true);
setName (self, "Jake Felan (Smuggler)");
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
setAnimationMood(self, "npc_sitting_chair");
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.npe_smuggler_jake");
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 (npe_smuggler_jake_condition_playerFinishedQuest (player, npc))
{
//-- NPC: Great work. Your reputation is well-earned.
string_id message = new string_id (c_stringFile, "s_32");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_smuggler_jake_condition_onRewardStep (player, npc))
{
//-- NPC: Excellent work. You are all that your reputation says. I have your payment here and a request.
string_id message = new string_id (c_stringFile, "s_29");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What's the request?
boolean hasResponse0 = false;
if (npe_smuggler_jake_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_30");
utils.setScriptVar (player, "conversation.npe_smuggler_jake.branchId", 2);
npcStartConversation (player, npc, "npe_smuggler_jake", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_smuggler_jake_condition_finishedFirstStep (player, npc))
{
//-- NPC: The weapons haven't been taken to the drop point. I left instructions in your journal. Please refer to it for instructions.
string_id message = new string_id (c_stringFile, "s_27");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_smuggler_jake_condition_onFirstStep (player, npc))
{
doAnimationAction (npc, "taken_aback");
//-- NPC: Wait, you're %TU, aren't you? What are you doing here?
string_id message = new string_id (c_stringFile, "s_13");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Han Solo thought you might have work for a good smuggler.
boolean hasResponse0 = false;
if (npe_smuggler_jake_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_15");
utils.setScriptVar (player, "conversation.npe_smuggler_jake.branchId", 5);
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
npcStartConversation (player, npc, "npe_smuggler_jake", null, pp, responses);
}
else
{
prose_package pp = new prose_package ();
pp.stringId = message;
pp.actor.set (player);
pp.target.set (npc);
chat.chat (npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (npe_smuggler_jake_condition__defaultCondition (player, npc))
{
//-- NPC: Ah, I love Corellian Brandy! Here's to Corellia!
string_id message = new string_id (c_stringFile, "s_36");
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 != "npe_smuggler_jake")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.npe_smuggler_jake.branchId");
if (branchId == 2 && npe_smuggler_jake_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && npe_smuggler_jake_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 6 && npe_smuggler_jake_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && npe_smuggler_jake_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && npe_smuggler_jake_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.npe_smuggler_jake.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================