mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
445 lines
13 KiB
Plaintext
445 lines
13 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// junk_quich_dantooine.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_quich_dantooine";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean junk_quich_dantooine_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean junk_quich_dantooine_condition_check_inv (obj_id player, obj_id npc)
|
|
{
|
|
return smuggler.checkInventory(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void junk_quich_dantooine_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_quich_dantooine_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_quich_dantooine_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Lookie lookie what I see here. Ye certainly be a brave sort. The type that be trying to make a name for ye. Perhaps I be able to help ye make that name?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What are you talking about?
|
|
if (response == "s_2313ac9e")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I have ye curious now. I be looking for rare artifacts of the mysterious nature. Artifacts that this planet have in abundance. Artifacts of jedi.
|
|
string_id message = new string_id (c_stringFile, "s_86df00aa");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Jedi eh? And I suppose you will pay for these artifacts?
|
|
boolean hasResponse0 = false;
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Jedi! I want nothing to do with anything Jedi.
|
|
boolean hasResponse1 = false;
|
|
if (junk_quich_dantooine_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_f2e88b32");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_fbe44b83");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_quich_dantooine.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ummm...I think you have me confused for someone else.
|
|
if (response == "s_953d967f")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Oh, well have I now. In that case ye should go about ye business.
|
|
string_id message = new string_id (c_stringFile, "s_35b56f0a");
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_quich_dantooine_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I have ye curious now. I be looking for rare artifacts of the mysterious nature. Artifacts that this planet have in abundance. Artifacts of jedi.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Jedi eh? And I suppose you will pay for these artifacts?
|
|
if (response == "s_f2e88b32")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Pay and pay well. I be working for a collector who has credits to spend. Ye get me artifacts and I get ye credits.
|
|
string_id message = new string_id (c_stringFile, "s_5bc0c939");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I just might have some things you would be interested in.
|
|
boolean hasResponse0 = false;
|
|
if (junk_quich_dantooine_condition_check_inv (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't have anything you would be interested in.
|
|
boolean hasResponse1 = false;
|
|
if (junk_quich_dantooine_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_463bc6c4");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_6e11f342");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_quich_dantooine.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Jedi! I want nothing to do with anything Jedi.
|
|
if (response == "s_fbe44b83")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ye be wise beyond ye years for making that decision. I be wrong in thinking that ye could hold ye own with the likes of Jedi.
|
|
string_id message = new string_id (c_stringFile, "s_f5349262");
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_quich_dantooine_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Pay and pay well. I be working for a collector who has credits to spend. Ye get me artifacts and I get ye credits.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I just might have some things you would be interested in.
|
|
if (response == "s_463bc6c4")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_quich_dantooine_action_start_dealing (player, npc);
|
|
|
|
//-- NPC: Excellent. Let me look at what ye got for me. How nice...how nice indeed. I will make an offer on these. Ye should take me up on my offer because no one else will pay for what ye got.
|
|
string_id message = new string_id (c_stringFile, "s_ba5cc7c");
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't have anything you would be interested in.
|
|
if (response == "s_6e11f342")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well if ye find any Jedi artifacts ye know where I be.
|
|
string_id message = new string_id (c_stringFile, "s_413bfd08");
|
|
utils.removeScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.junk_quich_dantooine");
|
|
|
|
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_quich_dantooine");
|
|
|
|
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_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_quich_dantooine_action_face_to (player, npc);
|
|
|
|
//-- NPC: Lookie lookie what I see here. Ye certainly be a brave sort. The type that be trying to make a name for ye. Perhaps I be able to help ye make that name?
|
|
string_id message = new string_id (c_stringFile, "s_87c4b1c3");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What are you talking about?
|
|
boolean hasResponse0 = false;
|
|
if (junk_quich_dantooine_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Ummm...I think you have me confused for someone else.
|
|
boolean hasResponse1 = false;
|
|
if (junk_quich_dantooine_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_2313ac9e");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_953d967f");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_quich_dantooine.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "junk_quich_dantooine", 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_quich_dantooine")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.junk_quich_dantooine.branchId");
|
|
|
|
if (branchId == 1 && junk_quich_dantooine_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && junk_quich_dantooine_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && junk_quich_dantooine_handleBranch3 (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_quich_dantooine.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|