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

803 lines
24 KiB
Plaintext

// ======================================================================
//
// nym_themepark_smuggler.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/nym_themepark_smuggler";
// ======================================================================
// Script Conditions
// ======================================================================
boolean nym_themepark_smuggler_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean nym_themepark_smuggler_condition_isReadyToGetChems (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "u16_nym_themepark_smuggler_01", "findSmuggler")
|| (groundquests.hasCompletedQuest(player, "u16_nym_themepark_smuggler_01")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_gather_chemicals"));
}
// ----------------------------------------------------------------------
boolean nym_themepark_smuggler_condition_hasChems (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "u16_nym_themepark_gather_chemicals", "goSeeSmuggler");
}
// ----------------------------------------------------------------------
boolean nym_themepark_smuggler_condition_deletedFixQuest (obj_id player, obj_id npc)
{
return groundquests.hasCompletedQuest(player, "u16_nym_themepark_gather_chemicals")
&& !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber");
}
// ----------------------------------------------------------------------
boolean nym_themepark_smuggler_condition_hasChemsQuestNotComplete (obj_id player, obj_id npc)
{
return groundquests.isTaskActive(player, "u16_nym_themepark_gather_chemicals", "needsToGatherChemical");
}
// ======================================================================
// Script Actions
// ======================================================================
void nym_themepark_smuggler_action_giveChemQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_gather_chemicals");
}
// ----------------------------------------------------------------------
void nym_themepark_smuggler_action_finishUpchem (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasSeenSmuggler");
}
// ----------------------------------------------------------------------
void nym_themepark_smuggler_action_finishUpJumper (obj_id player, obj_id npc)
{
groundquests.sendSignal(player, "hasFoundSmuggler");
}
// ----------------------------------------------------------------------
void nym_themepark_smuggler_action_giveFixQuest (obj_id player, obj_id npc)
{
groundquests.grantQuest(player, "u16_nym_themepark_repair_mixing_chamber");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int nym_themepark_smuggler_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You don't have all the raw chemical, yet, do you?
//-- [RESPONSE NOTE]
//-- PLAYER: No, not really.
if (response == "s_40")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I know there's plenty out there... it make the rocks kinda white-ish if that helps. I don't have all day; if you can't find enough of the raw stuff in time I'll just have to ship what I've got, understand?
string_id message = new string_id (c_stringFile, "s_41");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Okay, okay, keep your shirt on! I'll be back soon.
boolean hasResponse0 = false;
if (nym_themepark_smuggler_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.nym_themepark_smuggler.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I know there's plenty out there... it make the rocks kinda white-ish if that helps. I don't have all day; if you can't find enough of the raw stuff in time I'll just have to ship what I've got, understand?
//-- [RESPONSE NOTE]
//-- PLAYER: Okay, okay, keep your shirt on! I'll be back soon.
if (response == "s_42")
{
doAnimationAction (player, "standing_placate");
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (player, "wave_on_dismissing");
//-- NPC: No, no, take your time. I'd rather turn a profit than return a favor.
string_id message = new string_id (c_stringFile, "s_43");
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch5 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You got the Chemical?
//-- [RESPONSE NOTE]
//-- PLAYER: I believe I have enough of it, yes.
if (response == "s_11")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_accusingly");
nym_themepark_smuggler_action_giveFixQuest (player, npc);
//-- NPC: Great. It'll be good to be out from under Nym; you make sure to let him know we're square, got it?
string_id message = new string_id (c_stringFile, "s_12");
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Who are you, how did you find me, who sent you here, what do you want?!
//-- [RESPONSE NOTE]
//-- PLAYER: Blue! Wait, I mean... relax! I was sent by Ralia Reevens, Nym's Quarter...
if (response == "s_13")
{
doAnimationAction (player, "slow_down");
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod_head_multiple");
//-- NPC: ...Master, yes yes, I know her. I suppose she's wanting to cash in on the favor I owe Nym, huh? Well it's about time! What does she want?
string_id message = new string_id (c_stringFile, "s_15");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: She said you would have access to a quantity of Cationic Chemical Coagulant...
boolean hasResponse0 = false;
if (nym_themepark_smuggler_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_17");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: ...Master, yes yes, I know her. I suppose she's wanting to cash in on the favor I owe Nym, huh? Well it's about time! What does she want?
//-- [RESPONSE NOTE]
//-- PLAYER: She said you would have access to a quantity of Cationic Chemical Coagulant...
if (response == "s_17")
{
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Yes, there's a great need for liquid filtration supplies throughout the galaxy and the Empire has been trying to corner the market. Fortunately, this volcano produces excellent deposits of one type of coagulant.
string_id message = new string_id (c_stringFile, "s_19");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you'll give me some, then?
boolean hasResponse0 = false;
if (nym_themepark_smuggler_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_21");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Yes, there's a great need for liquid filtration supplies throughout the galaxy and the Empire has been trying to corner the market. Fortunately, this volcano produces excellent deposits of one type of coagulant.
//-- [RESPONSE NOTE]
//-- PLAYER: So you'll give me some, then?
if (response == "s_21")
{
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_no");
//-- NPC: Not so fast! Favor or not, I don't just give stuff away. You'll have to get your hands dirty if you want anything from me.
string_id message = new string_id (c_stringFile, "s_23");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Figures. So what do I have to do?
boolean hasResponse0 = false;
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_25");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Not so fast! Favor or not, I don't just give stuff away. You'll have to get your hands dirty if you want anything from me.
//-- [RESPONSE NOTE]
//-- PLAYER: Figures. So what do I have to do?
if (response == "s_25")
{
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I have the processed chemical you need, but in return I need you to supply me with the raw stuff so I can still make my scheduled shipment.
string_id message = new string_id (c_stringFile, "s_27");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: And how do I do that?
boolean hasResponse0 = false;
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: And what if I don't want to?
boolean hasResponse1 = false;
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_29");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_33");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 11);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int nym_themepark_smuggler_handleBranch11 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I have the processed chemical you need, but in return I need you to supply me with the raw stuff so I can still make my scheduled shipment.
//-- [RESPONSE NOTE]
//-- PLAYER: And how do I do that?
if (response == "s_29")
{
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "point_away");
nym_themepark_smuggler_action_giveChemQuest (player, npc);
//-- NPC: There are deposits scattered around the volcano. Just dig up a few and bring 'em back to me. Simple enough, right?
string_id message = new string_id (c_stringFile, "s_31");
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: And what if I don't want to?
if (response == "s_33")
{
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave_on_dismissing");
//-- NPC: If you can't stand the heat, get off the volcano.
string_id message = new string_id (c_stringFile, "s_35");
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.nym_themepark_smuggler");
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.nym_themepark_smuggler");
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 (nym_themepark_smuggler_condition_deletedFixQuest (player, npc))
{
doAnimationAction (npc, "dismiss");
nym_themepark_smuggler_action_giveFixQuest (player, npc);
//-- NPC: You look like you got lost. I gave you the chemicals, now leave!
string_id message = new string_id (c_stringFile, "s_37");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_smuggler_condition_hasChemsQuestNotComplete (player, npc))
{
doAnimationAction (player, "poke");
//-- NPC: You don't have all the raw chemical, yet, do you?
string_id message = new string_id (c_stringFile, "s_39");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: No, not really.
boolean hasResponse0 = false;
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses [] = new string_id [numberOfResponses];
if (hasResponse0)
responses [responseIndex++] = new string_id (c_stringFile, "s_40");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 2);
npcStartConversation (player, npc, "nym_themepark_smuggler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_smuggler_condition_hasChems (player, npc))
{
doAnimationAction (npc, "point_accusingly");
nym_themepark_smuggler_action_finishUpchem (player, npc);
//-- NPC: You got the Chemical?
string_id message = new string_id (c_stringFile, "s_10");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I believe I have enough of it, yes.
boolean hasResponse0 = false;
if (nym_themepark_smuggler_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_11");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 5);
npcStartConversation (player, npc, "nym_themepark_smuggler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_smuggler_condition_isReadyToGetChems (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
nym_themepark_smuggler_action_finishUpJumper (player, npc);
//-- NPC: Who are you, how did you find me, who sent you here, what do you want?!
string_id message = new string_id (c_stringFile, "s_8");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Blue! Wait, I mean... relax! I was sent by Ralia Reevens, Nym's Quarter...
boolean hasResponse0 = false;
if (nym_themepark_smuggler_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_13");
utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 7);
npcStartConversation (player, npc, "nym_themepark_smuggler", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (nym_themepark_smuggler_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "dismiss");
//-- NPC: Unless you have a business proposal you can just go away.
string_id message = new string_id (c_stringFile, "s_38");
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 != "nym_themepark_smuggler")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
if (branchId == 2 && nym_themepark_smuggler_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && nym_themepark_smuggler_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 5 && nym_themepark_smuggler_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && nym_themepark_smuggler_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && nym_themepark_smuggler_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && nym_themepark_smuggler_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && nym_themepark_smuggler_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 11 && nym_themepark_smuggler_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================