Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/tatooine_wald_firstquest.script
T
2013-09-10 23:17:15 -07:00

1535 lines
48 KiB
Plaintext

// ======================================================================
//
// tatooine_wald_firstquest.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/tatooine_wald_firstquest";
// ======================================================================
// Script Conditions
// ======================================================================
boolean tatooine_wald_firstquest_condition__defaultCondition (obj_id player, obj_id npc)
{
return true;
}
// ----------------------------------------------------------------------
boolean tatooine_wald_firstquest_condition_task1_active (obj_id player, obj_id npc)
{
// checking for task one being active
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_kill_greatermynock");
}
// ----------------------------------------------------------------------
boolean tatooine_wald_firstquest_condition_task1_complete (obj_id player, obj_id npc)
{
// the wait for signal task following task 1 is active, which means task 1 is complete
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_returntowald1");
}
// ----------------------------------------------------------------------
boolean tatooine_wald_firstquest_condition_task2_3_active (obj_id player, obj_id npc)
{
// checking for tasks two and three being active
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_task_two_and_three_complete_WFT");
}
// ----------------------------------------------------------------------
boolean tatooine_wald_firstquest_condition_task2_3_complete (obj_id player, obj_id npc)
{
// the wait for signal task following task 2_3 is active, which means task 1 is complete
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_returntowald2");
}
// ----------------------------------------------------------------------
boolean tatooine_wald_firstquest_condition_quest_complete (obj_id player, obj_id npc)
{
// The quest as a whole has been completed.
return groundquests.hasCompletedQuest(player, "tatooine_wald_firstquest");
}
// ======================================================================
// Script Actions
// ======================================================================
void tatooine_wald_firstquest_action_grant_quest (obj_id player, obj_id npc)
{
// grant the quest to get things started. Task 1 will now be active.
groundquests.grantQuest(player, "tatooine_wald_firstquest");
}
// ----------------------------------------------------------------------
void tatooine_wald_firstquest_action_task1_complete_signal (obj_id player, obj_id npc)
{
// Send the signal for the wait for signal task following task 1.
// This will activate task 2.
groundquests.sendSignal(player, "tatooine_wald_firstquest_finished_task1");
}
// ----------------------------------------------------------------------
void tatooine_wald_firstquest_action_task2_3_complete_signal (obj_id player, obj_id npc)
{
// Send the signal for the wait for signal task following task 1.
// This will activate tasks 2 and 3.
groundquests.sendSignal(player, "tatooine_wald_firstquest_finished_task2_and_3");
}
// ======================================================================
// Script %TO Tokens
// ======================================================================
// ======================================================================
// Script %DI Tokens
// ======================================================================
// ======================================================================
// Script %DF Tokens
// ======================================================================
// ======================================================================
// handleBranch<n> Functions
// ======================================================================
int tatooine_wald_firstquest_handleBranch2 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: My customer has delivered payment and the engines on time. I can not thank you enough, my friend. Watto is going to be...well, not angry at me, which is a good thing. I know this isn't much, but you have my gratitude as well and perhaps that will count for something with you as well.
//-- [RESPONSE NOTE]
//-- PLAYER: I was glad to help, Wald.
if (response == "s_76")
{
doAnimationAction (player, "shrug_shoulders");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "wave1");
tatooine_wald_firstquest_action_task2_3_complete_signal (player, npc);
//-- NPC: Take care, my friend.
string_id message = new string_id (c_stringFile, "s_79");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Always glad to help so long as I get paid. See ya around, Rodian.
if (response == "s_77")
{
doAnimationAction (player, "expect_tip");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
tatooine_wald_firstquest_action_task2_3_complete_signal (player, npc);
//-- NPC: Take care then.
string_id message = new string_id (c_stringFile, "s_80");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: That's it! I suppose a junk dealer just doesn't have the means to pay well.
if (response == "s_78")
{
doAnimationAction (player, "mock");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_disgust");
tatooine_wald_firstquest_action_task2_3_complete_signal (player, npc);
//-- NPC: Hmm, well, good day.
string_id message = new string_id (c_stringFile, "s_81");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch7 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Welcome back! You have shown me that your skills are not underrated. I have two more tasks for you if you are interested. I can even pay you a little for your help this time.
//-- [RESPONSE NOTE]
//-- PLAYER: Whatever I can do to help out.
if (response == "s_18")
{
doAnimationAction (player, "listen");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "listen");
//-- NPC: Excellent! There are only two extra jobs left so I'll let you choose which you do first. The first involves teaching a lesson to some punk kids here in Mos Espa. The other is a simple pickup of some merchandise for a customer of mine. Still interested?
string_id message = new string_id (c_stringFile, "s_60");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: What's this about teaching kids a lesson?
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Hmm, actually, that sounds like a lot to do. I'll pass.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_61");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_63");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 8);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: I can't help you any further. I just don't have the time.
if (response == "s_30")
{
doAnimationAction (player, "check_wrist_device");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: I understand. Thank you for your help so far. You have helped me get a bit closer to finishing my chores. Now I just have to find a way to get these last two done.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Only two more jobs? On second thought, I have a little bit of time if you make it quick.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Good luck.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_34");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch8 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Excellent! There are only two extra jobs left so I'll let you choose which you do first. The first involves teaching a lesson to some punk kids here in Mos Espa. The other is a simple pickup of some merchandise for a customer of mine. Still interested?
//-- [RESPONSE NOTE]
//-- PLAYER: What's this about teaching kids a lesson?
if (response == "s_61")
{
doAnimationAction (player, "nod_head_once");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "listen");
//-- NPC: There is a local gang of teens called the Laser Flits. They are a relatively new gang operating here out of Mos Espa. I have the location of their hideout. Recently they ambushed a delivery of swoop parts we were delivering to a customer. There were ten parts in all. I need you to recover those parts. Most likely you'll find the parts on these gang members. If you have to teach these kids a lesson to get the parts back, so be it.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Alright, that sounds easy.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: On second thought, I've changed my mind.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_65");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_72");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Hmm, actually, that sounds like a lot to do. I'll pass.
if (response == "s_63")
{
doAnimationAction (player, "check_wrist_device");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: I understand. Thank you for your help so far. You have helped me get a bit closer to finishing my chores. Now I just have to find a way to get these last two done.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Only two more jobs? On second thought, I have a little bit of time if you make it quick.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Good luck.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_34");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch9 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: There is a local gang of teens called the Laser Flits. They are a relatively new gang operating here out of Mos Espa. I have the location of their hideout. Recently they ambushed a delivery of swoop parts we were delivering to a customer. There were ten parts in all. I need you to recover those parts. Most likely you'll find the parts on these gang members. If you have to teach these kids a lesson to get the parts back, so be it.
//-- [RESPONSE NOTE]
//-- PLAYER: Alright, that sounds easy.
if (response == "s_65")
{
doAnimationAction (player, "nod");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "listen");
//-- NPC: Once you find all ten parts, there is a customer waiting on them in the bar at the Mos Espa Starport. He is also the man I am buying the engine parts from. I have a credit chip to pay for the engines which are off an old Y-wing model. You'll need to give him the credit chip. You can certainly pick up the engine parts first and then handle the gang. I leave that up to you. However, I'm paying you to do both together.
string_id message = new string_id (c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Fair enough. Can I get the coordinates and the credit chip, then? I'd like to get started.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: You know what, I've changed my mind. You'll have to find someone else.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_67");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_73");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 10);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: On second thought, I've changed my mind.
if (response == "s_72")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: I understand. Thank you for your help so far. You have helped me get a bit closer to finishing my chores. Now I just have to find a way to get these last two done.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Only two more jobs? On second thought, I have a little bit of time if you make it quick.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Good luck.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_34");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch10 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Once you find all ten parts, there is a customer waiting on them in the bar at the Mos Espa Starport. He is also the man I am buying the engine parts from. I have a credit chip to pay for the engines which are off an old Y-wing model. You'll need to give him the credit chip. You can certainly pick up the engine parts first and then handle the gang. I leave that up to you. However, I'm paying you to do both together.
//-- [RESPONSE NOTE]
//-- PLAYER: Fair enough. Can I get the coordinates and the credit chip, then? I'd like to get started.
if (response == "s_67")
{
doAnimationAction (player, "point_to_self");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "paper");
tatooine_wald_firstquest_action_task1_complete_signal (player, npc);
//-- NPC: Alright, here is the chip and the coordinates. Come back here when you have finished and I will pay you what I can.
string_id message = new string_id (c_stringFile, "s_69");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: You know what, I've changed my mind. You'll have to find someone else.
if (response == "s_73")
{
doAnimationAction (player, "shake_head_no");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nod");
//-- NPC: I understand. Thank you for your help so far. You have helped me get a bit closer to finishing my chores. Now I just have to find a way to get these last two done.
string_id message = new string_id (c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Only two more jobs? On second thought, I have a little bit of time if you make it quick.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Good luck.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_34");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_36");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 12);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch12 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I understand. Thank you for your help so far. You have helped me get a bit closer to finishing my chores. Now I just have to find a way to get these last two done.
//-- [RESPONSE NOTE]
//-- PLAYER: Only two more jobs? On second thought, I have a little bit of time if you make it quick.
if (response == "s_34")
{
doAnimationAction (player, "rub_chin_thoughtful");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
doAnimationAction (player, "listen");
//-- NPC: There is a local gang of teens called the Laser Flits. They are a relatively new gang operating here out of Mos Espa. I have the location of their hideout. Recently they ambushed a delivery of swoop parts we were delivering to a customer. There were ten parts in all. I need you to recover those parts. Most likely you'll find the parts on these gang members. If you have to teach these kids a lesson to get the parts back, so be it.
string_id message = new string_id (c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Alright, that sounds easy.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: On second thought, I've changed my mind.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_65");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_72");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 9);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Good luck.
if (response == "s_36")
{
doAnimationAction (player, "wave2");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
//-- NPC: Thanks.
string_id message = new string_id (c_stringFile, "s_38");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch15 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I'm afraid you will have to talk to Watto if you need something. I have too much to do...yes, far too much to do.
//-- [RESPONSE NOTE]
//-- PLAYER: Easy, there. You look overwhelmed. Is there something I can help with?
if (response == "s_44")
{
doAnimationAction (player, "slow_down");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "implore");
//-- NPC: You would be willing to help me out? Generous of you. My name is Wald. My boss, Watto, has asked me to do a number of things in addition to my regular daily chores. The problem is, I don't have the ability to personally take care of some of them. Maybe you are.
string_id message = new string_id (c_stringFile, "s_46");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I can handle it. What do you need done?
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Sounds tough. Perhaps you should get someone else to help out.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_48");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_94");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 16);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Fine, I'll leave you to your work.
if (response == "s_98")
{
doAnimationAction (player, "standing_placate");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "check_wrist_device");
//-- NPC: How will I ever finish all of this before sunsdown?
string_id message = new string_id (c_stringFile, "s_100");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch16 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: You would be willing to help me out? Generous of you. My name is Wald. My boss, Watto, has asked me to do a number of things in addition to my regular daily chores. The problem is, I don't have the ability to personally take care of some of them. Maybe you are.
//-- [RESPONSE NOTE]
//-- PLAYER: I can handle it. What do you need done?
if (response == "s_48")
{
doAnimationAction (player, "nod_head_once");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: I need to make sure you have the skills I need. The first problem I have is mynocks. Mynocks have been slipping into the junkyard and eating all the power cables at night.
string_id message = new string_id (c_stringFile, "s_50");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Mynocks! That should not be a problem.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Mynocks! You need an exterminator, not me! Next time, waste someone else's time, Rodian!
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_52");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_90");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 17);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Sounds tough. Perhaps you should get someone else to help out.
if (response == "s_94")
{
doAnimationAction (player, "check_wrist_device");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "nervous");
//-- NPC: Yes, perhaps you are right. Oh, how will I ever finish all of this before sunsdown?
string_id message = new string_id (c_stringFile, "s_96");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch17 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: I need to make sure you have the skills I need. The first problem I have is mynocks. Mynocks have been slipping into the junkyard and eating all the power cables at night.
//-- [RESPONSE NOTE]
//-- PLAYER: Mynocks! That should not be a problem.
if (response == "s_52")
{
doAnimationAction (player, "laugh");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "explain");
//-- NPC: Normally, no. It would be something I could handle on my own. However, these are not your average Tatooinian mynocks. This is a flock of rather large mynocks, giants even. A regular customer noted the location of their nest the other day and I have the coordinates if you are still willing to help.
string_id message = new string_id (c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Giant mynock, huh? Well, I will give it a shot. What are the coordinates?
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Did you say GIANT mynock? Um...I think I've changed my mind. Good luck with those monsters.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_56");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_86");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 18);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Mynocks! You need an exterminator, not me! Next time, waste someone else's time, Rodian!
if (response == "s_90")
{
doAnimationAction (player, "shake_head_disgust");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "sigh_deeply");
//-- NPC: I am sorry to have bothered you. I will find someone more capable.
string_id message = new string_id (c_stringFile, "s_92");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch18 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Normally, no. It would be something I could handle on my own. However, these are not your average Tatooinian mynocks. This is a flock of rather large mynocks, giants even. A regular customer noted the location of their nest the other day and I have the coordinates if you are still willing to help.
//-- [RESPONSE NOTE]
//-- PLAYER: Giant mynock, huh? Well, I will give it a shot. What are the coordinates?
if (response == "s_56")
{
doAnimationAction (player, "standing_placate");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "thank");
tatooine_wald_firstquest_action_grant_quest (player, npc);
//-- NPC: Oh thank you! Here are the coordinates. Please come back when you have thinned out their flock enough to make them move on to another area. Twenty should be enough.
string_id message = new string_id (c_stringFile, "s_70");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I'll be back soon.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_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_82");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 19);
npcSpeak (player, message);
npcSetConversationResponses (player, responses);
}
else
{
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
}
return SCRIPT_CONTINUE;
}
}
//-- [RESPONSE NOTE]
//-- PLAYER: Did you say GIANT mynock? Um...I think I've changed my mind. Good luck with those monsters.
if (response == "s_86")
{
doAnimationAction (player, "gesticulate_wildly");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "shake_head_disgust");
//-- NPC: Right. Thanks a ton. How am I going to finish all of this before sunsdown?
string_id message = new string_id (c_stringFile, "s_88");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
int tatooine_wald_firstquest_handleBranch19 (obj_id player, obj_id npc, string_id response)
{
//-- [BRANCH NOTE]
//-- NPC: Oh thank you! Here are the coordinates. Please come back when you have thinned out their flock enough to make them move on to another area. Twenty should be enough.
//-- [RESPONSE NOTE]
//-- PLAYER: I'll be back soon.
if (response == "s_82")
{
doAnimationAction (player, "wave1");
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "goodbye");
//-- NPC: Great! See you then.
string_id message = new string_id (c_stringFile, "s_84");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage (player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
// ----------------------------------------------------------------------
// ======================================================================
// User Script Triggers
// ======================================================================
trigger OnInitialize ()
{
if ((!isTangible (self)) || (isPlayer (self)))
detachScript(self, "conversation.tatooine_wald_firstquest");
setCondition (self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
trigger OnAttach ()
{
setCondition (self, CONDITION_CONVERSABLE);
setCondition (self, CONDITION_INTERESTING);
setInvulnerable (self, true);
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.tatooine_wald_firstquest");
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 (tatooine_wald_firstquest_condition_quest_complete (player, npc))
{
doAnimationAction (npc, "bow3");
//-- NPC: I want to thank you again for helping me with those jobs. Come back any time.
string_id message = new string_id (c_stringFile, "s_59");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_wald_firstquest_condition_task2_3_complete (player, npc))
{
doAnimationAction (npc, "udaman");
//-- NPC: My customer has delivered payment and the engines on time. I can not thank you enough, my friend. Watto is going to be...well, not angry at me, which is a good thing. I know this isn't much, but you have my gratitude as well and perhaps that will count for something with you as well.
string_id message = new string_id (c_stringFile, "s_58");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: I was glad to help, Wald.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Always glad to help so long as I get paid. See ya around, Rodian.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
//-- PLAYER: That's it! I suppose a junk dealer just doesn't have the means to pay well.
boolean hasResponse2 = false;
if (tatooine_wald_firstquest_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_76");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_77");
if (hasResponse2)
responses [responseIndex++] = new string_id (c_stringFile, "s_78");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 2);
npcStartConversation (player, npc, "tatooine_wald_firstquest", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_wald_firstquest_condition_task2_3_active (player, npc))
{
doAnimationAction (npc, "adjust");
//-- NPC: Please finish those two jobs before the suns set or else Watto is going to let me have it. I appreciate all you have done so far.
string_id message = new string_id (c_stringFile, "s_57");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_wald_firstquest_condition_task1_complete (player, npc))
{
doAnimationAction (npc, "celebrate1");
//-- NPC: Welcome back! You have shown me that your skills are not underrated. I have two more tasks for you if you are interested. I can even pay you a little for your help this time.
string_id message = new string_id (c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Whatever I can do to help out.
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: I can't help you any further. I just don't have the time.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_18");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_30");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 7);
npcStartConversation (player, npc, "tatooine_wald_firstquest", message, responses);
}
else
{
chat.chat (npc, player, message);
}
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_wald_firstquest_condition_task1_active (player, npc))
{
doAnimationAction (npc, "check_wrist_device");
//-- NPC: I'm sorry I'm very busy...oh, its you! How goes the giant mynock hunting? Have you thinned them out enough yet?
string_id message = new string_id (c_stringFile, "s_40");
chat.chat (npc, player, message);
return SCRIPT_CONTINUE;
}
//-- [NOTE]
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
doAnimationAction (npc, "gesticulate_wildly");
//-- NPC: I'm afraid you will have to talk to Watto if you need something. I have too much to do...yes, far too much to do.
string_id message = new string_id (c_stringFile, "s_42");
int numberOfResponses = 0;
boolean hasResponse = false;
//-- PLAYER: Easy, there. You look overwhelmed. Is there something I can help with?
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition (player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
//-- PLAYER: Fine, I'll leave you to your work.
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_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_44");
if (hasResponse1)
responses [responseIndex++] = new string_id (c_stringFile, "s_98");
utils.setScriptVar (player, "conversation.tatooine_wald_firstquest.branchId", 15);
npcStartConversation (player, npc, "tatooine_wald_firstquest", 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 != "tatooine_wald_firstquest")
return SCRIPT_CONTINUE;
obj_id npc = self;
int branchId = utils.getIntScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
if (branchId == 2 && tatooine_wald_firstquest_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 7 && tatooine_wald_firstquest_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 8 && tatooine_wald_firstquest_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 9 && tatooine_wald_firstquest_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 10 && tatooine_wald_firstquest_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 12 && tatooine_wald_firstquest_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 15 && tatooine_wald_firstquest_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 16 && tatooine_wald_firstquest_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 17 && tatooine_wald_firstquest_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 18 && tatooine_wald_firstquest_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
if (branchId == 19 && tatooine_wald_firstquest_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE)
return SCRIPT_CONTINUE;
chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar (player, "conversation.tatooine_wald_firstquest.branchId");
return SCRIPT_CONTINUE;
}
// ======================================================================