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

355 lines
11 KiB
Plaintext

// ======================================================================
//
// junk_reggi_nym.script
//
//
//
// Created with SwgConversationEditor 1.36 - DO NOT EDIT THIS AUTO-GENERATED FILE!
//
// ======================================================================
// ======================================================================
// Library Includes
// ======================================================================
include library.ai_lib;
include library.chat;
include library.smuggler;
include library.utils;
// ======================================================================
// Script Constants
// ======================================================================
string c_stringFile = "conversation/junk_reggi_nym";
// ======================================================================
// Script Conditions
// ======================================================================
boolean junk_reggi_nym_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean junk_reggi_nym_condition_check_inv (obj_id player, obj_id npc)
{
return smuggler.checkInventory(player, npc);
}
// ======================================================================
// Script Actions
// ======================================================================
void junk_reggi_nym_action_start_dealing (obj_id player, obj_id npc)
{
dictionary params = new dictionary();
params.put("player", player);
messageTo(npc, "startDealing", params, 1.0f, false);
}
// ----------------------------------------------------------------------
void junk_reggi_nym_action_face_to (obj_id player, obj_id npc)
{
faceTo(npc, player);
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int junk_reggi_nym_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Looking for work? I don't know that for sure but normally people who come around here are always looking for something.
//-- [RESPONSE NOTE]
//-- PLAYER: I am always looking for work.
if (response == "s_ef8c7236")
{
//-- [NOTE]
if (junk_reggi_nym_condition__defaultCondition (player, npc))
{
//-- NPC: I don't really have to much in the way of jobs but Nym is always looking to buy weapons and such. He also has some bounties out on those cursed Blood Razors and Canyon Cosairs who haven't figured out their place yet.
string_id message = new string_id (c_stringFile, "s_14e5bdc0");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Well this looks like my lucky day.
boolean hasResponse0 = false;
if (junk_reggi_nym_condition_check_inv (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: It doesn't look like I have anything Nym would like to buy.
boolean hasResponse1 = false;
if (junk_reggi_nym_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_b8e27f3c");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_2e005077");
utils.setScriptVar (player, "conversation.junk_reggi_nym.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_reggi_nym.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Not really...work has never suited me.
if (response == "s_53d778d8")
{
//-- [NOTE]
if (junk_reggi_nym_condition__defaultCondition (player, npc))
{
//-- NPC: Truer words have never been spoken. But if you ever change your mind you know where to find me.
string_id message = new string_id (c_stringFile, "s_f25d9c2");
utils.removeScriptVar (player, "conversation.junk_reggi_nym.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_reggi_nym_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I don't really have to much in the way of jobs but Nym is always looking to buy weapons and such. He also has some bounties out on those cursed Blood Razors and Canyon Cosairs who haven't figured out their place yet.
//-- [RESPONSE NOTE]
//-- PLAYER: Well this looks like my lucky day.
if (response == "s_b8e27f3c")
{
//-- [NOTE]
if (junk_reggi_nym_condition__defaultCondition (player, npc))
{
junk_reggi_nym_action_start_dealing (player, npc);
//-- NPC: Being lucky is one of the best things in the world. Lets take a look at what you have to offer. Nym isn't much for bartering so you can take the price I give or you can leave it. Makes no difference to me really.
string_id message = new string_id (c_stringFile, "s_5c453a2f");
utils.removeScriptVar (player, "conversation.junk_reggi_nym.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: It doesn't look like I have anything Nym would like to buy.
if (response == "s_2e005077")
{
//-- [NOTE]
if (junk_reggi_nym_condition__defaultCondition (player, npc))
{
//-- NPC: Not a problem. Like I said Nym is always looking for these things so if you run across any come on back.
string_id message = new string_id (c_stringFile, "s_233f3214");
utils.removeScriptVar (player, "conversation.junk_reggi_nym.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.junk_reggi_nym");
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.junk_reggi_nym");
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 (junk_reggi_nym_condition__defaultCondition (player, npc))
{
junk_reggi_nym_action_face_to (player, npc);
//-- NPC: Looking for work? I don't know that for sure but normally people who come around here are always looking for something.
string_id message = new string_id (c_stringFile, "s_60d2f507");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am always looking for work.
boolean hasResponse0 = false;
if (junk_reggi_nym_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Not really...work has never suited me.
boolean hasResponse1 = false;
if (junk_reggi_nym_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_ef8c7236");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_53d778d8");
utils.setScriptVar (player, "conversation.junk_reggi_nym.branchId", 1);
npcStartConversation (player, npc, "junk_reggi_nym", 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 != "junk_reggi_nym")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.junk_reggi_nym.branchId");
if (branchId == 1 && junk_reggi_nym_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && junk_reggi_nym_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.junk_reggi_nym.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================