mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
355 lines
11 KiB
Plaintext
355 lines
11 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// junk_sheani_lake.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_sheani_lake";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean junk_sheani_lake_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean junk_sheani_lake_condition_check_inv (obj_id player, obj_id npc)
|
|
{
|
|
return smuggler.checkInventory(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void junk_sheani_lake_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_sheani_lake_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_sheani_lake_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Welcome traveler, I am Sheani, buyer and seller of finery from around the galaxy. Maybe you have heard of me? No...no matter. How may I be of service to you today?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I think the question is how can I be of service to you?
|
|
if (response == "s_45632ab8")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh how nice, you must be a seller. I am always in the market for used clothing, the occasional trinket, and any sort of jewelry. If you are interested I can offer you very fair pricing for anything you are looking to sell.
|
|
string_id message = new string_id (c_stringFile, "s_38c64dea");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You know what? I think that I have just what you are looking for.
|
|
boolean hasResponse0 = false;
|
|
if (junk_sheani_lake_condition_check_inv (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I am afraid that I don't have anything you would like.
|
|
boolean hasResponse1 = false;
|
|
if (junk_sheani_lake_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_370197a6");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_d264cf44");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_sheani_lake.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_sheani_lake.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nothing right now. I am just passing through.
|
|
if (response == "s_f6c161d")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: In that case safe travels to you. If you ever find yourself in possession of anything I might be interested in please contact me again.
|
|
string_id message = new string_id (c_stringFile, "s_57feadd0");
|
|
utils.removeScriptVar (player, "conversation.junk_sheani_lake.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_sheani_lake_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Oh how nice, you must be a seller. I am always in the market for used clothing, the occasional trinket, and any sort of jewelry. If you are interested I can offer you very fair pricing for anything you are looking to sell.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You know what? I think that I have just what you are looking for.
|
|
if (response == "s_370197a6")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_sheani_lake_action_start_dealing (player, npc);
|
|
|
|
//-- NPC: How wonderful! Let me take a look and I will make you the best offer that I can for anything that I might be interested in. You do seem to have a few nice pieces in here.
|
|
string_id message = new string_id (c_stringFile, "s_82f469f5");
|
|
utils.removeScriptVar (player, "conversation.junk_sheani_lake.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am afraid that I don't have anything you would like.
|
|
if (response == "s_d264cf44")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That is to bad. But if come across anything please stop by and let me have the first crack at buying them from you.
|
|
string_id message = new string_id (c_stringFile, "s_d4565283");
|
|
utils.removeScriptVar (player, "conversation.junk_sheani_lake.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.junk_sheani_lake");
|
|
|
|
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_sheani_lake");
|
|
|
|
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_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_sheani_lake_action_face_to (player, npc);
|
|
|
|
//-- NPC: Welcome traveler, I am Sheani, buyer and seller of finery from around the galaxy. Maybe you have heard of me? No...no matter. How may I be of service to you today?
|
|
string_id message = new string_id (c_stringFile, "s_d3c4bb84");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I think the question is how can I be of service to you?
|
|
boolean hasResponse0 = false;
|
|
if (junk_sheani_lake_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Nothing right now. I am just passing through.
|
|
boolean hasResponse1 = false;
|
|
if (junk_sheani_lake_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_45632ab8");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_f6c161d");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_sheani_lake.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "junk_sheani_lake", 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_sheani_lake")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.junk_sheani_lake.branchId");
|
|
|
|
if (branchId == 1 && junk_sheani_lake_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && junk_sheani_lake_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_sheani_lake.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|