mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-03 03:15:55 -04:00
492 lines
15 KiB
Plaintext
492 lines
15 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// legacy_naboo_yane.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/legacy_naboo_yane";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean legacy_naboo_yane_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_yane_condition_finishedYaneQuest (obj_id player, obj_id npc)
|
|
{
|
|
if(groundquests.hasCompletedTask(player, "quest/legacy_naboo_helping_the_handmaidens", "doneWithYane"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_yane_condition_onYaneQuest (obj_id player, obj_id npc)
|
|
{
|
|
if(groundquests.hasCompletedTask(player, "quest/legacy_naboo_helping_the_handmaidens", "finishedRabesQuests"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_yane_condition_gatheredIngredients (obj_id player, obj_id npc)
|
|
{
|
|
if(groundquests.hasCompletedTask(player, "quest/legacy_naboo_helping_the_handmaidens", "finishedGatheringYanesIngredients"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean legacy_naboo_yane_condition_doingYaneQuest (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "quest/legacy_naboo_helping_the_handmaidens", "collectingYanesVenomSacs") || groundquests.isTaskActive(player, "quest/legacy_naboo_helping_the_handmaidens", "collectingYanesBloodSamples"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void legacy_naboo_yane_action_startGatheringforYane (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "startYaneGatheringQuest");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void legacy_naboo_yane_action_sendSignalAboutIngredients (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "doneHelpingYane");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int legacy_naboo_yane_handleBranch2 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: These ingredients will do perfectly. Thank you for your help.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Anything else you need?
|
|
if (response == "s_23")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_naboo_yane_action_sendSignalAboutIngredients (player, npc);
|
|
|
|
//-- NPC: Eirtae, another of the sisters, has asked for your assistance. She'd like to speak with you as soon as you get a chance.
|
|
string_id message = new string_id (c_stringFile, "s_24");
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_yane.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_yane_handleBranch5 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Rabe told me you'd be coming along soon. I hear you're handy against the local wildlife. Is that true? I hope it is. I need you to help me out now.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What can I do for you?
|
|
if (response == "s_12")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The local children are getting sick. I'm not paranoid enough to think someone's doing it deliberately, but there's definitely something going around. I need to make some medicine, but I don't have all the ingredients that I need. I was hoping you'd collect them for me.
|
|
string_id message = new string_id (c_stringFile, "s_14");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What do you need?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_yane_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_16");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_yane.branchId", 6);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_yane.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_yane_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The local children are getting sick. I'm not paranoid enough to think someone's doing it deliberately, but there's definitely something going around. I need to make some medicine, but I don't have all the ingredients that I need. I was hoping you'd collect them for me.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you need?
|
|
if (response == "s_16")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Well, to start with, I'll need something to kill the infection. Believe it or not the venom of a fanned rawl is the perfect toxin to do this with. Mixed with the right chemicals of course, I wouldn't recommend getting bit just to cure a flu. But I'll need you to bring me venom sacs, intact, from about 9 of them.
|
|
string_id message = new string_id (c_stringFile, "s_18");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Nine venom sacs. Can do.
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_yane_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_20");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_yane.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_yane.branchId");
|
|
|
|
chat.chat (npc, player, message);
|
|
npcEndConversation (player);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int legacy_naboo_yane_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Well, to start with, I'll need something to kill the infection. Believe it or not the venom of a fanned rawl is the perfect toxin to do this with. Mixed with the right chemicals of course, I wouldn't recommend getting bit just to cure a flu. But I'll need you to bring me venom sacs, intact, from about 9 of them.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Nine venom sacs. Can do.
|
|
if (response == "s_20")
|
|
{
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition__defaultCondition (player, npc))
|
|
{
|
|
legacy_naboo_yane_action_startGatheringforYane (player, npc);
|
|
|
|
//-- NPC: Good. When you're done with that I'll let you know what else I need.
|
|
string_id message = new string_id (c_stringFile, "s_26");
|
|
utils.removeScriptVar (player, "conversation.legacy_naboo_yane.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_yane");
|
|
|
|
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_yane");
|
|
|
|
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_yane_condition_finishedYaneQuest (player, npc))
|
|
{
|
|
//-- NPC: I appreciate your help collecting the ingredients for the medicine. The children appreciate it too.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition_gatheredIngredients (player, npc))
|
|
{
|
|
//-- NPC: These ingredients will do perfectly. Thank you for your help.
|
|
string_id message = new string_id (c_stringFile, "s_21");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Anything else you need?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_yane_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_23");
|
|
|
|
utils.setScriptVar (player, "conversation.legacy_naboo_yane.branchId", 2);
|
|
|
|
npcStartConversation (player, npc, "legacy_naboo_yane", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition_doingYaneQuest (player, npc))
|
|
{
|
|
//-- NPC: I need those ingredients as soon as possible.
|
|
string_id message = new string_id (c_stringFile, "s_25");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition_onYaneQuest (player, npc))
|
|
{
|
|
//-- NPC: Rabe told me you'd be coming along soon. I hear you're handy against the local wildlife. Is that true? I hope it is. I need you to help me out now.
|
|
string_id message = new string_id (c_stringFile, "s_10");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: What can I do for you?
|
|
boolean hasResponse0 = false;
|
|
if (legacy_naboo_yane_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_yane.branchId", 5);
|
|
|
|
npcStartConversation (player, npc, "legacy_naboo_yane", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (legacy_naboo_yane_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: I'm sorry to have to put this so bluntly, but I don't talk to strangers.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
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_yane")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.legacy_naboo_yane.branchId");
|
|
|
|
if (branchId == 2 && legacy_naboo_yane_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 5 && legacy_naboo_yane_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 6 && legacy_naboo_yane_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && legacy_naboo_yane_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_yane.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|