mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
775 lines
32 KiB
Java
Executable File
775 lines
32 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 ep3_etyyy_wrelaac extends script.base_script
|
|
{
|
|
public ep3_etyyy_wrelaac()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/ep3_etyyy_wrelaac";
|
|
public boolean ep3_etyyy_wrelaac_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_hasCompletedMadaQuests(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "ep3_hunt_wrelaac_proof_of_mada") && groundquests.hasCompletedQuest(player, "ep3_hunt_wrelaac_to_chrilooc"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_spokeToChrilooc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "ep3_hunt_wrelaac_to_chrilooc"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_hasProof(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.isTaskActive(player, "ep3_hunt_wrelaac_proof_of_mada", "wrelaac_presentProofToWrelaac"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_talkToChrilooc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.isQuestActive(player, "ep3_hunt_wrelaac_to_chrilooc"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_needsProof(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.isQuestActive(player, "ep3_hunt_wrelaac_proof_of_mada"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_guessedWrong(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return hasObjVar(player, "ep3Hunt.guessedWrong");
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_onMadasQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.isQuestActive(player, "ep3_hunt_mada_johnson_to_wrelaac"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_completedBrodyQuest(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return (groundquests.hasCompletedQuest(player, "ep3_hunt_johnson_brody_johnson"));
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_cannotSpeakWookiee(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return utils.canSpeakWookiee(player, npc);
|
|
}
|
|
public boolean ep3_etyyy_wrelaac_condition_suppliedProof(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return groundquests.hasCompletedQuest(player, "ep3_hunt_wrelaac_proof_of_mada") && !groundquests.isQuestActiveOrComplete(player, "ep3_hunt_wrelaac_to_chrilooc");
|
|
}
|
|
public void ep3_etyyy_wrelaac_action_wrongGuess(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
setObjVar(player, "ep3Hunt.guessedWrong", true);
|
|
}
|
|
public void ep3_etyyy_wrelaac_action_foundProof(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.sendSignal(player, "wrelaac_presentProofToWrelaac");
|
|
}
|
|
public void ep3_etyyy_wrelaac_action_goTalkToChrilooc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
groundquests.sendSignal(player, "mada_talkToWrelaac");
|
|
groundquests.grantQuest(player, "ep3_hunt_wrelaac_to_chrilooc");
|
|
}
|
|
public void ep3_etyyy_wrelaac_action_goGetProof(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
if (hasObjVar(player, "ep3Hunt.guessedWrong"))
|
|
{
|
|
removeObjVar(player, "ep3Hunt.guessedWrong");
|
|
}
|
|
groundquests.grantQuest(player, "ep3_hunt_wrelaac_proof_of_mada");
|
|
}
|
|
public void ep3_etyyy_wrelaac_action_thinkWookieeConfusion(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
utils.emoteWookieeConfusion(player, npc);
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_46"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_48");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_72"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_74");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_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_76");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 14);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_52"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_foundProof(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_54");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_72");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 13);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_56"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_58");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_72"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_74");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_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_76");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 14);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_62"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_goGetProof(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_64");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_68"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_70");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_72");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 13);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_88"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_wrongGuess(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_90");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_92"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_wrongGuess(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_94");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_96"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_wrongGuess(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_98");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_100"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_wrongGuess(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_102");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_104"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_106");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_72"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_74");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_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_76");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 14);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_76"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_78");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (ep3_etyyy_wrelaac_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_80");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_84");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 15);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int ep3_etyyy_wrelaac_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
|
{
|
|
if (response.equals("s_80"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_goTalkToChrilooc(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_82");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
if (response.equals("s_84"))
|
|
{
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_86");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
npcEndConversationWithMessage(player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|
|
return SCRIPT_DEFAULT;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if ((!isMob(self)) || (isPlayer(self)))
|
|
{
|
|
detachScript(self, "conversation.ep3_etyyy_wrelaac");
|
|
}
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
setInvulnerable(self, true);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException
|
|
{
|
|
int menu = menuInfo.addRootMenu(menu_info_types.CONVERSE_START, null);
|
|
menu_info_data menuInfoData = menuInfo.getMenuItemById(menu);
|
|
menuInfoData.setServerNotify(false);
|
|
setCondition(self, CONDITION_CONVERSABLE);
|
|
faceTo(self, player);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
|
{
|
|
clearCondition(self, CONDITION_CONVERSABLE);
|
|
detachScript(self, "conversation.ep3_etyyy_wrelaac");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException
|
|
{
|
|
Object[] objects = new Object[responses.length];
|
|
System.arraycopy(responses, 0, objects, 0, responses.length);
|
|
return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects);
|
|
}
|
|
public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException
|
|
{
|
|
obj_id npc = self;
|
|
if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_cannotSpeakWookiee(player, npc))
|
|
{
|
|
ep3_etyyy_wrelaac_action_thinkWookieeConfusion(player, npc);
|
|
string_id message = new string_id(c_stringFile, "s_37");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_completedBrodyQuest(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_40");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_hasCompletedMadaQuests(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_42");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_talkToChrilooc(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_44");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_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.ep3_etyyy_wrelaac.branchId", 4);
|
|
npcStartConversation(player, npc, "ep3_etyyy_wrelaac", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_suppliedProof(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_41");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_72");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 13);
|
|
npcStartConversation(player, npc, "ep3_etyyy_wrelaac", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_needsProof(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_50");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition_hasProof(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
if (hasResponse)
|
|
{
|
|
int responseIndex = 0;
|
|
string_id responses[] = new string_id[numberOfResponses];
|
|
if (hasResponse0)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_52");
|
|
}
|
|
if (hasResponse1)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_56");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 7);
|
|
npcStartConversation(player, npc, "ep3_etyyy_wrelaac", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_guessedWrong(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_60");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_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_62");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 10);
|
|
npcStartConversation(player, npc, "ep3_etyyy_wrelaac", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition_onMadasQuest(player, npc))
|
|
{
|
|
doAnimationAction(npc, "greet");
|
|
string_id message = new string_id(c_stringFile, "s_66");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse0 = true;
|
|
}
|
|
boolean hasResponse1 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse1 = true;
|
|
}
|
|
boolean hasResponse2 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse2 = true;
|
|
}
|
|
boolean hasResponse3 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse3 = true;
|
|
}
|
|
boolean hasResponse4 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse4 = true;
|
|
}
|
|
boolean hasResponse5 = false;
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
++numberOfResponses;
|
|
hasResponse = true;
|
|
hasResponse5 = 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_88");
|
|
}
|
|
if (hasResponse2)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_92");
|
|
}
|
|
if (hasResponse3)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_96");
|
|
}
|
|
if (hasResponse4)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_100");
|
|
}
|
|
if (hasResponse5)
|
|
{
|
|
responses[responseIndex++] = new string_id(c_stringFile, "s_104");
|
|
}
|
|
utils.setScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId", 12);
|
|
npcStartConversation(player, npc, "ep3_etyyy_wrelaac", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(npc, player, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (ep3_etyyy_wrelaac_condition__defaultCondition(player, npc))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_108");
|
|
chat.chat(npc, player, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException
|
|
{
|
|
if (!conversationId.equals("ep3_etyyy_wrelaac"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id npc = self;
|
|
int branchId = utils.getIntScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
if (branchId == 4 && ep3_etyyy_wrelaac_handleBranch4(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 6 && ep3_etyyy_wrelaac_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 7 && ep3_etyyy_wrelaac_handleBranch7(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 8 && ep3_etyyy_wrelaac_handleBranch8(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 10 && ep3_etyyy_wrelaac_handleBranch10(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 12 && ep3_etyyy_wrelaac_handleBranch12(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 13 && ep3_etyyy_wrelaac_handleBranch13(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 14 && ep3_etyyy_wrelaac_handleBranch14(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 15 && ep3_etyyy_wrelaac_handleBranch15(player, npc, response) == SCRIPT_CONTINUE)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
utils.removeScriptVar(player, "conversation.ep3_etyyy_wrelaac.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|