mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
626 lines
19 KiB
Plaintext
626 lines
19 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// striking_miners_urst.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.35 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.groundquests;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/striking_miners_urst";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean striking_miners_urst_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean striking_miners_urst_condition_onMission (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isQuestActive(player, "som_striking_miners");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean striking_miners_urst_condition_taskCompleted (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.isTaskActive(player, "som_striking_miners", "mustafar_striking_miners_five");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean striking_miners_urst_condition_missionCompleted (obj_id player, obj_id npc)
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "som_striking_miners");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void striking_miners_urst_action_grantMission (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest(player, "som_striking_miners");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void striking_miners_urst_action_grantreward (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "mustafar_striking_miners_reward");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int striking_miners_urst_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: How did your talks with Nurfa go?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I managed to convince him to return to the talks with you.
|
|
if (response == "s_19")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "thank");
|
|
|
|
striking_miners_urst_action_grantreward (player, npc);
|
|
|
|
//-- NPC: That is most excellent news. Hopefully, we can hammer out a deal that both parties will be satisfied with. Please accept this as a token of the company's appreciation for what you have done. Thank you, my friend.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int striking_miners_urst_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Have you managed to convince Nurfa to return to the negotiations?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Not yet.
|
|
if (response == "s_17")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I really hope you can get him to return soon.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int striking_miners_urst_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Welcome, my friend. What brings you to our humble facility?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Just looking around. What is this place?
|
|
if (response == "s_15")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "explain");
|
|
|
|
//-- NPC: This is mining facility AG3-T of the Mensix Mining Company. Our world is rich with many resources that are considered to be desirable in numerous systems throughout the galaxy. We Mustafarians have made a very comfortable living supplying those systems.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: For a mining facility, it doesn't seem to be very busy.
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_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_24");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int striking_miners_urst_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: This is mining facility AG3-T of the Mensix Mining Company. Our world is rich with many resources that are considered to be desirable in numerous systems throughout the galaxy. We Mustafarians have made a very comfortable living supplying those systems.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: For a mining facility, it doesn't seem to be very busy.
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
//-- NPC: A very astute observation. It is true we are having a bit of a labor crisis. A group of our miners have gone on strike and we are having a great deal of difficulty getting them to at least talk with us.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Is there anything I can do?
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_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_28");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int striking_miners_urst_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A very astute observation. It is true we are having a bit of a labor crisis. A group of our miners have gone on strike and we are having a great deal of difficulty getting them to at least talk with us.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Is there anything I can do?
|
|
if (response == "s_28")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "rub_chin_thoughtful");
|
|
|
|
//-- NPC: Maybe there is. The striking miners refuse to talk with anyone involved with the company, but maybe they will talk to a third party. If you could convince the miners to return to the talks, that would be most helpful.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I will try to convince them to talk with you again.
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Nah, I don't think I should get involved in a labor dispute.
|
|
boolean hasResponse1 = false;
|
|
if (striking_miners_urst_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_32");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int striking_miners_urst_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Maybe there is. The striking miners refuse to talk with anyone involved with the company, but maybe they will talk to a third party. If you could convince the miners to return to the talks, that would be most helpful.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I will try to convince them to talk with you again.
|
|
if (response == "s_32")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "thank");
|
|
|
|
striking_miners_urst_action_grantMission (player, npc);
|
|
|
|
//-- NPC: That is most kind of you. You will need to speak with Nurfa Laz'op. He is heading up the group of miners. They have a camp not too far from here. Do your best to convince them to return to the negotiations with us. We need those miners to get back to work, but we also wish to do right by them. Thank you again.
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nah, I don't think I should get involved in a labor dispute.
|
|
if (response == "s_36")
|
|
{
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That is too bad. Well, I hope you enjoy your stay on our world.
|
|
string_id message = new string_id (c_stringFile, "s_38");
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.striking_miners_urst");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition( self, CONDITION_INTERESTING );
|
|
setName (self, "Urup Fal'co");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setInvulnerable (self, true);
|
|
setCondition( self, CONDITION_INTERESTING );
|
|
setName (self, "Urup Fal'co");
|
|
|
|
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.striking_miners_urst");
|
|
|
|
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 (striking_miners_urst_condition_missionCompleted (player, npc))
|
|
{
|
|
doAnimationAction (npc, "nod");
|
|
|
|
//-- NPC: It is good to see you are still doing well.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition_taskCompleted (player, npc))
|
|
{
|
|
doAnimationAction (npc, "beckon");
|
|
|
|
//-- NPC: How did your talks with Nurfa go?
|
|
string_id message = new string_id (c_stringFile, "s_6");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I managed to convince him to return to the talks with you.
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_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_19");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "striking_miners_urst", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition_onMission (player, npc))
|
|
{
|
|
//-- NPC: Have you managed to convince Nurfa to return to the negotiations?
|
|
string_id message = new string_id (c_stringFile, "s_16");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Not yet.
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_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_17");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "striking_miners_urst", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (striking_miners_urst_condition__defaultCondition (player, npc))
|
|
{
|
|
doAnimationAction (npc, "bow3");
|
|
|
|
//-- NPC: Welcome, my friend. What brings you to our humble facility?
|
|
string_id message = new string_id (c_stringFile, "s_13");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Just looking around. What is this place?
|
|
boolean hasResponse0 = false;
|
|
if (striking_miners_urst_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_15");
|
|
|
|
utils.setScriptVar (player, "conversation.striking_miners_urst.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "striking_miners_urst", 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 != "striking_miners_urst")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
if (branchId == 2 && striking_miners_urst_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && striking_miners_urst_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && striking_miners_urst_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && striking_miners_urst_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && striking_miners_urst_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && striking_miners_urst_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.striking_miners_urst.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|