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

535 lines
17 KiB
Plaintext

// ======================================================================
//
// junk_nathan_taike.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_nathan_taike";
// ======================================================================
// Script Conditions
// ======================================================================
boolean junk_nathan_taike_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean junk_nathan_taike_condition_check_inv (obj_id player, obj_id npc)
{
return smuggler.checkInventory(player, npc);
}
// ======================================================================
// Script Actions
// ======================================================================
void junk_nathan_taike_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_nathan_taike_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_nathan_taike_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well, well what do we have here? You certainly have the look of a hardened adventurer. Perhaps even one that is not opposed to helping out honest, hardworking farmers and make a few credits in the process?
//-- [RESPONSE NOTE]
//-- PLAYER: I have never been opposed to helping people...if the price is right.
if (response == "s_c20cb2b0")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: Well it is like this. The honest folk who are trying to eek out a living out here are sick and tired of those thieving Jawas. They scrimp and save enough just to buy a piece of equipment that will make their lives easier only to have the Jawas steal it the next day. It isn't right.
string_id message = new string_id (c_stringFile, "s_47a68e94");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: So you are looking for someone to take care of this Jawa problem?
boolean hasResponse0 = false;
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds to me like you need better security, not an exterminator.
boolean hasResponse1 = false;
if (junk_nathan_taike_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_e022ccee");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_b47d6575");
utils.setScriptVar (player, "conversation.junk_nathan_taike.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: You have me all wrong. I can't help anyone today.
if (response == "s_5b767310")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: So be it. There is always another that will come along and be willing to help us out.
string_id message = new string_id (c_stringFile, "s_eadc8d6e");
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_nathan_taike_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well it is like this. The honest folk who are trying to eek out a living out here are sick and tired of those thieving Jawas. They scrimp and save enough just to buy a piece of equipment that will make their lives easier only to have the Jawas steal it the next day. It isn't right.
//-- [RESPONSE NOTE]
//-- PLAYER: So you are looking for someone to take care of this Jawa problem?
if (response == "s_e022ccee")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: You could say that. I am willing to pay good money for proof that you are taking care of this Jawa problem. You bring me proof that you are taking care of this Jawa problem and I will be more then happy to buy that proof from you.
string_id message = new string_id (c_stringFile, "s_aaac386c");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What sort of proof are you looking for?
boolean hasResponse0 = false;
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sorry not really interested in this sort of dealing.
boolean hasResponse1 = false;
if (junk_nathan_taike_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_34475b33");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_e613f19");
utils.setScriptVar (player, "conversation.junk_nathan_taike.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds to me like you need better security, not an exterminator.
if (response == "s_b47d6575")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: Bah! I should have figured that a stranger wouldn't understand the extent of the problem.
string_id message = new string_id (c_stringFile, "s_735e3c59");
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_nathan_taike_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You could say that. I am willing to pay good money for proof that you are taking care of this Jawa problem. You bring me proof that you are taking care of this Jawa problem and I will be more then happy to buy that proof from you.
//-- [RESPONSE NOTE]
//-- PLAYER: What sort of proof are you looking for?
if (response == "s_34475b33")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: Well I have to be sure of where you get this proof from so I am not going to accept any old junk. Bring me back some of those Jawa blasters or those beads that they wear and I will buy those from you.
string_id message = new string_id (c_stringFile, "s_3b924e4a");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I think that I just might have some of this proof that you ask for.
boolean hasResponse0 = false;
if (junk_nathan_taike_condition_check_inv (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Ok, I will see what I can do to help all you honest farmers out.
boolean hasResponse1 = false;
if (junk_nathan_taike_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_ecf19442");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_69567be7");
utils.setScriptVar (player, "conversation.junk_nathan_taike.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sorry not really interested in this sort of dealing.
if (response == "s_e613f19")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: I guess I was wrong about the whole hardened adventurer thing.
string_id message = new string_id (c_stringFile, "s_808503a8");
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_nathan_taike_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Well I have to be sure of where you get this proof from so I am not going to accept any old junk. Bring me back some of those Jawa blasters or those beads that they wear and I will buy those from you.
//-- [RESPONSE NOTE]
//-- PLAYER: I think that I just might have some of this proof that you ask for.
if (response == "s_ecf19442")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
junk_nathan_taike_action_start_dealing (player, npc);
//-- NPC: Let me see what you have. And let me tell you, no one is going to pay better then I do for this sort of stuff.
string_id message = new string_id (c_stringFile, "s_33db8b80");
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Ok, I will see what I can do to help all you honest farmers out.
if (response == "s_69567be7")
{
//-- [NOTE]
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
//-- NPC: I knew from the moment I saw you that you were just the type that we needed.
string_id message = new string_id (c_stringFile, "s_2d363db3");
utils.removeScriptVar (player, "conversation.junk_nathan_taike.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.junk_nathan_taike");
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_nathan_taike");
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_nathan_taike_condition__defaultCondition (player, npc))
{
junk_nathan_taike_action_face_to (player, npc);
//-- NPC: Well, well what do we have here? You certainly have the look of a hardened adventurer. Perhaps even one that is not opposed to helping out honest, hardworking farmers and make a few credits in the process?
string_id message = new string_id (c_stringFile, "s_5ceff11f");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I have never been opposed to helping people...if the price is right.
boolean hasResponse0 = false;
if (junk_nathan_taike_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: You have me all wrong. I can't help anyone today.
boolean hasResponse1 = false;
if (junk_nathan_taike_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_c20cb2b0");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_5b767310");
utils.setScriptVar (player, "conversation.junk_nathan_taike.branchId", 1);
npcStartConversation (player, npc, "junk_nathan_taike", 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_nathan_taike")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.junk_nathan_taike.branchId");
if (branchId == 1 && junk_nathan_taike_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && junk_nathan_taike_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && junk_nathan_taike_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && junk_nathan_taike_handleBranch4 (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_nathan_taike.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================