mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-04 04:15:52 -04:00
557 lines
17 KiB
Plaintext
557 lines
17 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// legacy_naboo_eirtae.script
|
|
//
|
|
//
|
|
//
|
|
// 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/legacy_naboo_eirtae";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean legacy_naboo_eirtae_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_eirtae_condition_completedEirtaesQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedTask(player, "quest/legacy_naboo_helping_the_handmaidens", "finishedEirtaesQuest"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_eirtae_condition_isOnEirtaesQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/legacy_naboo_helping_the_handmaidens", "speakWithEirtae"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_eirtae_condition_killingTuskCats (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "quest/legacy_naboo_helping_the_handmaidens", "clearingAreaForEirtae"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void legacy_naboo_eirtae_action_startEirtaesQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "startEirtaeQuest");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int legacy_naboo_eirtae_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I am Eirtae, I was the protocol expert for Queen Amidala when she was alive. My sisters mentioned that you'd be coming to me, and I have alread decided what it is I need from you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What can I do to help?
|
|
if (response == "s_8")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: A group of offworld dignitaries are considering moving a large portion of their business to Naboo, but they want to see the land first, and make sure that they like it. To that end I've arranged a nature walk for them, through some of the safer areas of the wilds. There is a problem, however.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do I have to kill?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_eirtae_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_12");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_eirtae.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_eirtae_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: A group of offworld dignitaries are considering moving a large portion of their business to Naboo, but they want to see the land first, and make sure that they like it. To that end I've arranged a nature walk for them, through some of the safer areas of the wilds. There is a problem, however.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do I have to kill?
|
|
if (response == "s_12")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Very astute. The tusk cats in the region have become a bit agitated of late, and I believe they're more aggressive at this time of year than normal. I'd like for you to cull their population so that none of the dignitiaries is harmed during their visit.
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Sure, I can do that.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Isn't that a little cruel?
|
|
boolean hasResponse1 = false;
|
|
if (legacy_naboo_eirtae_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_16");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_20");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_eirtae.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_eirtae_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Very astute. The tusk cats in the region have become a bit agitated of late, and I believe they're more aggressive at this time of year than normal. I'd like for you to cull their population so that none of the dignitiaries is harmed during their visit.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Sure, I can do that.
|
|
if (response == "s_16")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_naboo_eirtae_action_startEirtaesQuest (player, npc);
|
|
|
|
//-- NPC: Good. I was hoping so. When you've completed the task I'll send you word on what to do next. And I thank you in advance.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Isn't that a little cruel?
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Only to one who doesn't understand the nature of life. The reason the tusk cats are agitated is because they're overpopulated. Normally many of them would be killed by spiders, mott bulls, and other natural predators, but the influx of hunters has culled all those populations, leaving most of the tusk cats to starve, and attack human settlements. You're simply putting an end to this problem.
|
|
string_id message = new string_id (c_stringFile, "s_22");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: You make a compelling argument.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_eirtae_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.legacy_naboo_eirtae.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_eirtae_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Only to one who doesn't understand the nature of life. The reason the tusk cats are agitated is because they're overpopulated. Normally many of them would be killed by spiders, mott bulls, and other natural predators, but the influx of hunters has culled all those populations, leaving most of the tusk cats to starve, and attack human settlements. You're simply putting an end to this problem.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: You make a compelling argument.
|
|
if (response == "s_24")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Protocol is my specialty.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Ok, I'll help out.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_eirtae_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.legacy_naboo_eirtae.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_eirtae_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Protocol is my specialty.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Ok, I'll help out.
|
|
if (response == "s_28")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_naboo_eirtae_action_startEirtaesQuest (player, npc);
|
|
|
|
//-- NPC: Good. I was hoping so. When you've completed the task I'll send you word on what to do next. And I thank you in advance.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.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.legacy_naboo_eirtae");
|
|
|
|
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.legacy_naboo_eirtae");
|
|
|
|
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 (legacy_naboo_eirtae_condition_completedEirtaesQuest (player, npc))
|
|
{
|
|
//-- NPC: The dignitaries will be so happy that they can take their nature walk undisturbed. Thank you for your help.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition_isOnEirtaesQuest (player, npc))
|
|
{
|
|
//-- NPC: I am Eirtae, I was the protocol expert for Queen Amidala when she was alive. My sisters mentioned that you'd be coming to me, and I have alread decided what it is I need from you.
|
|
string_id message = new string_id (c_stringFile, "s_6");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What can I do to help?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_eirtae_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_8");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_eirtae.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "legacy_naboo_eirtae", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition_killingTuskCats (player, npc))
|
|
{
|
|
//-- NPC: I do wish you'd hurry up with that task I gave you. Those dignitaries will be here soon, and I don't want them being eaten by tusk cats!
|
|
string_id message = new string_id (c_stringFile, "s_31");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_eirtae_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Perhaps we shall be friends someday in the future. But right now it doesn't seem to be that day.
|
|
string_id message = new string_id (c_stringFile, "s_30");
|
|
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 != "legacy_naboo_eirtae")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
if (branchId == 2 && legacy_naboo_eirtae_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && legacy_naboo_eirtae_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && legacy_naboo_eirtae_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && legacy_naboo_eirtae_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && legacy_naboo_eirtae_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_eirtae.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|