mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
656 lines
19 KiB
Plaintext
656 lines
19 KiB
Plaintext
// ======================================================================
|
|
//
|
|
// ree_yees.script
|
|
// Copyright 2004, Sony Online Entertainment
|
|
// All Rights Reserved.
|
|
//
|
|
// Created with SwgConversationEditor 1.36 - 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/ree_yees";
|
|
|
|
// ======================================================================
|
|
// Script Conditions
|
|
// ======================================================================
|
|
|
|
boolean ree_yees_condition__defaultCondition (obj_id player, obj_id npc)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_completedReeYees (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/jabba_ree_yees_v2"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_collectingBell (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive(player, "quest/jabba_ree_yees_v2", "collectingBell"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_readyToFinish (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/jabba_ree_yees_v2", "completedMission"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_collectingBook (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/jabba_ree_yees_v2", "collectingBook"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_collectingCandle (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.isTaskActive (player, "quest/jabba_ree_yees_v2", "collectingCandle"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
boolean ree_yees_condition_completedReelo (obj_id player, obj_id npc)
|
|
{
|
|
if (groundquests.hasCompletedQuest (player, "quest/jabba_reelo_baruk"))
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script Actions
|
|
// ======================================================================
|
|
|
|
void ree_yees_action_grantReeYeesQuest (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.grantQuest (player, "quest/jabba_ree_yees_v2");
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ree_yees_action_sendCompletedSignal (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "reeYeesSaysYoureAWinner");
|
|
groundquests.grantQuest(player, "pointer_ephant_mon");
|
|
faceTo(npc, player);
|
|
return;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ree_yees_action_clearPointer (obj_id player, obj_id npc)
|
|
{
|
|
groundquests.sendSignal(player, "found_ree_yees");
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
void ree_yees_action_facePlayer (obj_id player, obj_id npc)
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
|
|
// ======================================================================
|
|
// Script %TO Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DI Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// Script %DF Tokens
|
|
// ======================================================================
|
|
|
|
// ======================================================================
|
|
// handleBranch<n> Functions
|
|
// ======================================================================
|
|
|
|
int ree_yees_handleBranch6 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Reelo says you're all right. Some things have gone missing and I'd like you to go retrieve them.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: No thanks, this sounds beneath me.
|
|
if (response == "s_56")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Beneath you? There's no one around here beneath you. But if you're going to keep that attitude up you might end up beneath something else. Like the ground.
|
|
string_id message = new string_id (c_stringFile, "s_58");
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: What is it that's gone missing.
|
|
if (response == "s_60")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: An item we acquired recently. A famed musician was touring Tatooine a few weeks ago and we stole his gem encrusted bell, the one they use to signal the end of a concert. The Sand Splitters walked out of here with it and are looking for a buyer. Get it back from them.
|
|
string_id message = new string_id (c_stringFile, "s_62");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: I'll get it back.
|
|
boolean hasResponse0 = false;
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: Someone stole from Jabba?
|
|
boolean hasResponse1 = false;
|
|
if (ree_yees_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_64");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_66");
|
|
|
|
utils.setScriptVar (player, "conversation.ree_yees.branchId", 8);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I can retrieve anything.
|
|
if (response == "s_82")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
ree_yees_action_grantReeYeesQuest (player, npc);
|
|
|
|
//-- NPC: Get the gem encrusted bell, and I'll call you.
|
|
string_id message = new string_id (c_stringFile, "s_84");
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ree_yees_handleBranch8 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: An item we acquired recently. A famed musician was touring Tatooine a few weeks ago and we stole his gem encrusted bell, the one they use to signal the end of a concert. The Sand Splitters walked out of here with it and are looking for a buyer. Get it back from them.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: I'll get it back.
|
|
if (response == "s_64")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
ree_yees_action_grantReeYeesQuest (player, npc);
|
|
|
|
//-- NPC: Get the gem encrusted bell, and I'll call you.
|
|
string_id message = new string_id (c_stringFile, "s_84");
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Someone stole from Jabba?
|
|
if (response == "s_66")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: Yeah, we caught one of them as they were escaping. The Sarlacc had a nice little snack that day, but the rest of them got away. Word is that one of the knaves must be carrying it around.
|
|
string_id message = new string_id (c_stringFile, "s_68");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: So, I should just find that Sand Splitter knave?
|
|
boolean hasResponse0 = false;
|
|
if (ree_yees_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_70");
|
|
|
|
utils.setScriptVar (player, "conversation.ree_yees.branchId", 9);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ree_yees_handleBranch9 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: Yeah, we caught one of them as they were escaping. The Sarlacc had a nice little snack that day, but the rest of them got away. Word is that one of the knaves must be carrying it around.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: So, I should just find that Sand Splitter knave?
|
|
if (response == "s_70")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
//-- NPC: That's what I was thinking. Though we don't know who it is. So you may have to go through a few of them to get to the guy. See if you can find the bell and when you do I'll have something else for you.
|
|
string_id message = new string_id (c_stringFile, "s_72");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: Anything else?
|
|
boolean hasResponse0 = false;
|
|
if (ree_yees_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_74");
|
|
|
|
utils.setScriptVar (player, "conversation.ree_yees.branchId", 10);
|
|
|
|
npcSpeak (player, message);
|
|
npcSetConversationResponses (player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
int ree_yees_handleBranch10 (obj_id player, obj_id npc, string_id response)
|
|
{
|
|
//-- [BRANCH NOTE]
|
|
//-- NPC: That's what I was thinking. Though we don't know who it is. So you may have to go through a few of them to get to the guy. See if you can find the bell and when you do I'll have something else for you.
|
|
|
|
//-- [RESPONSE NOTE]
|
|
//-- PLAYER: Anything else?
|
|
if (response == "s_74")
|
|
{
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
ree_yees_action_grantReeYeesQuest (player, npc);
|
|
|
|
//-- NPC: No, that's all. Get the gem encrusted bell, and I'll call you.
|
|
string_id message = new string_id (c_stringFile, "s_28");
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
npcEndConversationWithMessage (player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
}
|
|
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
// ======================================================================
|
|
// User Script Triggers
|
|
// ======================================================================
|
|
|
|
trigger OnInitialize ()
|
|
{
|
|
if ((!isMob (self)) || (isPlayer (self)))
|
|
detachScript(self, "conversation.ree_yees");
|
|
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAttach ()
|
|
{
|
|
setCondition (self, CONDITION_CONVERSABLE);
|
|
setCondition (self, CONDITION_INTERESTING);
|
|
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.ree_yees");
|
|
|
|
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 (ree_yees_condition_completedReeYees (player, npc))
|
|
{
|
|
ree_yees_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Thanks for the help earlier.
|
|
string_id message = new string_id (c_stringFile, "s_4");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition_readyToFinish (player, npc))
|
|
{
|
|
ree_yees_action_sendCompletedSignal (player, npc);
|
|
|
|
//-- NPC: You did it! Excellent, the bell, the book, and the...well, I feel like I should say Candle, but I'm not sure why. Maybe that would be a good name for this warhead. The Candle. Hmm... Anyway, you did good work. Ephant Mon wants to speak to you about these Sennex pirates. Here, take your reward and go upstairs and see him.
|
|
string_id message = new string_id (c_stringFile, "s_86");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition_collectingCandle (player, npc))
|
|
{
|
|
ree_yees_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I need that explosive returned before somebody figures out how to arm it!
|
|
string_id message = new string_id (c_stringFile, "s_44");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition_collectingBook (player, npc))
|
|
{
|
|
ree_yees_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Have you found Jabba's ledger yet? Then what, pray tell, are you doing at the palace? Get back out there!
|
|
string_id message = new string_id (c_stringFile, "s_34");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition_collectingBell (player, npc))
|
|
{
|
|
ree_yees_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: Still haven't found my bell? I guess you'd better keep looking.
|
|
string_id message = new string_id (c_stringFile, "s_20");
|
|
chat.chat (npc, player, message);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition_completedReelo (player, npc))
|
|
{
|
|
ree_yees_action_clearPointer (player, npc);
|
|
|
|
//-- NPC: Reelo says you're all right. Some things have gone missing and I'd like you to go retrieve them.
|
|
string_id message = new string_id (c_stringFile, "s_54");
|
|
int numberOfResponses = 0;
|
|
|
|
boolean hasResponse = false;
|
|
|
|
//-- PLAYER: No thanks, this sounds beneath me.
|
|
boolean hasResponse0 = false;
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
|
|
//-- PLAYER: What is it that's gone missing.
|
|
boolean hasResponse1 = false;
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
|
|
//-- PLAYER: I can retrieve anything.
|
|
boolean hasResponse2 = false;
|
|
if (ree_yees_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_56");
|
|
|
|
if (hasResponse1)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_60");
|
|
|
|
if (hasResponse2)
|
|
responses [responseIndex++] = new string_id (c_stringFile, "s_82");
|
|
|
|
utils.setScriptVar (player, "conversation.ree_yees.branchId", 6);
|
|
|
|
npcStartConversation (player, npc, "ree_yees", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat (npc, player, message);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
//-- [NOTE]
|
|
if (ree_yees_condition__defaultCondition (player, npc))
|
|
{
|
|
ree_yees_action_facePlayer (player, npc);
|
|
|
|
//-- NPC: I think you should be talking to Reelo Baruk. I'm a little busy right now.
|
|
string_id message = new string_id (c_stringFile, "s_85");
|
|
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 != "ree_yees")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
obj_id npc = self;
|
|
|
|
int branchId = utils.getIntScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
if (branchId == 6 && ree_yees_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 8 && ree_yees_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 9 && ree_yees_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
if (branchId == 10 && ree_yees_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
|
|
return SCRIPT_CONTINUE;
|
|
|
|
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
|
|
utils.removeScriptVar (player, "conversation.ree_yees.branchId");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
// ======================================================================
|
|
|