mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
445 lines
14 KiB
Plaintext
445 lines
14 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// junk_malik_vistal.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_malik_vistal";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean junk_malik_vistal_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean junk_malik_vistal_condition_check_inv (obj_id player, obj_id npc)
|
|
{
|
|
return smuggler.checkInventory(player, npc);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void junk_malik_vistal_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_malik_vistal_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_malik_vistal_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You look to be a rough sort. Perhaps you would be interested in taking care of a little business problem that me and my associates have been having?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I am an expert at solving problems.
|
|
if (response == "s_f836463")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That is what I like to hear. Well the problem is pretty simple. My associates and myself are honest hard working citizens that are being harassed to no end by Corsecs. Why they are after us is completely beyond my comprehension.
|
|
string_id message = new string_id (c_stringFile, "s_9251cdb4");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Let me guess. You want me to take care of the Corsecs?
|
|
boolean hasResponse0 = false;
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't need the Corsecs looking into me for getting involved.
|
|
boolean hasResponse1 = false;
|
|
if (junk_malik_vistal_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_b44309e2");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_91196436");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_malik_vistal.branchId", 2);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: This sounds a bit fishy. I don't want to be involved.
|
|
if (response == "s_f66e6241")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I may not like it, but looking after ones own skin is something that I can understand. Maybe next time.
|
|
string_id message = new string_id (c_stringFile, "s_af6451b5");
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_malik_vistal_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That is what I like to hear. Well the problem is pretty simple. My associates and myself are honest hard working citizens that are being harassed to no end by Corsecs. Why they are after us is completely beyond my comprehension.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Let me guess. You want me to take care of the Corsecs?
|
|
if (response == "s_b44309e2")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Hey, I didn't say anything about taking care of no Corsecs. But if accidents did happen to befall them who is to say that I wouldn't buy some sort of proof that they are no more...purely as a collectors piece of course.
|
|
string_id message = new string_id (c_stringFile, "s_18123132");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I think that I have just what you are looking for on me.
|
|
boolean hasResponse0 = false;
|
|
if (junk_malik_vistal_condition_check_inv (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I don't have anything you want but I will keep an eye out.
|
|
boolean hasResponse1 = false;
|
|
if (junk_malik_vistal_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_fc51be40");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_d36db42d");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_malik_vistal.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't need the Corsecs looking into me for getting involved.
|
|
if (response == "s_91196436")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Figured as much but it was worth a shot.
|
|
string_id message = new string_id (c_stringFile, "s_420b90b8");
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int junk_malik_vistal_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Hey, I didn't say anything about taking care of no Corsecs. But if accidents did happen to befall them who is to say that I wouldn't buy some sort of proof that they are no more...purely as a collectors piece of course.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I think that I have just what you are looking for on me.
|
|
if (response == "s_fc51be40")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_malik_vistal_action_start_dealing (player, npc);
|
|
|
|
//-- NPC: Let me take a look. I probably will be inclined to pay for anything Corsec that I locate on your person. Of course, this transaction has nothing to do with the unfortunate circumstances of which you came into possession of these items.
|
|
string_id message = new string_id (c_stringFile, "s_9334c0a0");
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I don't have anything you want but I will keep an eye out.
|
|
if (response == "s_d36db42d")
|
|
{
|
|
//-- [NOTE]
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I knew that you were the right sort from the moment I saw you.
|
|
string_id message = new string_id (c_stringFile, "s_9c1435e4");
|
|
utils.removeScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.junk_malik_vistal");
|
|
|
|
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_malik_vistal");
|
|
|
|
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_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
junk_malik_vistal_action_face_to (player, npc);
|
|
|
|
//-- NPC: You look to be a rough sort. Perhaps you would be interested in taking care of a little business problem that me and my associates have been having?
|
|
string_id message = new string_id (c_stringFile, "s_769000a5");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I am an expert at solving problems.
|
|
boolean hasResponse0 = false;
|
|
if (junk_malik_vistal_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: This sounds a bit fishy. I don't want to be involved.
|
|
boolean hasResponse1 = false;
|
|
if (junk_malik_vistal_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_f836463");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_f66e6241");
|
|
|
|
utils.setScriptVar (player, "conversation.junk_malik_vistal.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "junk_malik_vistal", 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_malik_vistal")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.junk_malik_vistal.branchId");
|
|
|
|
if (branchId == 1 && junk_malik_vistal_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 2 && junk_malik_vistal_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && junk_malik_vistal_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_malik_vistal.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|