Files
dsrc/sku.0/sys.server/compiled/game/script/conversation/som_glyph_hunt.java
T
2018-06-07 00:32:29 +01:00

902 lines
38 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 som_glyph_hunt extends script.base_script
{
public som_glyph_hunt()
{
}
public static String c_stringFile = "conversation/som_glyph_hunt";
public boolean som_glyph_hunt_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
{
return true;
}
public boolean som_glyph_hunt_condition_onFirstTask(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "som_glyph_hunt", "glyph_hunt_four");
}
public boolean som_glyph_hunt_condition_completedFirstTask(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "som_glyph_hunt", "glyph_hunt_five");
}
public boolean som_glyph_hunt_condition_onSecondTask(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "som_glyph_hunt", "glyph_hunt_eight");
}
public boolean som_glyph_hunt_condition_completedSecondTask(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.isTaskActive(player, "som_glyph_hunt", "glyph_hunt_nine");
}
public boolean som_glyph_hunt_condition_completedMission(obj_id player, obj_id npc) throws InterruptedException
{
return groundquests.hasCompletedQuest(player, "som_glyph_hunt");
}
public void som_glyph_hunt_action_grantMission(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.grantQuest(player, "som_glyph_hunt");
}
public void som_glyph_hunt_action_sendFirstSignal(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "glyph_hunt_found");
}
public void som_glyph_hunt_action_sendLastSignal(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "glyph_hunt_finish");
}
public int som_glyph_hunt_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_39"))
{
doAnimationAction(player, "manipulate_medium");
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "rub_chin_thoughtful");
string_id message = new string_id(c_stringFile, "s_40");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_41");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 3);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_41"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_42");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_43");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 4);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_43"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "thank");
som_glyph_hunt_action_sendLastSignal(player, npc);
string_id message = new string_id(c_stringFile, "s_44");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_37"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_38");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_25"))
{
doAnimationAction(player, "manipulate_medium");
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "taken_aback");
string_id message = new string_id(c_stringFile, "s_26");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_27");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 9);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_27"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "pound_fist_palm");
string_id message = new string_id(c_stringFile, "s_28");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (som_glyph_hunt_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_29");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_35");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 10);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_29"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_30");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_33");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 11);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_35"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_46");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_33"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "shakefist");
som_glyph_hunt_action_sendFirstSignal(player, npc);
string_id message = new string_id(c_stringFile, "s_34");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_50"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_52");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_56"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "search");
string_id message = new string_id(c_stringFile, "s_58");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_60");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 17);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_60"))
{
doAnimationAction(player, "slow_down");
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "laugh_titter");
string_id message = new string_id(c_stringFile, "s_62");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (som_glyph_hunt_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_64");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_70");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 18);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_64"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_66");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_68");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 19);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_70"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_72");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_74");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 20);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_68"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "explain");
string_id message = new string_id(c_stringFile, "s_72");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_74");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 20);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_74"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_76");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (som_glyph_hunt_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_78");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_82");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 21);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int som_glyph_hunt_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_78"))
{
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod_head_multiple");
som_glyph_hunt_action_grantMission(player, npc);
string_id message = new string_id(c_stringFile, "s_80");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
npcEndConversationWithMessage(player, message);
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_82"))
{
doAnimationAction(player, "stop");
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod_head_multiple");
string_id message = new string_id(c_stringFile, "s_84");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.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.som_glyph_hunt");
}
setCondition(self, CONDITION_CONVERSABLE);
setInvulnerable(self, true);
setCondition(self, CONDITION_INTERESTING);
setName(self, "Pletus Croix");
return SCRIPT_CONTINUE;
}
public int OnAttach(obj_id self) throws InterruptedException
{
setCondition(self, CONDITION_CONVERSABLE);
setInvulnerable(self, true);
setCondition(self, CONDITION_INTERESTING);
setName(self, "Pletus Croix");
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.som_glyph_hunt");
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 (som_glyph_hunt_condition_completedMission(player, npc))
{
doAnimationAction(npc, "greet");
string_id message = new string_id(c_stringFile, "s_36");
chat.chat(npc, player, message);
return SCRIPT_CONTINUE;
}
if (som_glyph_hunt_condition_completedSecondTask(player, npc))
{
string_id message = new string_id(c_stringFile, "s_5");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_39");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 2);
npcStartConversation(player, npc, "som_glyph_hunt", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (som_glyph_hunt_condition_onSecondTask(player, npc))
{
string_id message = new string_id(c_stringFile, "s_13");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_37");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 6);
npcStartConversation(player, npc, "som_glyph_hunt", message, responses);
}
else
{
chat.chat(npc, player, message);
}
return SCRIPT_CONTINUE;
}
if (som_glyph_hunt_condition_completedFirstTask(player, npc))
{
string_id message = new string_id(c_stringFile, "s_17");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_25");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 8);
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
npcStartConversation(player, npc, "som_glyph_hunt", null, pp, responses);
}
else
{
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
chat.chat(npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
if (som_glyph_hunt_condition_onFirstTask(player, npc))
{
string_id message = new string_id(c_stringFile, "s_48");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
if (hasResponse)
{
int responseIndex = 0;
string_id responses[] = new string_id[numberOfResponses];
if (hasResponse0)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_50");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 14);
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
npcStartConversation(player, npc, "som_glyph_hunt", null, pp, responses);
}
else
{
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
chat.chat(npc, player, null, null, pp);
}
return SCRIPT_CONTINUE;
}
if (som_glyph_hunt_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "greet");
string_id message = new string_id(c_stringFile, "s_54");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (som_glyph_hunt_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_56");
}
utils.setScriptVar(player, "conversation.som_glyph_hunt.branchId", 16);
npcStartConversation(player, npc, "som_glyph_hunt", 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("som_glyph_hunt"))
{
return SCRIPT_CONTINUE;
}
obj_id npc = self;
int branchId = utils.getIntScriptVar(player, "conversation.som_glyph_hunt.branchId");
if (branchId == 2 && som_glyph_hunt_handleBranch2(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 3 && som_glyph_hunt_handleBranch3(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 4 && som_glyph_hunt_handleBranch4(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 6 && som_glyph_hunt_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 8 && som_glyph_hunt_handleBranch8(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 9 && som_glyph_hunt_handleBranch9(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 10 && som_glyph_hunt_handleBranch10(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 11 && som_glyph_hunt_handleBranch11(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 14 && som_glyph_hunt_handleBranch14(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 16 && som_glyph_hunt_handleBranch16(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 17 && som_glyph_hunt_handleBranch17(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 18 && som_glyph_hunt_handleBranch18(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 19 && som_glyph_hunt_handleBranch19(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 20 && som_glyph_hunt_handleBranch20(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 21 && som_glyph_hunt_handleBranch21(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar(player, "conversation.som_glyph_hunt.branchId");
return SCRIPT_CONTINUE;
}
}