Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/tatooine_wald_firstquest.java
T
2018-06-07 00:32:29 +01:00

1035 lines
45 KiB
Java
Executable File

package script.conversation;
import script.library.ai_lib;
import script.library.chat;
import script.library.groundquests;
import script.library.utils;
import script.*;
public class tatooine_wald_firstquest extends script.base_script
{
public tatooine_wald_firstquest()
{
}
public static String c_stringFile = "conversation/tatooine_wald_firstquest";
public boolean tatooine_wald_firstquest_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
{
return true;
}
public boolean tatooine_wald_firstquest_condition_task1_active(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_kill_greatermynock");
}
public boolean tatooine_wald_firstquest_condition_task1_complete(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_returntowald1");
}
public boolean tatooine_wald_firstquest_condition_task2_3_active(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_task_two_and_three_complete_WFT");
}
public boolean tatooine_wald_firstquest_condition_task2_3_complete(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "tatooine_wald_firstquest", "tatooine_wald_firstquest_returntowald2");
}
public boolean tatooine_wald_firstquest_condition_quest_complete(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.hasCompletedQuest(player, "tatooine_wald_firstquest");
}
public void tatooine_wald_firstquest_action_grant_quest(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.grantQuest(player, "tatooine_wald_firstquest");
}
public void tatooine_wald_firstquest_action_task1_complete_signal(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "tatooine_wald_firstquest_finished_task1");
}
public void tatooine_wald_firstquest_action_task2_3_complete_signal(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "tatooine_wald_firstquest_finished_task2_and_3");
}
public int tatooine_wald_firstquest_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_76"))
{
doAnimationAction(player, "shrug_shoulders");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "wave1");
tatooine_wald_firstquest_action_task2_3_complete_signal(player, npc);
string_id message = new string_id(c_stringFile, "s_79");
utils.removeScriptVar(player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_77"))
{
doAnimationAction(player, "expect_tip");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "sigh_deeply");
tatooine_wald_firstquest_action_task2_3_complete_signal(player, npc);
string_id message = new string_id(c_stringFile, "s_80");
utils.removeScriptVar(player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_78"))
{
doAnimationAction(player, "mock");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "shake_head_disgust");
tatooine_wald_firstquest_action_task2_3_complete_signal(player, npc);
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;
}
public int tatooine_wald_firstquest_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_18"))
{
doAnimationAction(player, "listen");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
doAnimationAction(player, "listen");
string_id message = new string_id(c_stringFile, "s_60");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_30"))
{
doAnimationAction(player, "check_wrist_device");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
public int tatooine_wald_firstquest_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_61"))
{
doAnimationAction(player, "nod_head_once");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
doAnimationAction(player, "listen");
string_id message = new string_id(c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_63"))
{
doAnimationAction(player, "check_wrist_device");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
public int tatooine_wald_firstquest_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_65"))
{
doAnimationAction(player, "nod");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
doAnimationAction(player, "listen");
string_id message = new string_id(c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_72"))
{
doAnimationAction(player, "shake_head_no");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
public int tatooine_wald_firstquest_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_67"))
{
doAnimationAction(player, "point_to_self");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "paper");
tatooine_wald_firstquest_action_task1_complete_signal(player, npc);
string_id message = new string_id(c_stringFile, "s_69");
utils.removeScriptVar(player, "conversation.tatooine_wald_firstquest.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_73"))
{
doAnimationAction(player, "shake_head_no");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_32");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
public int tatooine_wald_firstquest_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_34"))
{
doAnimationAction(player, "rub_chin_thoughtful");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
doAnimationAction(player, "listen");
string_id message = new string_id(c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_36"))
{
doAnimationAction(player, "wave2");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "thank");
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;
}
public int tatooine_wald_firstquest_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_44"))
{
doAnimationAction(player, "slow_down");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "implore");
string_id message = new string_id(c_stringFile, "s_46");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_98"))
{
doAnimationAction(player, "standing_placate");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "check_wrist_device");
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;
}
public int tatooine_wald_firstquest_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_48"))
{
doAnimationAction(player, "nod_head_once");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_50");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_94"))
{
doAnimationAction(player, "check_wrist_device");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nervous");
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;
}
public int tatooine_wald_firstquest_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_52"))
{
doAnimationAction(player, "laugh");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
}
if (response.equals("s_90"))
{
doAnimationAction(player, "shake_head_disgust");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "sigh_deeply");
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;
}
public int tatooine_wald_firstquest_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_56"))
{
doAnimationAction(player, "standing_placate");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "thank");
tatooine_wald_firstquest_action_grant_quest(player, npc);
string_id message = new string_id(c_stringFile, "s_70");
int numberOfResponses = 0;
boolean hasResponse = false;
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;
}
}
if (response.equals("s_86"))
{
doAnimationAction(player, "gesticulate_wildly");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "shake_head_disgust");
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;
}
public int tatooine_wald_firstquest_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_82"))
{
doAnimationAction(player, "wave1");
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "goodbye");
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;
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if ((!isTangible(self)) || (isPlayer(self)))
{
detachScript(self, "conversation.tatooine_wald_firstquest");
}
setCondition(self, CONDITION_CONVERSABLE);
return SCRIPT_CONTINUE;
}
public int OnAttach(obj_id self) throws InterruptedException
{
setCondition(self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_INTERESTING);
setInvulnerable(self, true);
return SCRIPT_CONTINUE;
}
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException
{
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;
}
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
{
clearCondition(self, CONDITION_CONVERSABLE);
detachScript(self, "conversation.tatooine_wald_firstquest");
return SCRIPT_CONTINUE;
}
public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException
{
Object[] objects = new Object[responses.length];
System.arraycopy(responses, 0, objects, 0, responses.length);
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
}
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException
{
obj_id npc = self;
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player))
{
return SCRIPT_OVERRIDE;
}
if (tatooine_wald_firstquest_condition_quest_complete(player, npc))
{
doAnimationAction(npc, "bow3");
string_id message = new string_id(c_stringFile, "s_59");
chat.chat(npc, player, message);
return SCRIPT_CONTINUE;
}
if (tatooine_wald_firstquest_condition_task2_3_complete(player, npc))
{
doAnimationAction(npc, "udaman");
string_id message = new string_id(c_stringFile, "s_58");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
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;
}
if (tatooine_wald_firstquest_condition_task2_3_active(player, npc))
{
doAnimationAction(npc, "adjust");
string_id message = new string_id(c_stringFile, "s_57");
chat.chat(npc, player, message);
return SCRIPT_CONTINUE;
}
if (tatooine_wald_firstquest_condition_task1_complete(player, npc))
{
doAnimationAction(npc, "celebrate1");
string_id message = new string_id(c_stringFile, "s_16");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
if (tatooine_wald_firstquest_condition_task1_active(player, npc))
{
doAnimationAction(npc, "check_wrist_device");
string_id message = new string_id(c_stringFile, "s_40");
chat.chat(npc, player, message);
return SCRIPT_CONTINUE;
}
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "gesticulate_wildly");
string_id message = new string_id(c_stringFile, "s_42");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (tatooine_wald_firstquest_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
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;
}
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException
{
if (!conversationId.equals("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;
}
}