mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-12 23:45:12 -04:00
405 lines
12 KiB
Plaintext
405 lines
12 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// tatooine_knives_labria.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.features;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/tatooine_knives_labria";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean tatooine_knives_labria_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_labria_condition_onQuest (obj_id player, obj_id npc)
|
|
{
|
|
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
|
|
boolean OnTask= (questIsQuestActive(questId1, player));
|
|
|
|
return OnTask;
|
|
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_labria_condition_onTaskSnitch (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
int snitch = groundquests.getTaskId(questId1, "tatooine_knives_thrust_e4");
|
|
|
|
boolean onTask = questIsTaskActive(questId1, snitch, player);
|
|
|
|
return onTask;
|
|
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean tatooine_knives_labria_condition_questComplete (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_knives_parry_pt2");
|
|
int questId2 = questGetQuestId("quest/tatooine_knives_thrust");
|
|
|
|
boolean OnTask = (questIsQuestComplete(questId1, player))||(questIsQuestComplete(questId2, player));
|
|
|
|
return OnTask;
|
|
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void tatooine_knives_labria_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void tatooine_knives_labria_action_signalMouse (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "tatooine_knives_thrust_launch_e5");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int tatooine_knives_labria_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: We do this fast. I don't want to know you, and you definitely don't want to know me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So show me where Ind's place is.
|
|
if (response == "s_42")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Lets get this right. I am not going to show you anything. You are going to go to these coordinates that I am uploading to your datapad. Get it?
|
|
string_id message = new string_id (c_stringFile, "s_43");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Get on with it.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Why won't you do it?
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_knives_labria_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_44");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_46");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_labria.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_labria.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int tatooine_knives_labria_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Lets get this right. I am not going to show you anything. You are going to go to these coordinates that I am uploading to your datapad. Get it?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Get on with it.
|
|
if (response == "s_44")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_signalMouse (player, npc);
|
|
|
|
//-- NPC: Transferring now.
|
|
string_id message = new string_id (c_stringFile, "s_45");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_labria.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Why won't you do it?
|
|
if (response == "s_46")
|
|
{
|
|
//-- [NOTE]
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_signalMouse (player, npc);
|
|
|
|
//-- NPC: Because I don't want anyone to see me. How dumb are you? Ready? I am updating your datapad. Off you go.
|
|
string_id message = new string_id (c_stringFile, "s_47");
|
|
utils.removeScriptVar (player, "conversation.tatooine_knives_labria.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.tatooine_knives_labria");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Airba");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
setInvulnerable (self, true);
|
|
setName (self, "Airba");
|
|
ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL );
|
|
|
|
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.tatooine_knives_labria");
|
|
|
|
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 (tatooine_knives_labria_condition_questComplete (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Well you have more guts that I have. That was a very dangerous game you played with Ind and Kavas.
|
|
string_id message = new string_id (c_stringFile, "s_48");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (!tatooine_knives_labria_condition_onTaskSnitch (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I understand that the Lucky Despot has the loosest games in town. Also someone looking for work can find something to do there as well.
|
|
string_id message = new string_id (c_stringFile, "s_39");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_knives_labria_condition_onTaskSnitch (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: We do this fast. I don't want to know you, and you definitely don't want to know me.
|
|
string_id message = new string_id (c_stringFile, "s_41");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So show me where Ind's place is.
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_42");
|
|
|
|
utils.setScriptVar (player, "conversation.tatooine_knives_labria.branchId", 3);
|
|
|
|
npcStartConversation (player, npc, "tatooine_knives_labria", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (tatooine_knives_labria_condition__defaultCondition (player, npc))
|
|
{
|
|
tatooine_knives_labria_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: You know I really don't have time. If you are looking for work check out the Lucky Despot. They always have work for people desperate enough.
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
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 != "tatooine_knives_labria")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.tatooine_knives_labria.branchId");
|
|
|
|
if (branchId == 3 && tatooine_knives_labria_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && tatooine_knives_labria_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.tatooine_knives_labria.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|