mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
952 lines
29 KiB
Plaintext
952 lines
29 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ep3_trando_herald.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.30 - 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/ep3_trando_herald";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ep3_trando_herald_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_trando_herald_condition_isOnQuest (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/ep3_trando_herald");
|
|
|
|
boolean onQuest = questIsQuestActive(questId1, player);
|
|
|
|
return onQuest;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ep3_trando_herald_condition_questOver (obj_id player, obj_id npc)
|
|
{
|
|
int questId1 = questGetQuestId("quest/ep3_trando_herald");
|
|
|
|
boolean onQuest = questIsQuestComplete(questId1, player);
|
|
|
|
return onQuest;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ep3_trando_herald_action_giveQuest (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasScript(player, "event.ep3_trando_herald") )
|
|
attachScript(player, "event.ep3_trando_herald");
|
|
|
|
int questId = questGetQuestId("quest/ep3_trando_herald");
|
|
groundquests.grantQuest(questId, player, npc, true);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ep3_trando_herald_action_giveAnotherWp (obj_id player, obj_id npc)
|
|
{
|
|
if(!hasScript(player, "event.ep3_trando_herald") )
|
|
attachScript(player, "event.ep3_trando_herald");
|
|
|
|
messageTo(player, "ep3HeraldGiveAnotherWp", null, 3, false);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ep3_trando_herald_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You again! What do you want?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I couldn't find the slave.
|
|
if (response == "s_285")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_trando_herald_action_giveAnotherWp (player, npc);
|
|
|
|
//-- NPC: Incompetence! Here's the location of another, now hurry up this time.
|
|
string_id message = new string_id (c_stringFile, "s_286");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I can't believe this happened! Somehow those wookiees escaped their bonds and sabotaged my ship. I had no choice but to bring it down here for an emergency landing.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Are these escaped wookiees criminals?
|
|
if (response == "s_226")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: They are property of the Blackscale Clan. I was to deliver the cargo to an Imperial facility that is in desperate need of additional labor. Apparently these wookiees have not been properly... trained. They are no good to anyone. Would you be willing to help me deal with this problem?
|
|
string_id message = new string_id (c_stringFile, "s_228");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How can you consider sentient beings property? There's no way I'm getting involved with this!
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: If the price is right, I'll do what it takes.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_230");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_234");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 5);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Need some help?
|
|
if (response == "s_254")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: As a matter of fact, I do. These wookiees are property of the Blackscale clan. I was to deliver the cargo to an Imperial facility that is in desperate need of additional labor. Apparently these wookiees have not been properly... trained. They are no good to anyone. Would you be willing to help me deal with this problem?
|
|
string_id message = new string_id (c_stringFile, "s_256");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: If the price is right, I'll do whatever it takes.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_258");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_278");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 12);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Whatever happened here, I don't want any part of it.
|
|
if (response == "s_282")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Then quit wasting my time and get out of my face!
|
|
string_id message = new string_id (c_stringFile, "s_284");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: They are property of the Blackscale Clan. I was to deliver the cargo to an Imperial facility that is in desperate need of additional labor. Apparently these wookiees have not been properly... trained. They are no good to anyone. Would you be willing to help me deal with this problem?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How can you consider sentient beings property? There's no way I'm getting involved with this!
|
|
if (response == "s_230")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Fine, get lost then! I'm sure there's plenty of people here that are looking for a quick pay day.
|
|
string_id message = new string_id (c_stringFile, "s_232");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: If the price is right, I'll do what it takes.
|
|
if (response == "s_234")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I knew you looked like a reasonable type. This shipment is ruined and unusuable, therefore they must all be terminated. The Blackscale clan is willing to offer you the sum of 10000 credits if you're able to track down and terminate any of the cargo.
|
|
string_id message = new string_id (c_stringFile, "s_236");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I find them?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_238");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_250");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I knew you looked like a reasonable type. This shipment is ruined and unusuable, therefore they must all be terminated. The Blackscale clan is willing to offer you the sum of 10000 credits if you're able to track down and terminate any of the cargo.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I find them?
|
|
if (response == "s_238")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Each piece of cargo is outfitted with a transponder to track their location so finding them isn't a problem. It also reports their vital signs so we'll know the instant the job is done and we'll wire the pay directly to your account. Sound good?
|
|
string_id message = new string_id (c_stringFile, "s_240");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second thought, no. This doesn't sound good.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_242");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_246");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
if (response == "s_250")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You've wasted enough of my time then. Take a hike!
|
|
string_id message = new string_id (c_stringFile, "s_252");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Each piece of cargo is outfitted with a transponder to track their location so finding them isn't a problem. It also reports their vital signs so we'll know the instant the job is done and we'll wire the pay directly to your account. Sound good?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good.
|
|
if (response == "s_242")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_trando_herald_action_giveQuest (player, npc);
|
|
|
|
//-- NPC: Great, I've uploaded the location of one of them to your datapad. Get going and be quick about it! If they get too far away we'll lose their signal and they are as good as gone.
|
|
string_id message = new string_id (c_stringFile, "s_244");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second thought, no. This doesn't sound good.
|
|
if (response == "s_246")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You've wasted enough of my time then. Take a hike!
|
|
string_id message = new string_id (c_stringFile, "s_248");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch12 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: As a matter of fact, I do. These wookiees are property of the Blackscale clan. I was to deliver the cargo to an Imperial facility that is in desperate need of additional labor. Apparently these wookiees have not been properly... trained. They are no good to anyone. Would you be willing to help me deal with this problem?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: If the price is right, I'll do whatever it takes.
|
|
if (response == "s_258")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I knew you looked like a reasonable type. This shipment is ruined and unusuable, therefore they must all be terminated. The Blackscale clan is willing to offer you the sum of 10000 credits if you're able to track down and terminate any of the cargo.
|
|
string_id message = new string_id (c_stringFile, "s_260");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: How do I find them?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_262");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_274");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 13);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
if (response == "s_278")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You've wasted enough of my time then. Take a hike!
|
|
string_id message = new string_id (c_stringFile, "s_280");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch13 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I knew you looked like a reasonable type. This shipment is ruined and unusuable, therefore they must all be terminated. The Blackscale clan is willing to offer you the sum of 10000 credits if you're able to track down and terminate any of the cargo.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: How do I find them?
|
|
if (response == "s_262")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Each piece of cargo is outfitted with a transponder to track their location so finding them isn't a problem. It also reports their vital signs so we'll know the instant the job is done and we'll wire the pay directly to your account. Sound good?
|
|
string_id message = new string_id (c_stringFile, "s_264");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sounds good.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: On second thought, no. This doesn't sound good.
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_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_266");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_270");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 14);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second though, I don't think I want to be involved with this.
|
|
if (response == "s_274")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You've wasted enough of my time then. Take a hike!
|
|
string_id message = new string_id (c_stringFile, "s_276");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ep3_trando_herald_handleBranch14 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Each piece of cargo is outfitted with a transponder to track their location so finding them isn't a problem. It also reports their vital signs so we'll know the instant the job is done and we'll wire the pay directly to your account. Sound good?
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sounds good.
|
|
if (response == "s_266")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
ep3_trando_herald_action_giveQuest (player, npc);
|
|
|
|
//-- NPC: Great, I've uploaded the location of one of them to your datapad. Get going and be quick about it! If they get too far away we'll lose their signal and they are as good as gone.
|
|
string_id message = new string_id (c_stringFile, "s_268");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: On second thought, no. This doesn't sound good.
|
|
if (response == "s_270")
|
|
{
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You've wasted enough of my time then. Take a hike!
|
|
string_id message = new string_id (c_stringFile, "s_272");
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.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.ep3_trando_herald");
|
|
|
|
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);
|
|
faceTo(self, player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnIncapacitated (obj_id killer)
|
|
{
|
|
clearCondition (self, CONDITION_CONVERSABLE);
|
|
detachScript (self, "conversation.ep3_trando_herald");
|
|
|
|
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 (ep3_trando_herald_condition_questOver (player, npc))
|
|
{
|
|
//-- NPC: I've heard you're good at what you do. I can't afford your fee so I won't insult you by asking you for help.
|
|
string_id message = new string_id (c_stringFile, "s_35");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition_isOnQuest (player, npc))
|
|
{
|
|
//-- NPC: You again! What do you want?
|
|
string_id message = new string_id (c_stringFile, "s_222");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I couldn't find the slave.
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_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_285");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "ep3_trando_herald", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I can't believe this happened! Somehow those wookiees escaped their bonds and sabotaged my ship. I had no choice but to bring it down here for an emergency landing.
|
|
string_id message = new string_id (c_stringFile, "s_224");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Are these escaped wookiees criminals?
|
|
boolean hasResponse0 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Need some help?
|
|
boolean hasResponse1 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: Whatever happened here, I don't want any part of it.
|
|
boolean hasResponse2 = false;
|
|
if (ep3_trando_herald_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses [] = new string_id [numberOfResponses];
|
|
|
|
if (hasResponse0)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_226");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_254");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_282");
|
|
|
|
utils.setScriptVar (player, "conversation.ep3_trando_herald.branchId", 4);
|
|
|
|
npcStartConversation (player, npc, "ep3_trando_herald", 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 != "ep3_trando_herald")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
if (branchId == 2 && ep3_trando_herald_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && ep3_trando_herald_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && ep3_trando_herald_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && ep3_trando_herald_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && ep3_trando_herald_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 12 && ep3_trando_herald_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 13 && ep3_trando_herald_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 14 && ep3_trando_herald_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.ep3_trando_herald.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|