mirror of
https://bitbucket.org/seefoe/dsrc.git
synced 2026-10-12 02:12:51 -04:00
765 lines
33 KiB
Java
765 lines
33 KiB
Java
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.space_quest;
|
|
import script.library.utils;
|
|
|
|
public class tatooine_bestinejobs_jasha extends script.base_script
|
|
{
|
|
public tatooine_bestinejobs_jasha()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/tatooine_bestinejobs_jasha";
|
|
public boolean tatooine_bestinejobs_jasha_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_questBestineComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_bestinejobs_bantha");
|
|
int questId2 = questGetQuestId("quest/tatooine_bestinejobs_rebsymp");
|
|
int questId3 = questGetQuestId("quest/tatooine_bestinejobs_xwing");
|
|
boolean OnTask = questIsQuestComplete(questId1, player) && questIsQuestComplete(questId2, player) && questIsQuestComplete(questId3, player);
|
|
return OnTask;
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_questBlocker(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestDisabled("tatooine_bestinejobs_bantha");
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_questBanthaComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "tatooine_bestinejobs_bantha");
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_questXwingComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "tatooine_bestinejobs_xwing");
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_questRebSympComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "tatooine_bestinejobs_rebsymp");
|
|
}
|
|
public boolean tatooine_bestinejobs_jasha_condition_onQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/tatooine_bestinejobs_bantha");
|
|
int questId2 = questGetQuestId("quest/tatooine_bestinejobs_rebsymp");
|
|
int questId3 = questGetQuestId("quest/tatooine_bestinejobs_xwing");
|
|
boolean OnTask = (questIsQuestActive(questId1, player)) || (questIsQuestActive(questId2, player)) || (questIsQuestActive(questId3, player));
|
|
return OnTask;
|
|
}
|
|
public void tatooine_bestinejobs_jasha_action_questXwingGranted(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "tatooine_bestinejobs_xwing");
|
|
}
|
|
public void tatooine_bestinejobs_jasha_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
public void tatooine_bestinejobs_jasha_action_questRebSympGranted(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "tatooine_bestinejobs_rebsymp");
|
|
}
|
|
public void tatooine_bestinejobs_jasha_action_questBanthaGranted(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "tatooine_bestinejobs_bantha");
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_36"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "shrug_shoulders");
|
|
string_id message = new string_id(c_stringFile, "s_43");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (!tatooine_bestinejobs_jasha_condition_questBanthaComplete(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (!tatooine_bestinejobs_jasha_condition_questRebSympComplete(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (!tatooine_bestinejobs_jasha_condition_questXwingComplete(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
boolean hasResponse3 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = 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_45");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_46");
|
|
}
|
|
if (hasResponse3)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_73");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 5);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_50"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_76");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_44"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_67");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_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_68");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_69");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 6);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_45"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_58");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (tatooine_bestinejobs_jasha_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_59");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_60");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_64");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 9);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_46"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_47");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (tatooine_bestinejobs_jasha_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_48");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_54");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_51");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 12);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_73"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "dismiss");
|
|
string_id message = new string_id(c_stringFile, "s_74");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_68"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questBanthaGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_72");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_69"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "explain");
|
|
string_id message = new string_id(c_stringFile, "s_70");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_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_71");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_75");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 8);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_71"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questBanthaGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_72");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_75"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_59"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questRebSympGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_62");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_60"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_61");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_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_66");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 11);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_64"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_65"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questRebSympGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_62");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_66"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_48"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questXwingGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_49");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_54"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "explain");
|
|
string_id message = new string_id(c_stringFile, "s_55");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_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_57");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 14);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_51"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int tatooine_bestinejobs_jasha_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_56"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
tatooine_bestinejobs_jasha_action_questXwingGranted(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_49");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_57"))
|
|
{
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_52");
|
|
utils.removeScriptVar(player, "conversation.tatooine_bestinejobs_jasha.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.tatooine_bestinejobs_jasha");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setCondition(self, CONDITION_INTERESTING);
|
|
setInvulnerable(self, true);
|
|
setName(self, "Captain Jasha");
|
|
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);
|
|
setName(self, "Captain Jasha");
|
|
ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL);
|
|
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_bestinejobs_jasha");
|
|
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_bestinejobs_jasha_condition_questBlocker(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_63");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (tatooine_bestinejobs_jasha_condition_questBestineComplete(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_10");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (tatooine_bestinejobs_jasha_condition_onQuest(player, npc))
|
|
{
|
|
doAnimationAction(npc, "dismiss");
|
|
tatooine_bestinejobs_jasha_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_7");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "dismiss");
|
|
tatooine_bestinejobs_jasha_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_34");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (tatooine_bestinejobs_jasha_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (tatooine_bestinejobs_jasha_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_36");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_50");
|
|
}
|
|
utils.setScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId", 4);
|
|
npcStartConversation(player, npc, "tatooine_bestinejobs_jasha", 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_bestinejobs_jasha"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id npc = self;
|
|
int branchId = utils.getIntScriptVar(player, "conversation.tatooine_bestinejobs_jasha.branchId");
|
|
if (branchId == 4 && tatooine_bestinejobs_jasha_handleBranch4(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 5 && tatooine_bestinejobs_jasha_handleBranch5(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 6 && tatooine_bestinejobs_jasha_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 8 && tatooine_bestinejobs_jasha_handleBranch8(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 9 && tatooine_bestinejobs_jasha_handleBranch9(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 11 && tatooine_bestinejobs_jasha_handleBranch11(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 12 && tatooine_bestinejobs_jasha_handleBranch12(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 14 && tatooine_bestinejobs_jasha_handleBranch14(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_bestinejobs_jasha.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|