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_ollobo_jabbas.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_ollobo_jabbas";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean junk_ollobo_jabbas_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean junk_ollobo_jabbas_condition_check_inv (obj_id player, obj_id npc)
|
|
{
|
|
return smuggler.checkInventory(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void junk_ollobo_jabbas_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_ollobo_jabbas_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_ollobo_jabbas_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: If yer lookin' ta get into mighty Jabba's good graces then Ollobo wrong chap ta talk at. If'n yer lookin' ta make extra credit or two mayhaps we make good deal.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What sort of deal are you talking about?
|
|
if (response == "s_6ee477c3")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Jabba tell Ollobo ta deal fer shooters an' stabbers, Jabba tell Ollobo ta deal fer pretties. Jabba tell Ollobo ta make good deal fer pistol shooters an' polearm stabbers. If'n ya got what Jabba wants, Ollobo deal fer it.
|
|
string_id message = new string_id (c_stringFile, "s_472f3294");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I think that I have what Jabba is looking for.
|
|
boolean hasResponse0 = false;
|
|
if (junk_ollobo_jabbas_condition_check_inv (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't think that I have anything Jabba is interested in.
|
|
boolean hasResponse1 = false;
|
|
if (junk_ollobo_jabbas_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_e2ee167d");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_b85badf5");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_ollobo_jabbas.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_ollobo_jabbas.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am not interested in any sort of deal.
|
|
if (response == "s_aadc214b")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That yer choice. Just ya 'member, Ollobo willing ta deal fer what Jabba wants.
|
|
string_id message = new string_id (c_stringFile, "s_935bfcd0");
|
|
utils.removeScriptVar (player, "conversation.junk_ollobo_jabbas.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_ollobo_jabbas_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Jabba tell Ollobo ta deal fer shooters an' stabbers, Jabba tell Ollobo ta deal fer pretties. Jabba tell Ollobo ta make good deal fer pistol shooters an' polearm stabbers. If'n ya got what Jabba wants, Ollobo deal fer it.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I think that I have what Jabba is looking for.
|
|
if (response == "s_e2ee167d")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_ollobo_jabbas_action_start_dealing (player, npc);
|
|
|
|
//-- NPC: Ollobo check what ya got. No barter. Ya deal or not deal. Ollobo no ask questions, 'cause Ollobo no care. Jabba tell Ollobo ta deal, Ollobo deal.
|
|
string_id message = new string_id (c_stringFile, "s_73b59dd6");
|
|
utils.removeScriptVar (player, "conversation.junk_ollobo_jabbas.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't think that I have anything Jabba is interested in.
|
|
if (response == "s_b85badf5")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Ya 'member that Ollobo here. Ya find what Jabba wants, Ollobo deal fer it.
|
|
string_id message = new string_id (c_stringFile, "s_b950c3eb");
|
|
utils.removeScriptVar (player, "conversation.junk_ollobo_jabbas.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.junk_ollobo_jabbas");
|
|
|
|
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_ollobo_jabbas");
|
|
|
|
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_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_ollobo_jabbas_action_face_to (player, npc);
|
|
|
|
//-- NPC: If yer lookin' ta get into mighty Jabba's good graces then Ollobo wrong chap ta talk at. If'n yer lookin' ta make extra credit or two mayhaps we make good deal.
|
|
string_id message = new string_id (c_stringFile, "s_6d35d0e1");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What sort of deal are you talking about?
|
|
boolean hasResponse0 = false;
|
|
if (junk_ollobo_jabbas_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I am not interested in any sort of deal.
|
|
boolean hasResponse1 = false;
|
|
if (junk_ollobo_jabbas_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_6ee477c3");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_aadc214b");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_ollobo_jabbas.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "junk_ollobo_jabbas", 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_ollobo_jabbas")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.junk_ollobo_jabbas.branchId");
|
|
|
|
if (branchId == 1 && junk_ollobo_jabbas_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && junk_ollobo_jabbas_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_ollobo_jabbas.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|