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

667 lines
28 KiB
Java
Executable File

package script.conversation;
import script.*;
import script.library.ai_lib;
import script.library.chat;
import script.library.groundquests;
import script.library.utils;
public class c_newbie_entertainer extends script.base_script
{
public c_newbie_entertainer()
{
}
public static String c_stringFile = "conversation/c_newbie_entertainer";
public boolean c_newbie_entertainer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
{
return true;
}
public boolean c_newbie_entertainer_condition_onCantinaStep(obj_id player, obj_id npc) throws InterruptedException
{
int questId1 = questGetQuestId("quest/c_newbie_quest3");
int cantinastep = groundquests.getTaskId(questId1, "cantinastep");
return questIsTaskActive(questId1, cantinastep, player);
}
public boolean c_newbie_entertainer_condition_afterPerform(obj_id player, obj_id npc) throws InterruptedException
{
int questId1 = questGetQuestId("quest/c_newbie_quest3");
int cantinareturn = groundquests.getTaskId(questId1, "cantinareturn");
return questIsTaskActive(questId1, cantinareturn, player);
}
public void c_newbie_entertainer_action_forwardQuest(obj_id player, obj_id npc) throws InterruptedException
{
groundquests.sendSignal(player, "c_newbie_cantinastep");
}
public void c_newbie_entertainer_action_dance(obj_id player, obj_id npc) throws InterruptedException
{
ai_lib.setMood(npc, "themepark_oola");
dictionary webster = new dictionary();
webster.put("npc", npc);
messageTo(npc, "stopDancing", webster, 9, false);
}
public void c_newbie_entertainer_action_faceplayer(obj_id player, obj_id npc) throws InterruptedException
{
faceTo(npc, player);
}
public int c_newbie_entertainer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_427"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_430");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_434");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 2);
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
npcSpeak(player, pp);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
chat.chat(npc, player, pp);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_482"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
c_newbie_entertainer_action_dance(player, npc);
string_id message = new string_id(c_stringFile, "s_486");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_condition_onCantinaStep(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (!c_newbie_entertainer_condition_onCantinaStep(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_490");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_494");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 10);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_509"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "applause_excited");
string_id message = new string_id(c_stringFile, "s_511");
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_434"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_438");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (c_newbie_entertainer_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_442");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_466");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 3);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_442"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "nod");
string_id message = new string_id(c_stringFile, "s_446");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_450");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 4);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_466"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
doAnimationAction(npc, "laugh");
string_id message = new string_id(c_stringFile, "s_470");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_474");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 8);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_450"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_454");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_500");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 5);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_500"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_502");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_504");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 6);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_504"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
c_newbie_entertainer_action_forwardQuest(player, npc);
string_id message = new string_id(c_stringFile, "s_506");
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_474"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_478");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_500");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 5);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_500"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_502");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_504");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 6);
npcSpeak(player, message);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int c_newbie_entertainer_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException
{
if (response.equals("s_490"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_430");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_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_434");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 2);
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
npcSpeak(player, pp);
npcSetConversationResponses(player, responses);
}
else
{
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
prose_package pp = new prose_package();
pp.stringId = message;
pp.actor.set(player);
pp.target.set(npc);
chat.chat(npc, player, pp);
npcEndConversation(player);
}
return SCRIPT_CONTINUE;
}
}
if (response.equals("s_494"))
{
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
string_id message = new string_id(c_stringFile, "s_498");
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
chat.chat(npc, player, message);
npcEndConversation(player);
return SCRIPT_CONTINUE;
}
}
return SCRIPT_DEFAULT;
}
public int OnInitialize(obj_id self) throws InterruptedException
{
if ((!isMob(self)) || (isPlayer(self)))
{
detachScript(self, "conversation.c_newbie_entertainer");
}
setCondition(self, CONDITION_CONVERSABLE);
setCondition(self, CONDITION_INTERESTING);
setInvulnerable(self, true);
setName(self, "Allura");
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, "Allura");
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.c_newbie_entertainer");
return SCRIPT_CONTINUE;
}
public int stopDancing(obj_id self, dictionary params) throws InterruptedException
{
obj_id npc = params.getObjId("npc");
ai_lib.setMood(npc, "default");
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 (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
c_newbie_entertainer_action_faceplayer(player, npc);
string_id message = new string_id(c_stringFile, "s_425");
int numberOfResponses = 0;
boolean hasResponse = false;
boolean hasResponse0 = false;
if (c_newbie_entertainer_condition_onCantinaStep(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse0 = true;
}
boolean hasResponse1 = false;
if (c_newbie_entertainer_condition__defaultCondition(player, npc))
{
++numberOfResponses;
hasResponse = true;
hasResponse1 = true;
}
boolean hasResponse2 = false;
if (c_newbie_entertainer_condition_afterPerform(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_427");
}
if (hasResponse1)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_482");
}
if (hasResponse2)
{
responses[responseIndex++] = new string_id(c_stringFile, "s_509");
}
utils.setScriptVar(player, "conversation.c_newbie_entertainer.branchId", 1);
npcStartConversation(player, npc, "c_newbie_entertainer", 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("c_newbie_entertainer"))
{
return SCRIPT_CONTINUE;
}
obj_id npc = self;
int branchId = utils.getIntScriptVar(player, "conversation.c_newbie_entertainer.branchId");
if (branchId == 1 && c_newbie_entertainer_handleBranch1(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 2 && c_newbie_entertainer_handleBranch2(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 3 && c_newbie_entertainer_handleBranch3(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 4 && c_newbie_entertainer_handleBranch4(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 5 && c_newbie_entertainer_handleBranch5(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 6 && c_newbie_entertainer_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 8 && c_newbie_entertainer_handleBranch8(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 9 && c_newbie_entertainer_handleBranch9(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
if (branchId == 10 && c_newbie_entertainer_handleBranch10(player, npc, response) == SCRIPT_CONTINUE)
{
return SCRIPT_CONTINUE;
}
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
utils.removeScriptVar(player, "conversation.c_newbie_entertainer.branchId");
return SCRIPT_CONTINUE;
}
}