From 578cd5eb1593ee8d0771666866153524b5f2dfb4 Mon Sep 17 00:00:00 2001 From: Cekis Date: Wed, 20 Apr 2016 07:59:38 +0100 Subject: [PATCH] Audited Aurilia NPC conversation scripts. --- .../aurilia_buff_vendor_convo.java | 77 +-- .../conversation/aurilia_chief_engineer.java | 127 ++--- .../conversation/aurilia_junk_dealer.java | 151 ++---- .../conversation/aurilia_mellichae.java | 79 +-- .../aurilia_nightsister_prisoner.java | 132 ++--- .../script/conversation/aurilia_quharek.java | 106 +--- .../script/conversation/aurilia_rohak.java | 510 ++++-------------- .../conversation/aurilia_sarguillo.java | 124 ++--- 8 files changed, 276 insertions(+), 1030 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_buff_vendor_convo.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_chief_engineer.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_junk_dealer.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_mellichae.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_nightsister_prisoner.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_quharek.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_rohak.java mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/conversation/aurilia_sarguillo.java diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_buff_vendor_convo.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_buff_vendor_convo.java old mode 100644 new mode 100755 index f42e151cb..94fb2507d --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_buff_vendor_convo.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_buff_vendor_convo.java @@ -1,85 +1,46 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - +import script.dictionary; import script.library.ai_lib; import script.library.chat; -import script.library.utils; +import script.obj_id; +import script.string_id; -public class aurilia_buff_vendor_convo extends script.base_script +public class aurilia_buff_vendor_convo extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_buff_vendor_convo"; + public String c_stringFile = "conversation/aurilia_buff_vendor_convo"; + public aurilia_buff_vendor_convo() { + super.scriptName = "aurilia_buff_vendor_convo"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_buff_vendor_convo"; - public boolean aurilia_buff_vendor_convo_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public void aurilia_buff_vendor_convo_action_showTokenVendorUI(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_buff_vendor_convo_action_showTokenVendorUI(obj_id player, obj_id npc) throws InterruptedException { dictionary d = new dictionary(); d.put("player", player); messageTo(npc, "showInventorySUI", d, 0, false); - return; } public int OnInitialize(obj_id self) throws InterruptedException { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_buff_vendor_convo"); - } - setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_SPACE_INTERESTING); - return SCRIPT_CONTINUE; + return super.OnInitialize(self); } public int OnAttach(obj_id self) throws InterruptedException { - setCondition(self, CONDITION_CONVERSABLE); setCondition(self, CONDITION_SPACE_INTERESTING); - 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.aurilia_buff_vendor_convo"); - 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); + return super.OnAttach(self); } public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException { - obj_id npc = self; - if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_buff_vendor_convo_condition__defaultCondition(player, npc)) - { - aurilia_buff_vendor_convo_action_showTokenVendorUI(player, npc); - string_id message = new string_id(c_stringFile, "s_4"); - chat.chat(npc, player, message); - return SCRIPT_CONTINUE; - } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + aurilia_buff_vendor_convo_action_showTokenVendorUI(player, self); + chat.chat(self, player, new string_id(c_stringFile, "s_4")); return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException @@ -88,10 +49,6 @@ public class aurilia_buff_vendor_convo extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_buff_vendor_convo.branchId"); - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_buff_vendor_convo.branchId"); - return SCRIPT_CONTINUE; + return super.OnNpcConversationResponse(self, conversationId, player, response); } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_chief_engineer.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_chief_engineer.java old mode 100644 new mode 100755 index 1a50c0997..369c35f8e --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_chief_engineer.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_chief_engineer.java @@ -1,119 +1,55 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; import script.library.groundquests; import script.library.utils; +import script.*; -public class aurilia_chief_engineer extends script.base_script +public class aurilia_chief_engineer extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_chief_engineer"; + public String c_stringFile = "conversation/aurilia_chief_engineer"; + public aurilia_chief_engineer() { + super.scriptName = "aurilia_chief_engineer"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_chief_engineer"; - public boolean aurilia_chief_engineer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public boolean aurilia_chief_engineer_condition_axkva_min_intro_01(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_chief_engineer_condition_axkva_min_intro_01(obj_id player, obj_id npc) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_01"); } - public int aurilia_chief_engineer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_chief_engineer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_5")) { - if (aurilia_chief_engineer_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "nervous"); - string_id message = new string_id(c_stringFile, "s_6"); - utils.removeScriptVar(player, "conversation.aurilia_chief_engineer.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + doAnimationAction(npc, "nervous"); + utils.removeScriptVar(player, "conversation.aurilia_chief_engineer.branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_6")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_chief_engineer"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_chief_engineer"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_chief_engineer_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "embarrassed"); - string_id message = new string_id(c_stringFile, "s_4"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_chief_engineer_condition_axkva_min_intro_01(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_5"); - } - utils.setScriptVar(player, "conversation.aurilia_chief_engineer.branchId", 1); - npcStartConversation(player, npc, "aurilia_chief_engineer", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; - } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + doAnimationAction(self, "embarrassed"); + string_id message = new string_id(c_stringFile, "s_4"); + if (aurilia_chief_engineer_condition_axkva_min_intro_01(player, self)) + { + string_id responses[] = {new string_id(c_stringFile, "s_5")}; + utils.setScriptVar(player, conversation + ".branchId", 1); + npcStartConversation(player, self, "aurilia_chief_engineer", message, responses); + } + else + { + chat.chat(self, player, message); + } return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException @@ -122,14 +58,13 @@ public class aurilia_chief_engineer extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_chief_engineer.branchId"); - if (branchId == 1 && aurilia_chief_engineer_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_chief_engineer_handleBranch1(player, self, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_chief_engineer.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_junk_dealer.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_junk_dealer.java old mode 100644 new mode 100755 index 15f513389..5aa994cd8 --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_junk_dealer.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_junk_dealer.java @@ -1,150 +1,68 @@ package script.conversation; import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; import script.library.smuggler; import script.library.utils; -public class aurilia_junk_dealer extends script.base_script +public class aurilia_junk_dealer extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_junk_dealer"; + public String c_stringFile = "conversation/aurilia_junk_dealer"; public aurilia_junk_dealer() { + super.scriptName = "aurilia_junk_dealer"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_junk_dealer"; - public boolean aurilia_junk_dealer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public boolean aurilia_junk_dealer_condition_check_inv(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_junk_dealer_condition_check_inv(obj_id player, obj_id npc) throws InterruptedException { return smuggler.checkInventory(player, npc); } - public void aurilia_junk_dealer_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_junk_dealer_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException { dictionary params = new dictionary(); params.put("player", player); messageTo(npc, "startDealing", params, 1.0f, false); } - public void aurilia_junk_dealer_action_face_to(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - public int aurilia_junk_dealer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_junk_dealer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_c86eba88")) { - if (aurilia_junk_dealer_condition__defaultCondition(player, npc)) - { - aurilia_junk_dealer_action_start_dealing(player, npc); - string_id message = new string_id(c_stringFile, "s_24f30320"); - utils.removeScriptVar(player, "conversation.aurilia_junk_dealer.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + aurilia_junk_dealer_action_start_dealing(player, npc); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_24f30320")); + return SCRIPT_CONTINUE; } if (response.equals("s_370a03c")) { - if (aurilia_junk_dealer_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_df5bd64e"); - utils.removeScriptVar(player, "conversation.aurilia_junk_dealer.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_df5bd64e")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_junk_dealer"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_junk_dealer"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_junk_dealer_condition__defaultCondition(player, npc)) - { - aurilia_junk_dealer_action_face_to(player, npc); - string_id message = new string_id(c_stringFile, "s_3c06418f"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_junk_dealer_condition_check_inv(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - boolean hasResponse1 = false; - if (aurilia_junk_dealer_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_c86eba88"); - } - if (hasResponse1) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_370a03c"); - } - utils.setScriptVar(player, "conversation.aurilia_junk_dealer.branchId", 1); - npcStartConversation(player, npc, "aurilia_junk_dealer", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; + faceTo(self, player); + string_id responses[]; + if (aurilia_junk_dealer_condition_check_inv(player, self)) + { + responses = new string_id[2]; + responses[0] = new string_id(c_stringFile, "s_c86eba88"); + responses[1] = new string_id(c_stringFile, "s_370a03c"); + } + else { + responses = new string_id[1]; + responses[0] = new string_id(c_stringFile, "s_370a03c"); } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + utils.setScriptVar(player, conversation + ".branchId", 1); + npcStartConversation(player, self, scriptName, new string_id(c_stringFile, "s_3c06418f"), responses); return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException @@ -153,14 +71,13 @@ public class aurilia_junk_dealer extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_junk_dealer.branchId"); - if (branchId == 1 && aurilia_junk_dealer_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_junk_dealer_handleBranch1(player, self, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_junk_dealer.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_mellichae.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_mellichae.java old mode 100644 new mode 100755 index 0739fb7a9..25d6f068f --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_mellichae.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_mellichae.java @@ -1,88 +1,37 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; -import script.library.utils; +import script.obj_id; +import script.string_id; -public class aurilia_mellichae extends script.base_script +public class aurilia_mellichae extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_mellichae"; + public String c_stringFile = "conversation/aurilia_mellichae"; + public aurilia_mellichae() { - } - public static String c_stringFile = "conversation/aurilia_mellichae"; - public boolean aurilia_mellichae_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_mellichae"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_mellichae"); - 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); + super.scriptName = "aurilia_mellichae"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException { - obj_id npc = self; - if (ai_lib.isInCombat(npc) || ai_lib.isInCombat(player)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_mellichae_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "standing_raise_fist"); - string_id message = new string_id(c_stringFile, "s_4"); - chat.chat(npc, player, message); - return SCRIPT_CONTINUE; - } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + doAnimationAction(self, "standing_raise_fist"); + chat.chat(self, player, new string_id(c_stringFile, "s_4")); return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException { - if (!conversationId.equals("aurilia_mellichae")) + if (!conversationId.equals(scriptName)) { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_mellichae.branchId"); - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_mellichae.branchId"); - return SCRIPT_CONTINUE; + return super.OnNpcConversationResponse(self, conversationId, player, response); } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_nightsister_prisoner.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_nightsister_prisoner.java old mode 100644 new mode 100755 index 55731e139..cb7b9c9a9 --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_nightsister_prisoner.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_nightsister_prisoner.java @@ -1,125 +1,60 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; -import script.library.conversation; import script.library.groundquests; import script.library.utils; +import script.*; -public class aurilia_nightsister_prisoner extends script.base_script +public class aurilia_nightsister_prisoner extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_nightsister_prisoner"; + public String c_stringFile = "conversation/aurilia_nightsister_prisoner"; public aurilia_nightsister_prisoner() { + super.scriptName = "aurilia_nightsister_prisoner"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_nightsister_prisoner"; - public boolean aurilia_nightsister_prisoner_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public boolean aurilia_nightsister_prisoner_condition_onAxkvaMinQuest(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_nightsister_prisoner_condition_onAxkvaMinQuest(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_01"); } - public void aurilia_nightsister_prisoner_action_axkvaMinSignal(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_nightsister_prisoner_action_axkvaMinSignal(obj_id player) throws InterruptedException { groundquests.sendSignal(player, "axkva_min_intro_01"); } - public int aurilia_nightsister_prisoner_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_nightsister_prisoner_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_7")) { - if (aurilia_nightsister_prisoner_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "scared"); - aurilia_nightsister_prisoner_action_axkvaMinSignal(player, npc); - string_id message = new string_id(c_stringFile, "s_9"); - utils.removeScriptVar(player, "conversation.aurilia_nightsister_prisoner.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + doAnimationAction(npc, "scared"); + aurilia_nightsister_prisoner_action_axkvaMinSignal(player); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_9")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_nightsister_prisoner"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_nightsister_prisoner"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_nightsister_prisoner_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "scare"); - string_id message = new string_id(c_stringFile, "s_6"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_nightsister_prisoner_condition_onAxkvaMinQuest(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_7"); - } - utils.setScriptVar(player, "conversation.aurilia_nightsister_prisoner.branchId", 1); - npcStartConversation(player, npc, "aurilia_nightsister_prisoner", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; - } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + doAnimationAction(self, "scare"); + string_id message = new string_id(c_stringFile, "s_6"); + if (aurilia_nightsister_prisoner_condition_onAxkvaMinQuest(player)) + { + string_id responses[] = new string_id[1]; + responses[0] = new string_id(c_stringFile, "s_7"); + utils.setScriptVar(player, conversation + ".branchId", 1); + npcStartConversation(player, self, scriptName, message, responses); + } + else + { + chat.chat(self, player, message); + } return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException @@ -128,14 +63,13 @@ public class aurilia_nightsister_prisoner extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_nightsister_prisoner.branchId"); - if (branchId == 1 && aurilia_nightsister_prisoner_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_nightsister_prisoner_handleBranch1(player, self, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_nightsister_prisoner.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_quharek.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_quharek.java old mode 100644 new mode 100755 index ddbac40f2..92f0d83aa --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_quharek.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_quharek.java @@ -1,118 +1,67 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; import script.library.groundquests; import script.library.utils; +import script.*; -public class aurilia_quharek extends script.base_script +public class aurilia_quharek extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_quharek"; + public static String c_stringFile = "conversation/aurilia_quharek"; + public aurilia_quharek() { + super.scriptName = "aurilia_quharek"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_quharek"; - public boolean aurilia_quharek_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_quharek_condition__defaultCondition() throws InterruptedException { return true; } - public boolean aurilia_quharek_condition_axkva_min_intro_01(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_quharek_condition_axkva_min_intro_01(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_01"); } - public int aurilia_quharek_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_quharek_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_6")) { - if (aurilia_quharek_condition__defaultCondition(player, npc)) + if (aurilia_quharek_condition__defaultCondition()) { doAnimationAction(npc, "laugh"); - string_id message = new string_id(c_stringFile, "s_8"); - utils.removeScriptVar(player, "conversation.aurilia_quharek.branchId"); - npcEndConversationWithMessage(player, message); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_8")); return SCRIPT_CONTINUE; } } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_quharek"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_quharek"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_quharek_condition__defaultCondition(player, npc)) + if (aurilia_quharek_condition__defaultCondition()) { string_id message = new string_id(c_stringFile, "s_4"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_quharek_condition_axkva_min_intro_01(player, npc)) + if (aurilia_quharek_condition_axkva_min_intro_01(player)) { - ++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_6"); - } - utils.setScriptVar(player, "conversation.aurilia_quharek.branchId", 1); - npcStartConversation(player, npc, "aurilia_quharek", message, responses); + string_id responses[] = new string_id[1]; + responses[0] = new string_id(c_stringFile, "s_6"); + utils.setScriptVar(player, conversation + ".branchId", 1); + npcStartConversation(player, self, "aurilia_quharek", new string_id(c_stringFile, "s_4"), responses); } else { - chat.chat(npc, player, message); + chat.chat(self, player, message); } return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + chat.chat(self, "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 @@ -121,14 +70,13 @@ public class aurilia_quharek extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_quharek.branchId"); - if (branchId == 1 && aurilia_quharek_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_quharek_handleBranch1(player, self, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_quharek.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_rohak.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_rohak.java old mode 100644 new mode 100755 index dfa75be23..d36453544 --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_rohak.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_rohak.java @@ -1,521 +1,192 @@ package script.conversation; +import script.library.*; import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; -import script.library.ai_lib; -import script.library.chat; -import script.library.groundquests; -import script.library.prose; -import script.library.static_item; -import script.library.utils; - -public class aurilia_rohak extends script.base_script +public class aurilia_rohak extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_rohak"; + public String c_stringFile = "conversation/aurilia_rohak"; + public aurilia_rohak() { + super.scriptName = "aurilia_rohak"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_rohak"; - public boolean aurilia_rohak_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public boolean aurilia_rohak_condition_axkva_min_intro_01(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_rohak_condition_axkva_min_intro_01(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_01"); } - public boolean aurilia_rohak_condition_axkva_min_intro_02(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_rohak_condition_axkva_min_intro_02(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_02"); } - public boolean aurilia_rohak_condition_axkva_min_intro_04(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_rohak_condition_axkva_min_intro_04(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_04"); } - public boolean aurilia_rohak_condition_axkva_min_intro_06(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_rohak_condition_axkva_min_intro_06(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_06"); } - public boolean aurilia_rohak_condition_notCompletedTokenBox(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_rohak_condition_notCompletedTokenBox(obj_id player) throws InterruptedException { return !groundquests.isQuestActiveOrComplete(player, "rohak_token_box"); } - public void aurilia_rohak_action_axkva_min_intro_02_signal(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_rohak_action_axkva_min_intro_02_signal(obj_id player) throws InterruptedException { groundquests.sendSignal(player, "axkva_min_intro_02"); } - public void aurilia_rohak_action_axkva_min_intro_04_signal(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_rohak_action_axkva_min_intro_04_signal(obj_id player) throws InterruptedException { groundquests.sendSignal(player, "axkva_min_intro_04"); } - public void aurilia_rohak_action_axkva_min_intro_06_signal(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_rohak_action_axkva_min_intro_06_signal(obj_id player) throws InterruptedException { String axkvaMinShardsString = "item_axkva_min_shards_04_01"; obj_id inv = getObjectInSlot(player, "inventory"); if (isIdValid(inv)) { obj_id axkvaMinShard = static_item.createNewItemFunction(axkvaMinShardsString, inv); - string_id message = new string_id("quest/ground/system_message", "placed_in_inventory_plural"); - string_id name = getNameStringId(axkvaMinShard); - prose_package pp = prose.getPackage(message, player, player); - prose.setTO(pp, name); + prose_package pp = prose.getPackage(new string_id("quest/ground/system_message", "placed_in_inventory_plural"), player, player); + prose.setTO(pp, getNameStringId(axkvaMinShard)); sendSystemMessageProse(player, pp); groundquests.sendSignal(player, "axkva_min_intro_06"); } - return; } - public void aurilia_rohak_action_giveTokenBoxQuest(obj_id player, obj_id npc) throws InterruptedException + private void aurilia_rohak_action_giveTokenBoxQuest(obj_id player) throws InterruptedException { groundquests.grantQuest(player, "rohak_token_box"); } - public int aurilia_rohak_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch1(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_25")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_27"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_27")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch3(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_32")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_34"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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_36"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 4); - npcSpeak(player, message); - npcSetConversationResponses(player, responses); - } - else - { - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - } - return SCRIPT_CONTINUE; - } + return craft_response(new String[] {"s_34", "s_36"}, 4, player); } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch4(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_36")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_38"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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_40"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 5); - npcSpeak(player, message); - npcSetConversationResponses(player, responses); - } - else - { - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - } - return SCRIPT_CONTINUE; - } + return craft_response(new String[] {"s_38", "s_40"}, 5, player); } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch5(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_40")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - aurilia_rohak_action_axkva_min_intro_04_signal(player, npc); - string_id message = new string_id(c_stringFile, "s_42"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + aurilia_rohak_action_axkva_min_intro_04_signal(player); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_42")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch7(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_26")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - aurilia_rohak_action_giveTokenBoxQuest(player, npc); - string_id message = new string_id(c_stringFile, "s_39"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + aurilia_rohak_action_giveTokenBoxQuest(player); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_39")); + return SCRIPT_CONTINUE; } - if (response.equals("s_41")) + else if (response.equals("s_41")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_43"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_43")); + return SCRIPT_CONTINUE; } - if (response.equals("s_35")) + else if (response.equals("s_35")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_29"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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_31"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 11); - npcSpeak(player, message); - npcSetConversationResponses(player, responses); - } - else - { - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - } - return SCRIPT_CONTINUE; - } + return craft_response(new String[] {"s_29", "s_31"}, 11, player); } - if (response.equals("s_37")) + else if (response.equals("s_37")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_30"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_30")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch10(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_28")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_29"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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_31"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 11); - npcSpeak(player, message); - npcSetConversationResponses(player, responses); - } - else - { - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - } - return SCRIPT_CONTINUE; - } + return craft_response(new String[] {"s_29", "s_31"}, 11, player); } - if (response.equals("s_24")) + else if (response.equals("s_24")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_30"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_30")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int aurilia_rohak_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_rohak_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException { if (response.equals("s_31")) { - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - doAnimationAction(npc, "rub_chin_thoughtful"); - aurilia_rohak_action_axkva_min_intro_02_signal(player, npc); - string_id message = new string_id(c_stringFile, "s_33"); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + doAnimationAction(npc, "rub_chin_thoughtful"); + aurilia_rohak_action_axkva_min_intro_02_signal(player); + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_33")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_rohak"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_rohak"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_rohak_condition_axkva_min_intro_06(player, npc)) + faceTo(self, player); + if (aurilia_rohak_condition_axkva_min_intro_06(player)) { - aurilia_rohak_action_axkva_min_intro_06_signal(player, npc); - string_id message = new string_id(c_stringFile, "s_9"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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.aurilia_rohak.branchId", 1); - npcStartConversation(player, npc, "aurilia_rohak", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; + aurilia_rohak_action_axkva_min_intro_06_signal(player); + return craft_repeater(new String[] {"s_9", "s_25"}, 1, player, self); } - if (aurilia_rohak_condition_axkva_min_intro_04(player, npc)) + else if (aurilia_rohak_condition_axkva_min_intro_04(player)) { - doAnimationAction(npc, "explain"); - string_id message = new string_id(c_stringFile, "s_10"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_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_32"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 3); - npcStartConversation(player, npc, "aurilia_rohak", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; + doAnimationAction(self, "explain"); + return craft_repeater(new String[] {"s_10", "s_32"}, 3, player, self); } - if (aurilia_rohak_condition_notCompletedTokenBox(player, npc)) + else if (aurilia_rohak_condition_notCompletedTokenBox(player)) { - string_id message = new string_id(c_stringFile, "s_23"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; + if (aurilia_rohak_condition_axkva_min_intro_01(player)){ + return craft_repeater(new String[] {"s_23", "s_26", "s_41", "s_37"}, 7, player, self); } - boolean hasResponse1 = false; - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; + else if (aurilia_rohak_condition_axkva_min_intro_02(player)){ + return craft_repeater(new String[] {"s_23", "s_26", "s_41", "s_35"}, 7, player, self); } - boolean hasResponse2 = false; - if (aurilia_rohak_condition_axkva_min_intro_02(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; + else { + return craft_repeater(new String[]{"s_23", "s_26", "s_41"}, 7, player, self); } - boolean hasResponse3 = false; - if (aurilia_rohak_condition_axkva_min_intro_01(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_26"); - } - if (hasResponse1) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_41"); - } - if (hasResponse2) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_35"); - } - if (hasResponse3) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_37"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 7); - npcStartConversation(player, npc, "aurilia_rohak", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; } - if (aurilia_rohak_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_18"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_rohak_condition_axkva_min_intro_02(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; + else{ + if (aurilia_rohak_condition_axkva_min_intro_01(player)){ + return craft_repeater(new String[] {"s_18", "s_24"}, 10, player, self); } - boolean hasResponse1 = false; - if (aurilia_rohak_condition_axkva_min_intro_01(player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; + else if (aurilia_rohak_condition_axkva_min_intro_02(player)){ + return craft_repeater(new String[] {"s_18", "s_28"}, 10, player, self); } - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - if (hasResponse0) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_28"); - } - if (hasResponse1) - { - responses[responseIndex++] = new string_id(c_stringFile, "s_24"); - } - utils.setScriptVar(player, "conversation.aurilia_rohak.branchId", 10); - npcStartConversation(player, npc, "aurilia_rohak", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); - return SCRIPT_CONTINUE; + return craft_repeater(new String[] {"s_18"}, 10, player, self); } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException { @@ -523,38 +194,37 @@ public class aurilia_rohak extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_rohak.branchId"); - if (branchId == 1 && aurilia_rohak_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_rohak_handleBranch1(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 3 && aurilia_rohak_handleBranch3(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 3 && aurilia_rohak_handleBranch3(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 4 && aurilia_rohak_handleBranch4(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 4 && aurilia_rohak_handleBranch4(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 5 && aurilia_rohak_handleBranch5(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 5 && aurilia_rohak_handleBranch5(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 7 && aurilia_rohak_handleBranch7(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 7 && aurilia_rohak_handleBranch7(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 10 && aurilia_rohak_handleBranch10(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 10 && aurilia_rohak_handleBranch10(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - if (branchId == 11 && aurilia_rohak_handleBranch11(player, npc, response) == SCRIPT_CONTINUE) + else if (branchId == 11 && aurilia_rohak_handleBranch11(player, self, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_rohak.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } } diff --git a/sku.0/sys.server/compiled/game/script/conversation/aurilia_sarguillo.java b/sku.0/sys.server/compiled/game/script/conversation/aurilia_sarguillo.java old mode 100644 new mode 100755 index 3b352f8ac..9322f70a4 --- a/sku.0/sys.server/compiled/game/script/conversation/aurilia_sarguillo.java +++ b/sku.0/sys.server/compiled/game/script/conversation/aurilia_sarguillo.java @@ -1,117 +1,54 @@ package script.conversation; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.ai_lib; import script.library.chat; import script.library.groundquests; import script.library.utils; +import script.*; -public class aurilia_sarguillo extends script.base_script +public class aurilia_sarguillo extends script.conversation.base.conversation_base { + public String conversation = "conversation.aurilia_sarguillo"; + public String c_stringFile = "conversation/aurilia_sarguillo"; + public aurilia_sarguillo() { + super.scriptName = "aurilia_sarguillo"; + super.conversation = conversation; + super.c_stringFile = c_stringFile; } - public static String c_stringFile = "conversation/aurilia_sarguillo"; - public boolean aurilia_sarguillo_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - public boolean aurilia_sarguillo_condition_axkva_min_intro_01(obj_id player, obj_id npc) throws InterruptedException + private boolean aurilia_sarguillo_condition_axkva_min_intro_01(obj_id player) throws InterruptedException { return groundquests.isTaskActive(player, "axkva_min_intro", "axkva_min_intro_01"); } - public int aurilia_sarguillo_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException + private int aurilia_sarguillo_handleBranch1(obj_id player, string_id response) throws InterruptedException { if (response.equals("s_5")) { - if (aurilia_sarguillo_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_6"); - utils.removeScriptVar(player, "conversation.aurilia_sarguillo.branchId"); - npcEndConversationWithMessage(player, message); - return SCRIPT_CONTINUE; - } + utils.removeScriptVar(player, conversation + ".branchId"); + npcEndConversationWithMessage(player, new string_id(c_stringFile, "s_6")); + return SCRIPT_CONTINUE; } return SCRIPT_DEFAULT; } - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible(self)) || (isPlayer(self))) - { - detachScript(self, "conversation.aurilia_sarguillo"); - } - setCondition(self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition(self, CONDITION_CONVERSABLE); - 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.aurilia_sarguillo"); - 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)) + if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) { return SCRIPT_OVERRIDE; } - if (aurilia_sarguillo_condition__defaultCondition(player, npc)) - { - string_id message = new string_id(c_stringFile, "s_4"); - int numberOfResponses = 0; - boolean hasResponse = false; - boolean hasResponse0 = false; - if (aurilia_sarguillo_condition_axkva_min_intro_01(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_5"); - } - utils.setScriptVar(player, "conversation.aurilia_sarguillo.branchId", 1); - npcStartConversation(player, npc, "aurilia_sarguillo", message, responses); - } - else - { - chat.chat(npc, player, message); - } - return SCRIPT_CONTINUE; - } - chat.chat(npc, "Error: All conditions for OnStartNpcConversation were false."); + string_id message = new string_id(c_stringFile, "s_4"); + if (aurilia_sarguillo_condition_axkva_min_intro_01(player)) + { + string_id responses[] = new string_id[1]; + responses[0] = new string_id(c_stringFile, "s_5"); + utils.setScriptVar(player, conversation + ".branchId", 1); + npcStartConversation(player, self, "aurilia_sarguillo", message, responses); + } + else + { + chat.chat(self, player, message); + } return SCRIPT_CONTINUE; } public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException @@ -120,14 +57,13 @@ public class aurilia_sarguillo extends script.base_script { return SCRIPT_CONTINUE; } - obj_id npc = self; - int branchId = utils.getIntScriptVar(player, "conversation.aurilia_sarguillo.branchId"); - if (branchId == 1 && aurilia_sarguillo_handleBranch1(player, npc, response) == SCRIPT_CONTINUE) + int branchId = utils.getIntScriptVar(player, conversation + ".branchId"); + if (branchId == 1 && aurilia_sarguillo_handleBranch1(player, response) == SCRIPT_CONTINUE) { return SCRIPT_CONTINUE; } - chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - utils.removeScriptVar(player, "conversation.aurilia_sarguillo.branchId"); + chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse."); + utils.removeScriptVar(player, conversation + ".branchId"); return SCRIPT_CONTINUE; } }