mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
1116 lines
49 KiB
Java
Executable File
1116 lines
49 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 legacy_button_barrezz extends script.base_script
|
|
{
|
|
public legacy_button_barrezz()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/legacy_button_barrezz";
|
|
public boolean legacy_button_barrezz_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_onButtonImp(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/legacy_button_imp_pt2");
|
|
boolean OnTask = hasObjVar(player, "legacy.faction.imperialPath");
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_onButtonReb(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
boolean OnTask = hasObjVar(player, "legacy.faction.rebelPath");
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failKickImp(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
boolean hasCompleted = false;
|
|
if (groundquests.isQuestActiveOrComplete(player, "naboo_kadaraa_tipping_the_balance_1"))
|
|
{
|
|
hasCompleted = true;
|
|
}
|
|
if (groundquests.hasCompletedQuest(player, "quest/legacy_naboo_kick_imp"))
|
|
{
|
|
hasCompleted = true;
|
|
}
|
|
return hasCompleted;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failValarian(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "quest/legacy_button_jawatracks_pt3") || groundquests.hasCompletedQuest(player, "quest/legacy_button_jawatracks_pt3_v2")) && (!groundquests.isQuestActiveOrComplete(player, "quest/legacy_button_valarian") && !groundquests.isQuestActiveOrComplete(player, "quest/legacy_button_valarian_v2"));
|
|
}
|
|
public boolean legacy_button_barrezz_condition_questButtonComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/legacy_button_imp_pt2");
|
|
boolean OnTask = questIsQuestComplete(questId1, player);
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failTosche(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/legacy_button_start");
|
|
int questId2 = questGetQuestId("quest/legacy_button_jawatracks");
|
|
boolean OnTask = (questIsQuestComplete(questId1, player)) && (!(questIsQuestActive(questId2, player)) && !(questIsQuestComplete(questId2, player)));
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failDarklighter(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return ((groundquests.hasCompletedQuest(player, "legacy_button_valarian") || groundquests.hasCompletedQuest(player, "quest/legacy_button_valarian_v2")) && !groundquests.isQuestActiveOrComplete(player, "legacy_button_darklighter"));
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failSlicer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/legacy_button_darklighter");
|
|
int questId2 = questGetQuestId("quest/legacy_button_valarian");
|
|
int questId3 = questGetQuestId("quest/legacy_button_jawatracks_pt3");
|
|
int questId4 = questGetQuestId("quest/legacy_button_imp_pt2");
|
|
boolean OnTask = (questIsQuestComplete(questId1, player)) && (questIsQuestComplete(questId2, player)) && (questIsQuestComplete(questId3, player)) && (!(questIsQuestActive(questId4, player)) && !(questIsQuestComplete(questId4, player)));
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_finishTogether(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "legacy_together") || groundquests.hasCompletedQuest(player, "legacy_together_2"));
|
|
}
|
|
public boolean legacy_button_barrezz_condition_failWatto(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
int questId1 = questGetQuestId("quest/legacy_button_imp_pt2");
|
|
int questId2 = questGetQuestId("quest/legacy_watto_pointer");
|
|
boolean OnTask = (questIsQuestComplete(questId1, player)) && (!(questIsQuestActive(questId2, player)) && !(questIsQuestComplete(questId2, player)));
|
|
return OnTask;
|
|
}
|
|
public boolean legacy_button_barrezz_condition_onButtonStart(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.isQuestActiveOrComplete(player, "quest/legacy_button_start");
|
|
}
|
|
public void legacy_button_barrezz_action_reGrantDarklighter(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_darklighter");
|
|
}
|
|
public void legacy_button_barrezz_action_reGrantKick(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_naboo_kick_imp");
|
|
}
|
|
public void legacy_button_barrezz_action_facePlayer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
faceTo(npc, player);
|
|
}
|
|
public void legacy_button_barrezz_action_grantSlicer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_imp_pt2");
|
|
}
|
|
public void legacy_button_barrezz_action_signalTosche(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_jawatracks");
|
|
setObjVar(player, "legacy.faction.imperialPath", 1);
|
|
}
|
|
public void legacy_button_barrezz_action_grantWatto(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_watto_pointer");
|
|
}
|
|
public void legacy_button_barrezz_action_signalGotoComplete(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.sendSignal(player, "legacy_button_start_launch_e3");
|
|
}
|
|
public void legacy_button_barrezz_action_regrantTocshe(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_jawatracks");
|
|
}
|
|
public void legacy_button_barrezz_action_reGrantValarian(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.grantQuest(player, "legacy_button_valarian_v2");
|
|
}
|
|
public int legacy_button_barrezz_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_73"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_75");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_76"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "shake_head_disgust");
|
|
legacy_button_barrezz_action_reGrantKick(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_78");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_88"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_grantWatto(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_89");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_54"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_55");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_58"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_regrantTocshe(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_85");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_59"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_reGrantValarian(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_86");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_60"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_reGrantDarklighter(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_87");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_61"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_grantSlicer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_62");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_115"))
|
|
{
|
|
legacy_button_barrezz_action_signalGotoComplete(player, npc);
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "nod");
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_119");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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_26");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 14);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_116"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "adjust");
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_117");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_26"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_28");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_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_30");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_69");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 15);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_30"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_32");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
boolean hasResponse3 = false;
|
|
if (legacy_button_barrezz_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_34");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_42");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_94");
|
|
}
|
|
if (hasResponse3)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_65");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 16);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_69"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_72");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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_79");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 23);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_34"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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.legacy_button_barrezz.branchId", 17);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_42"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_43");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (legacy_button_barrezz_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_44");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_46");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_56");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 19);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_94"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "point_forward");
|
|
string_id message = new string_id(c_stringFile, "s_95");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_65"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_67");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_77"))
|
|
{
|
|
legacy_button_barrezz_action_signalGotoComplete(player, npc);
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_signalTosche(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_81");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_44"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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.legacy_button_barrezz.branchId", 17);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_46"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_48");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_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_50");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_52");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 20);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_56"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_67");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_50"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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.legacy_button_barrezz.branchId", 17);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_52"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_67");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_79"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
doAnimationAction(npc, "wave_finger_warning");
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_82");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_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_84");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_91");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 24);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int legacy_button_barrezz_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_84"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_36");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_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.legacy_button_barrezz.branchId", 17);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_91"))
|
|
{
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_67");
|
|
utils.removeScriptVar(player, "conversation.legacy_button_barrezz.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.legacy_button_barrezz");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setCondition(self, CONDITION_INTERESTING);
|
|
setInvulnerable(self, true);
|
|
setName(self, "Commander Barrezz");
|
|
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, "Commander Barrezz");
|
|
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.legacy_button_barrezz");
|
|
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 (legacy_button_barrezz_condition_onButtonReb(player, npc))
|
|
{
|
|
doAnimationAction(npc, "threaten");
|
|
string_id message = new string_id(c_stringFile, "s_145");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (legacy_button_barrezz_condition_finishTogether(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_71");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_condition_failKickImp(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_73");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_76");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 2);
|
|
npcStartConversation(player, npc, "legacy_button_barrezz", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (legacy_button_barrezz_condition_questButtonComplete(player, npc))
|
|
{
|
|
doAnimationAction(npc, "threaten");
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_101");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition_failWatto(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_88");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 5);
|
|
npcStartConversation(player, npc, "legacy_button_barrezz", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (legacy_button_barrezz_condition_onButtonImp(player, npc))
|
|
{
|
|
doAnimationAction(npc, "dismiss");
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_144");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_condition_failTosche(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (legacy_button_barrezz_condition_failValarian(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
boolean hasResponse3 = false;
|
|
if (legacy_button_barrezz_condition_failDarklighter(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
boolean hasResponse4 = false;
|
|
if (legacy_button_barrezz_condition_failSlicer(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_54");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_58");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_59");
|
|
}
|
|
if (hasResponse3)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_60");
|
|
}
|
|
if (hasResponse4)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_61");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 7);
|
|
npcStartConversation(player, npc, "legacy_button_barrezz", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (legacy_button_barrezz_condition__defaultCondition(player, npc))
|
|
{
|
|
legacy_button_barrezz_action_facePlayer(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_805");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (legacy_button_barrezz_condition_onButtonStart(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (legacy_button_barrezz_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_115");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_116");
|
|
}
|
|
utils.setScriptVar(player, "conversation.legacy_button_barrezz.branchId", 13);
|
|
npcStartConversation(player, npc, "legacy_button_barrezz", 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("legacy_button_barrezz"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id npc = self;
|
|
int branchId = utils.getIntScriptVar(player, "conversation.legacy_button_barrezz.branchId");
|
|
if (branchId == 2 && legacy_button_barrezz_handleBranch2(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 5 && legacy_button_barrezz_handleBranch5(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 7 && legacy_button_barrezz_handleBranch7(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 13 && legacy_button_barrezz_handleBranch13(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 14 && legacy_button_barrezz_handleBranch14(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 15 && legacy_button_barrezz_handleBranch15(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 16 && legacy_button_barrezz_handleBranch16(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 17 && legacy_button_barrezz_handleBranch17(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 19 && legacy_button_barrezz_handleBranch19(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 20 && legacy_button_barrezz_handleBranch20(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 23 && legacy_button_barrezz_handleBranch23(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 24 && legacy_button_barrezz_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.legacy_button_barrezz.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|