Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/junk_sneg_valarian.script
T
2013-09-10 23:17:15 -07:00

535 lines
16 KiB
Plaintext

// ======================================================================
//
// junk_sneg_valarian.script
// Copyright 2004, Sony Online Entertainment
// All Rights Reserved.
//
// 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_sneg_valarian";
// ======================================================================
// Script Conditions
// ======================================================================
boolean junk_sneg_valarian_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean junk_sneg_valarian_condition_check_inv (obj_id player, obj_id npc)
{
return smuggler.checkInventory(player, npc);
}
// ======================================================================
// Script Actions
// ======================================================================
void junk_sneg_valarian_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_sneg_valarian_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_sneg_valarian_handleBranch1 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Greetings and be welcome. Please enjoy the facilities here at the Lucky Despot. Are you here to try your luck at one of our gaming tables or....perhaps you are here for business rather then pleasure?
//-- [RESPONSE NOTE]
//-- PLAYER: That depends on what sort of business you have in mind.
if (response == "s_f0f3bea2")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: Perhaps you are here to sell something. Something that might be a little hard to sell elsewhere. Many people come here looking for Lady V's help in moving things that they otherwise cannot. If it something that the Lady deals with she might be willing to take it off of your hands.
string_id message = new string_id (c_stringFile, "s_4717ab1e");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What sort of things does Lady Valarian deal in?
boolean hasResponse0 = false;
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't think I have anything that the Lady is interested in.
boolean hasResponse1 = false;
if (junk_sneg_valarian_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_14b517b1");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_18");
utils.setScriptVar (player, "conversation.junk_sneg_valarian.branchId", 2);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I am just taking a look around.
if (response == "s_50c8b3e1")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: In that case, please enjoy the fabulous Lucky Despot.
string_id message = new string_id (c_stringFile, "s_f7c66216");
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_sneg_valarian_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Perhaps you are here to sell something. Something that might be a little hard to sell elsewhere. Many people come here looking for Lady V's help in moving things that they otherwise cannot. If it something that the Lady deals with she might be willing to take it off of your hands.
//-- [RESPONSE NOTE]
//-- PLAYER: What sort of things does Lady Valarian deal in?
if (response == "s_14b517b1")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: The Lady deals with all assortment of items. Anything from a CDEF to an imperial T-21. Of course, she currently has a special interest in hand-to-hand weapons. She also has a liking to various other odds and ends that can fetch a nice profit if you know the right people.
string_id message = new string_id (c_stringFile, "s_7debe28e");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What does Lady Valarian want with melee weapons?
boolean hasResponse0 = false;
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't think I have anything that the Lady is interested in.
boolean hasResponse1 = false;
if (junk_sneg_valarian_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_50b9f32f");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_14");
utils.setScriptVar (player, "conversation.junk_sneg_valarian.branchId", 3);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't think I have anything that the Lady is interested in.
if (response == "s_18")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: Very well. Good day to you.
string_id message = new string_id (c_stringFile, "s_20");
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_sneg_valarian_handleBranch3 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: The Lady deals with all assortment of items. Anything from a CDEF to an imperial T-21. Of course, she currently has a special interest in hand-to-hand weapons. She also has a liking to various other odds and ends that can fetch a nice profit if you know the right people.
//-- [RESPONSE NOTE]
//-- PLAYER: What does Lady Valarian want with melee weapons?
if (response == "s_50b9f32f")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: It is never wise to stick your nose into the Lady's business. Do you wish to do business with us or not?
string_id message = new string_id (c_stringFile, "s_e27c50ad");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Of course, lets conduct some business.
boolean hasResponse0 = false;
if (junk_sneg_valarian_condition_check_inv (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I don't think I have anything that the Lady is interested in.
boolean hasResponse1 = false;
if (junk_sneg_valarian_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_94fa366f");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_b4cc3fb7");
utils.setScriptVar (player, "conversation.junk_sneg_valarian.branchId", 4);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't think I have anything that the Lady is interested in.
if (response == "s_14")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: Very well. Good day to you.
string_id message = new string_id (c_stringFile, "s_16");
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int junk_sneg_valarian_handleBranch4 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: It is never wise to stick your nose into the Lady's business. Do you wish to do business with us or not?
//-- [RESPONSE NOTE]
//-- PLAYER: Of course, lets conduct some business.
if (response == "s_94fa366f")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
junk_sneg_valarian_action_start_dealing (player, npc);
//-- NPC: Let me see what you have to offer. If I see anything that we might be interested in dealing with I will make an offer on. It is very wise to accept the generous offer that Lady V grants.
string_id message = new string_id (c_stringFile, "s_63a817cf");
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I don't think I have anything that the Lady is interested in.
if (response == "s_b4cc3fb7")
{
//-- [NOTE]
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
//-- NPC: Very well. Good day to you.
string_id message = new string_id (c_stringFile, "s_a3ad61f1");
utils.removeScriptVar (player, "conversation.junk_sneg_valarian.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isMob (self)) || (isPlayer (self)))
detachScript(self, "conversation.junk_sneg_valarian");
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_sneg_valarian");
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_sneg_valarian_condition__defaultCondition (player, npc))
{
junk_sneg_valarian_action_face_to (player, npc);
//-- NPC: Greetings and be welcome. Please enjoy the facilities here at the Lucky Despot. Are you here to try your luck at one of our gaming tables or....perhaps you are here for business rather then pleasure?
string_id message = new string_id (c_stringFile, "s_6dbdfc7");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: That depends on what sort of business you have in mind.
boolean hasResponse0 = false;
if (junk_sneg_valarian_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I am just taking a look around.
boolean hasResponse1 = false;
if (junk_sneg_valarian_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_f0f3bea2");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_50c8b3e1");
utils.setScriptVar (player, "conversation.junk_sneg_valarian.branchId", 1);
npcStartConversation (player, npc, "junk_sneg_valarian", 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_sneg_valarian")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.junk_sneg_valarian.branchId");
if (branchId == 1 && junk_sneg_valarian_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 2 && junk_sneg_valarian_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 3 && junk_sneg_valarian_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 4 && junk_sneg_valarian_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_sneg_valarian.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================