mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-07-31 01:15:55 -04:00
548 lines
16 KiB
Plaintext
548 lines
16 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// heraldnaboo2.script
|
|
//
|
|
//
|
|
//
|
|
// Created with SwgConversationEditor 1.37 - DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
//
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Library Includes
|
|
// ======================================================================
|
|
|
|
include library.ai_lib;
|
|
include library.chat;
|
|
include library.conversation;
|
|
include library.utils;
|
|
|
|
// ======================================================================
|
|
// Script Constants
|
|
// ======================================================================
|
|
|
|
string c_stringFile = "conversation/heraldnaboo2";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean heraldnaboo2_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void heraldnaboo2_action_waypoint1 (obj_id player, obj_id npc)
|
|
{
|
|
location gungan = new location(-272, 0, 2878);
|
|
obj_id waypoint = createWaypointInDatapad(player, gungan);
|
|
setWaypointName(waypoint, "Gungan Stronghold");
|
|
setWaypointColor( waypoint, "blue" );
|
|
setWaypointVisible( waypoint, true );
|
|
setWaypointActive( waypoint, true );
|
|
doAnimationAction(npc, "check_wrist_device");
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void heraldnaboo2_action_waypoint2 (obj_id player, obj_id npc)
|
|
{
|
|
location vermok = new location(5741, 0, -1546);
|
|
obj_id waypoint = createWaypointInDatapad(player, vermok);
|
|
setWaypointName(waypoint, "Veermok Cave");
|
|
setWaypointColor( waypoint, "blue" );
|
|
setWaypointVisible( waypoint, true );
|
|
setWaypointActive( waypoint, true );
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void heraldnaboo2_action_check (obj_id player, obj_id npc)
|
|
{
|
|
doAnimationAction(npc, "check_wrist_device");
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int heraldnaboo2_handleBranch1 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: I apologize. I'm in a bit of a hurry. I only planned to be here in this city for only a few hours. Gathering these supplies took longer than I thought. I really must get back to my studies..
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Okay. I'll let you go.
|
|
if (response == "s_adb2e1e")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Bye!
|
|
string_id message = new string_id (c_stringFile, "s_60613aaf");
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What do you study?
|
|
if (response == "s_9adfee98")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: The veermok, of course! Have you seen a more interesting creature? I take every chance I can get to educate others on my findings. Too bad I don't have the time right now! You can go see them yourself, if you'd like.
|
|
string_id message = new string_id (c_stringFile, "s_d482409c");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No thanks.
|
|
boolean hasResponse0 = false;
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I'd like to, actually.
|
|
boolean hasResponse1 = false;
|
|
if (heraldnaboo2_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_d6695e83");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_137b7430");
|
|
|
|
utils.setScriptVar (player, "conversation.heraldnaboo2.branchId", 3);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int heraldnaboo2_handleBranch3 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: The veermok, of course! Have you seen a more interesting creature? I take every chance I can get to educate others on my findings. Too bad I don't have the time right now! You can go see them yourself, if you'd like.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks.
|
|
if (response == "s_d6695e83")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Maybe some other time, then. Maybe you'd rather visit the Gungans at their stronghold. They're always looking for new allies. They're my allies, in fact, and very supportive of my research. If you're not interested, I really must get going. I hope you don't mind.
|
|
string_id message = new string_id (c_stringFile, "s_401feeb9");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I have to go too. Bye!
|
|
boolean hasResponse0 = false;
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Where are the Gungans?
|
|
boolean hasResponse1 = false;
|
|
if (heraldnaboo2_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_8182146c");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_7d197017");
|
|
|
|
utils.setScriptVar (player, "conversation.heraldnaboo2.branchId", 4);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'd like to, actually.
|
|
if (response == "s_137b7430")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: You're interested in them as much as I am! How exciting! After I gather my supplies, I'm headed to the Gungan Stronghold, however. I have some deals to conduct with my allies there. The Gungans are really friendly when you get to know them. I'll be off to my studies after that. It's the veermok's feeding time.
|
|
string_id message = new string_id (c_stringFile, "s_fcab5bd8");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So, where are these veermoks?
|
|
boolean hasResponse0 = false;
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: I think I'll visit them too.
|
|
boolean hasResponse1 = false;
|
|
if (heraldnaboo2_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_b6fc48e0");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_48315a3d");
|
|
|
|
utils.setScriptVar (player, "conversation.heraldnaboo2.branchId", 7);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int heraldnaboo2_handleBranch4 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Maybe some other time, then. Maybe you'd rather visit the Gungans at their stronghold. They're always looking for new allies. They're my allies, in fact, and very supportive of my research. If you're not interested, I really must get going. I hope you don't mind.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I have to go too. Bye!
|
|
if (response == "s_8182146c")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Bye!
|
|
string_id message = new string_id (c_stringFile, "s_11");
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Where are the Gungans?
|
|
if (response == "s_7d197017")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
heraldnaboo2_action_waypoint1 (player, npc);
|
|
|
|
//-- NPC: Oh, you know, I really can't explain it right now. Let me download the information into your datapad. I must be well on my way. It's feeding time for the veermok. It's such a sight to see!
|
|
string_id message = new string_id (c_stringFile, "s_23545d1");
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int heraldnaboo2_handleBranch7 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: You're interested in them as much as I am! How exciting! After I gather my supplies, I'm headed to the Gungan Stronghold, however. I have some deals to conduct with my allies there. The Gungans are really friendly when you get to know them. I'll be off to my studies after that. It's the veermok's feeding time.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So, where are these veermoks?
|
|
if (response == "s_b6fc48e0")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
heraldnaboo2_action_waypoint2 (player, npc);
|
|
|
|
//-- NPC: Oh yes! I babble on and on so much. I'll just download the information into your datapad. It's really the quickest way. I really must get going.
|
|
string_id message = new string_id (c_stringFile, "s_c4e2d7fa");
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I think I'll visit them too.
|
|
if (response == "s_48315a3d")
|
|
{
|
|
//-- [NOTE]
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
heraldnaboo2_action_waypoint1 (player, npc);
|
|
|
|
//-- NPC: You and I are so alike. They don't like visitors much, but maybe you can ally with them as well. Let me download the information into your datapad, assuming you have one.
|
|
string_id message = new string_id (c_stringFile, "s_b2b33aae");
|
|
utils.removeScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isTangible (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.heraldnaboo2");
|
|
|
|
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.heraldnaboo2");
|
|
|
|
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 (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
heraldnaboo2_action_check (player, npc);
|
|
|
|
//-- NPC: I apologize. I'm in a bit of a hurry. I only planned to be here in this city for only a few hours. Gathering these supplies took longer than I thought. I really must get back to my studies..
|
|
string_id message = new string_id (c_stringFile, "s_91946cec");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Okay. I'll let you go.
|
|
boolean hasResponse0 = false;
|
|
if (heraldnaboo2_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: What do you study?
|
|
boolean hasResponse1 = false;
|
|
if (heraldnaboo2_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_adb2e1e");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_9adfee98");
|
|
|
|
utils.setScriptVar (player, "conversation.heraldnaboo2.branchId", 1);
|
|
|
|
npcStartConversation (player, npc, "heraldnaboo2", 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 != "heraldnaboo2")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.heraldnaboo2.branchId");
|
|
|
|
if (branchId == 1 && heraldnaboo2_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 3 && heraldnaboo2_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 4 && heraldnaboo2_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 7 && heraldnaboo2_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.heraldnaboo2.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|