Files
2018-06-07 00:32:29 +01:00

1064 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 npe_station_inaldra extends script.base_script
{
public npe_station_inaldra()
{
}
public static String c_stringFile = "conversation/npe_station_inaldra";
public boolean npe_station_inaldra_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
{
return true;
}
public boolean npe_station_inaldra_condition_playerOnQuest(obj_id player, obj_id npc) throws InterruptedException
{
return (groundquests.isQuestActive(player, "npe_main_quest") && groundquests.hasCompletedTask(player, "npe_main_quest", "talktoinaldra1"));
}
public boolean npe_station_inaldra_condition_playerOnSecondInaldraStep(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "npe_main_quest", "talktoinaldra2");
}
public boolean npe_station_inaldra_condition_playerCompletedFirstQuest(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.hasCompletedTask(player, "npe_main_quest", "talktoinaldra2");
}
public boolean npe_station_inaldra_condition_playeronFirstInaldraStep(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "npe_main_quest", "talktoinaldra1");
}
public boolean npe_station_inaldra_condition_playerOnHanStep(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "npe_main_quest", "talktohan1");
}
public boolean npe_station_inaldra_condition_main2Inaldra1(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "npe_main_quest_2", "inaldra1");
}
public boolean npe_station_inaldra_condition_main2Inaldra2(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "npe_main_quest_2", "inaldra2");
}
public boolean npe_station_inaldra_condition_playerOnMainQuest2(obj_id player, obj_id npc) throws InterruptedException
{
return (groundquests.isQuestActive(player, "npe_main_quest_2") && groundquests.hasCompletedTask(player, "npe_main_quest_2", "inaldra1"));
}
public boolean npe_station_inaldra_condition_playerCompletedSecondQuest(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.hasCompletedQuest(player, "npe_main_quest_2");
}
public void npe_station_inaldra_action_signalInaldra1(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "npe_main_inaldra1");
}
public void npe_station_inaldra_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException
{
faceTo(npc, player);
}
public void npe_station_inaldra_action_signalInaldra2(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "npe_main_inaldra2");
}
public void npe_station_inaldra_action_signaMain2Inaldra1(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "npe_main2_inaldra_open");
}
public void npe_station_inaldra_action_signaMain2Inaldra2(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "npe_main2_inaldra_final");
}
public int npe_station_inaldra_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_61"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_62");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_63");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 3);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_63"))
{
doAnimationAction(player, "feed_creature_medium");
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_64");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_65");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 4);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_65"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "gesticulate_wildly");
string_id message = new string_id(c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_67");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 5);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_67"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_68");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_69");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 6);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_69"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
npe_station_inaldra_action_signaMain2Inaldra2(player, npc);
string_id message = new string_id(c_stringFile, "s_70");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_35"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_39");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_41"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "sigh_deeply");
string_id message = new string_id(c_stringFile, "s_43");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_45");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 10);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_45"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "laugh");
string_id message = new string_id(c_stringFile, "s_56");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_58");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 11);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_58"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
npe_station_inaldra_action_signaMain2Inaldra1(player, npc);
string_id message = new string_id(c_stringFile, "s_59");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_32"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_34");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_36"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "thank");
npe_station_inaldra_action_signalInaldra2(player, npc);
string_id message = new string_id(c_stringFile, "s_38");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_46");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 15);
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
npcSpeak(player, pp);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
chat.chat(npc, player, pp);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_46"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_47");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_48");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 16);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_48"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_49");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_50");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 17);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_50"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_52");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_53");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 18);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_53"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "laugh");
npe_station_inaldra_action_signalInaldra2(player, npc);
string_id message = new string_id(c_stringFile, "s_55");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_73"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "point_accusingly");
string_id message = new string_id(c_stringFile, "s_75");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_77");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 21);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_77"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_79");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_81");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 22);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_81"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "sigh_deeply");
string_id message = new string_id(c_stringFile, "s_83");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_85");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 23);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_85"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "wave_finger_warning");
string_id message = new string_id(c_stringFile, "s_87");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_89");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 24);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_89"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "shrug_shoulders");
string_id message = new string_id(c_stringFile, "s_91");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_93");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 25);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int npe_station_inaldra_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_93"))
{
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
npe_station_inaldra_action_signalInaldra1(player, npc);
string_id message = new string_id(c_stringFile, "s_95");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if ((!isMob(self)) || (isPlayer(self)))
{
detachScript(self, "conversation.npe_station_inaldra");
}
setCondition(self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_INTERESTING);
setInvulnerable(self, true);
setName(self, "Inaldra");
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
return SCRIPT_CONTINUE;
}
public int OnAttach(obj_id self) throws InterruptedException
{
setCondition(self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_INTERESTING);
setInvulnerable(self, true);
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
setName(self, "Inaldra");
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.npe_station_inaldra");
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 (npe_station_inaldra_condition_playerCompletedSecondQuest(player, npc))
{
npe_station_inaldra_action_facePlayer(player, npc);
string_id message = new string_id(c_stringFile, "s_97");
chat.chat(npc, player, message);
return SCRIPT_CONTINUE;
}
if (npe_station_inaldra_condition_playerOnMainQuest2(player, npc))
{
npe_station_inaldra_action_facePlayer(player, npc);
string_id message = new string_id(c_stringFile, "s_60");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_condition_main2Inaldra2(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_61");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 2);
npcStartConversation(player, npc, "npe_station_inaldra", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (npe_station_inaldra_condition_playerCompletedFirstQuest(player, npc))
{
npe_station_inaldra_action_facePlayer(player, npc);
string_id message = new string_id(c_stringFile, "s_51");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (!npe_station_inaldra_condition_main2Inaldra1(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (npe_station_inaldra_condition_main2Inaldra1(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_35");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_41");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 8);
npcStartConversation(player, npc, "npe_station_inaldra", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (npe_station_inaldra_condition_playerOnQuest(player, npc))
{
npe_station_inaldra_action_facePlayer(player, npc);
string_id message = new string_id(c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (!npe_station_inaldra_condition_playerOnSecondInaldraStep(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (npe_station_inaldra_condition_playerOnSecondInaldraStep(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_32");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_36");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 13);
npcStartConversation(player, npc, "npe_station_inaldra", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (npe_station_inaldra_condition_playeronFirstInaldraStep(player, npc))
{
npe_station_inaldra_action_facePlayer(player, npc);
string_id message = new string_id(c_stringFile, "s_71");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (npe_station_inaldra_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_73");
}
utils.setScriptVar(player, "conversation.npe_station_inaldra.branchId", 20);
npcStartConversation(player, npc, "npe_station_inaldra", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (npe_station_inaldra_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_98");
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("npe_station_inaldra"))
{
return SCRIPT_CONTINUE;
}
obj_id npc = self;
int branchId = utils.getIntScriptVar(player, "conversation.npe_station_inaldra.branchId");
if (branchId == 2 && npe_station_inaldra_handleBranch2(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 3 && npe_station_inaldra_handleBranch3(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 4 && npe_station_inaldra_handleBranch4(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 5 && npe_station_inaldra_handleBranch5(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 6 && npe_station_inaldra_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 8 && npe_station_inaldra_handleBranch8(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 10 && npe_station_inaldra_handleBranch10(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 11 && npe_station_inaldra_handleBranch11(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 13 && npe_station_inaldra_handleBranch13(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 15 && npe_station_inaldra_handleBranch15(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 16 && npe_station_inaldra_handleBranch16(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 17 && npe_station_inaldra_handleBranch17(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 18 && npe_station_inaldra_handleBranch18(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 20 && npe_station_inaldra_handleBranch20(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 21 && npe_station_inaldra_handleBranch21(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 22 && npe_station_inaldra_handleBranch22(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 23 && npe_station_inaldra_handleBranch23(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 24 && npe_station_inaldra_handleBranch24(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 25 && npe_station_inaldra_handleBranch25(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar(player, "conversation.npe_station_inaldra.branchId");
return SCRIPT_CONTINUE;
}
}