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

537 lines
16 KiB
Plaintext

// ======================================================================
//
// junk_dender_theed.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_dender_theed";
// ======================================================================
// Script Conditions
// ======================================================================
boolean junk_dender_theed_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean junk_dender_theed_condition_check_inv (obj_id player, obj_id npc)
{
return smuggler.checkInventory(player, npc);
}
// ======================================================================
// Script Actions
// ======================================================================
void junk_dender_theed_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_dender_theed_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_dender_theed_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Hey there! Just what do you think you are doing walkin' up to me like that. If this were one of my bad days you would be six feet under right now. But since I am feelin' generous I will let it slide this time.
//-- [RESPONSE NOTE]
//-- PLAYER: That decision was the smartest thing you have ever done.
if (response == "s_12400728")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: So you do have some guts, eh there killer? I could really use someone with your kind of guts to help me out with a business deal that I have put together. You help me out and I will make it worth your while.
string_id message = new string_id (c_stringFile, "s_86e582ac");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I am listening.
boolean hasResponse0 = false;
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't do business with your kind.
boolean hasResponse1 = false;
if (junk_dender_theed_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_c9aa99a2");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_19e6693b");
utils.setScriptVar (player, "conversation.junk_dender_theed.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Whoa, sorry about that didn't mean to bother you.
if (response == "s_13d756ae")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: Save your apology for someone who cares. Now beat it!
string_id message = new string_id (c_stringFile, "s_ea02ab47");
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_dender_theed_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: So you do have some guts, eh there killer? I could really use someone with your kind of guts to help me out with a business deal that I have put together. You help me out and I will make it worth your while.
//-- [RESPONSE NOTE]
//-- PLAYER: I am listening.
if (response == "s_c9aa99a2")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
junk_dender_theed_action_start_dealing (player, npc);
//-- NPC: I knew you would be interested. I have these buyers, big league Imperial types, who are trying to get their hands on all things gungan. Personally I don't think they so much want the souvenirs so much as they want a few less gungans in the world.
string_id message = new string_id (c_stringFile, "s_7c981db");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Keep going, I am still listening.
boolean hasResponse0 = false;
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: This just sounds like a bad idea.
boolean hasResponse1 = false;
if (junk_dender_theed_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_6925372f");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_e2f6a3b8");
utils.setScriptVar (player, "conversation.junk_dender_theed.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't do business with your kind.
if (response == "s_19e6693b")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: To bad. I was offering easy work and good credits. Later chump.
string_id message = new string_id (c_stringFile, "s_feb97f59");
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_dender_theed_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I knew you would be interested. I have these buyers, big league Imperial types, who are trying to get their hands on all things gungan. Personally I don't think they so much want the souvenirs so much as they want a few less gungans in the world.
//-- [RESPONSE NOTE]
//-- PLAYER: Keep going, I am still listening.
if (response == "s_6925372f")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: Basically if you come across any gungan relic type things you come back and see me. I will buy the whole lot from you no questions asked.
string_id message = new string_id (c_stringFile, "s_874980ff");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: It is your lucky day. I have what you are looking for.
boolean hasResponse0 = false;
if (junk_dender_theed_condition_check_inv (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't appear to have anything you would want to buy.
boolean hasResponse1 = false;
if (junk_dender_theed_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_673b632f");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_a753e4d6");
utils.setScriptVar (player, "conversation.junk_dender_theed.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: This just sounds like a bad idea.
if (response == "s_e2f6a3b8")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: Your loss. I was trying to be all neighborly like and share the spoils with you...
string_id message = new string_id (c_stringFile, "s_159f2a9b");
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_dender_theed_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Basically if you come across any gungan relic type things you come back and see me. I will buy the whole lot from you no questions asked.
//-- [RESPONSE NOTE]
//-- PLAYER: It is your lucky day. I have what you are looking for.
if (response == "s_673b632f")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
junk_dender_theed_action_start_dealing (player, npc);
//-- NPC: Yeah I was right about you, eh there killer? Lets see what you have to offer. Hmmm...not to bad, you have some things that I will make an offer on.
string_id message = new string_id (c_stringFile, "s_1e6ae8ff");
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't appear to have anything you would want to buy.
if (response == "s_a753e4d6")
{
//-- [NOTE]
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
//-- NPC: Bah...well don't just stand there looking dumb. Come back if you have anything I would want to buy.
string_id message = new string_id (c_stringFile, "s_5e3116dd");
utils.removeScriptVar (player, "conversation.junk_dender_theed.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.junk_dender_theed");
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_dender_theed");
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_dender_theed_condition__defaultCondition (player, npc))
{
junk_dender_theed_action_face_to (player, npc);
//-- NPC: Hey there! Just what do you think you are doing walkin' up to me like that. If this were one of my bad days you would be six feet under right now. But since I am feelin' generous I will let it slide this time.
string_id message = new string_id (c_stringFile, "s_4df1acdf");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That decision was the smartest thing you have ever done.
boolean hasResponse0 = false;
if (junk_dender_theed_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Whoa, sorry about that didn't mean to bother you.
boolean hasResponse1 = false;
if (junk_dender_theed_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_12400728");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_13d756ae");
utils.setScriptVar (player, "conversation.junk_dender_theed.branchId", 1);
npcStartConversation (player, npc, "junk_dender_theed", 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_dender_theed")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.junk_dender_theed.branchId");
if (branchId == 1 && junk_dender_theed_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && junk_dender_theed_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && junk_dender_theed_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && junk_dender_theed_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_dender_theed.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================