package script.conversation; import script.*; import script.base_class.*; import script.combat_engine.*; import java.util.Arrays; import java.util.Hashtable; import java.util.Vector; import script.base_script; import script.library.ai_lib; import script.library.chat; import script.library.groundquests; import script.library.utils; public class ep3_sera_jossi extends script.base_script { public ep3_sera_jossi() { } public static String c_stringFile = "conversation/ep3_sera_jossi"; public boolean ep3_sera_jossi_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException { return true; } public boolean ep3_sera_jossi_condition_hasCompletedInitialQuests(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.hasCompletedQuest(player, "ep3_sera_10_wookiee_teeth") || groundquests.hasCompletedQuest(player, "ep3_sera_wrhisch_liver")); } public boolean ep3_sera_jossi_condition_hasCompleted10WookieeTeeth(obj_id player, obj_id npc) throws InterruptedException { return groundquests.hasCompletedQuest(player, "ep3_sera_10_wookiee_teeth") && !groundquests.hasCompletedQuest(player, "ep3_sera_wrhisch_liver"); } public boolean ep3_sera_jossi_condition_isOnMyQuests(obj_id player, obj_id npc) throws InterruptedException { return (groundquests.isQuestActive(player, "ep3_sera_10_wookiee_teeth") || groundquests.isQuestActive(player, "ep3_sera_wrhisch_liver")); } public boolean ep3_sera_jossi_condition_isRroowDeliveryActive(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isQuestActive(player, "ep3_rroow_sera_package_deliver"); } public void ep3_sera_jossi_action_GrantKill10Wookiee(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "ep3_sera_10_wookiee_teeth"); } public void ep3_sera_jossi_action_GrantCollectWrhischLiver(obj_id player, obj_id npc) throws InterruptedException { groundquests.grantQuest(player, "ep3_sera_wrhisch_liver"); } public void ep3_sera_jossi_action_sendDeliverComplete(obj_id player, obj_id npc) throws InterruptedException { groundquests.sendSignal(player, "signalRroowSeraDeliver"); } public int ep3_sera_jossi_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_149")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "rub_belly"); string_id message = new string_id(c_stringFile, "s_150"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_151"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 2); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_151")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "smack_self"); ep3_sera_jossi_action_sendDeliverComplete(player, npc); string_id message = new string_id(c_stringFile, "s_172"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_173"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 3); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_173")) { if (ep3_sera_jossi_condition_isRroowDeliveryActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_148"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_149"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 1); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition_isOnMyQuests(player, npc)) { string_id message = new string_id(c_stringFile, "s_143"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } if (!ep3_sera_jossi_condition_hasCompletedInitialQuests(player, npc)) { doAnimationAction(npc, "greet"); string_id message = new string_id(c_stringFile, "s_58"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_60"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_82"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 5); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition_hasCompleted10WookieeTeeth(player, npc)) { string_id message = new string_id(c_stringFile, "s_145"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_194"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 24); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_147"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_60")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_62"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_72"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 6); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_82")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "thumb_up"); string_id message = new string_id(c_stringFile, "s_84"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_86"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 9); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_72")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_74"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_76"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_78"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 7); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_76")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "sigh_deeply"); string_id message = new string_id(c_stringFile, "s_88"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_90"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_78")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_80"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_86")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "sigh_deeply"); string_id message = new string_id(c_stringFile, "s_88"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_90"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 10); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_90")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "explain"); string_id message = new string_id(c_stringFile, "s_92"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_94"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_116"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 11); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_94")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "tap_head"); string_id message = new string_id(c_stringFile, "s_96"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_98"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 12); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_116")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "goodbye"); string_id message = new string_id(c_stringFile, "s_118"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_120"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_98")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_100"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_102"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_106"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 13); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_102")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ep3_sera_jossi_action_GrantKill10Wookiee(player, npc); string_id message = new string_id(c_stringFile, "s_104"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_106")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_108"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_110"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_112"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 15); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_110")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "goodbye"); string_id message = new string_id(c_stringFile, "s_118"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_120"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } if (response.equals("s_112")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_114"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_120")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_122"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_124"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 18); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_124")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_126"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_128"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 19); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_128")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_130"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_132"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 20); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_132")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_134"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_136"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_140"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 21); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_136")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ep3_sera_jossi_action_GrantCollectWrhischLiver(player, npc); string_id message = new string_id(c_stringFile, "s_138"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } if (response.equals("s_140")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_142"); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int ep3_sera_jossi_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_194")) { if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { doAnimationAction(npc, "goodbye"); string_id message = new string_id(c_stringFile, "s_118"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_120"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 17); npcSpeak(player, message); npcSetConversationResponses(player, responses); } else { utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); npcEndConversationWithMessage(player, message); } return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } public int OnInitialize(obj_id self) throws InterruptedException { if ((!isMob(self)) || (isPlayer(self))) { detachScript(self, "conversation.ep3_sera_jossi"); } setCondition(self, CONDITION_CONVERSABLE); return SCRIPT_CONTINUE; } public int OnAttach(obj_id self) throws InterruptedException { setCondition(self, CONDITION_CONVERSABLE); 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); faceTo(self, player); return SCRIPT_CONTINUE; } public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException { clearCondition(self, CONDITION_CONVERSABLE); detachScript(self, "conversation.ep3_sera_jossi"); 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 (ep3_sera_jossi_condition_isRroowDeliveryActive(player, npc)) { string_id message = new string_id(c_stringFile, "s_148"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_149"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 1); npcStartConversation(player, npc, "ep3_sera_jossi", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition_isOnMyQuests(player, npc)) { string_id message = new string_id(c_stringFile, "s_143"); chat.chat(npc, player, message); return SCRIPT_CONTINUE; } if (!ep3_sera_jossi_condition_hasCompletedInitialQuests(player, npc)) { doAnimationAction(npc, "greet"); string_id message = new string_id(c_stringFile, "s_58"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { ++numberOfResponses; hasResponse = true; hasResponse0 = true; } boolean hasResponse1 = false; if (ep3_sera_jossi_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_60"); } if (hasResponse1) { responses[responseIndex++] = new string_id(c_stringFile, "s_82"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 5); npcStartConversation(player, npc, "ep3_sera_jossi", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition_hasCompleted10WookieeTeeth(player, npc)) { string_id message = new string_id(c_stringFile, "s_145"); int numberOfResponses = 0; boolean hasResponse = false; boolean hasResponse0 = false; if (ep3_sera_jossi_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_194"); } utils.setScriptVar(player, "conversation.ep3_sera_jossi.branchId", 24); npcStartConversation(player, npc, "ep3_sera_jossi", message, responses); } else { chat.chat(npc, player, message); } return SCRIPT_CONTINUE; } if (ep3_sera_jossi_condition__defaultCondition(player, npc)) { string_id message = new string_id(c_stringFile, "s_147"); 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("ep3_sera_jossi")) { return SCRIPT_CONTINUE; } obj_id npc = self; int branchId = utils.getIntScriptVar(player, "conversation.ep3_sera_jossi.branchId"); if (branchId == 1 && ep3_sera_jossi_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 2 && ep3_sera_jossi_handleBranch2(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 3 && ep3_sera_jossi_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 5 && ep3_sera_jossi_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 6 && ep3_sera_jossi_handleBranch6(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 7 && ep3_sera_jossi_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 9 && ep3_sera_jossi_handleBranch9(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 10 && ep3_sera_jossi_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 11 && ep3_sera_jossi_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 12 && ep3_sera_jossi_handleBranch12(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 13 && ep3_sera_jossi_handleBranch13(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 15 && ep3_sera_jossi_handleBranch15(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 17 && ep3_sera_jossi_handleBranch17(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 18 && ep3_sera_jossi_handleBranch18(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 19 && ep3_sera_jossi_handleBranch19(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 20 && ep3_sera_jossi_handleBranch20(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 21 && ep3_sera_jossi_handleBranch21(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } if (branchId == 24 && ep3_sera_jossi_handleBranch24(player, npc, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); utils.removeScriptVar(player, "conversation.ep3_sera_jossi.branchId"); return SCRIPT_CONTINUE; } }