mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-10-07 23:13:17 -04:00
who isn't sick of converting the freaking scripts? this negates the need
This commit is contained in:
@@ -0,0 +1,332 @@
|
||||
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.space_flags;
|
||||
|
||||
public class nym_technician_2 extends script.base_script
|
||||
{
|
||||
public nym_technician_2()
|
||||
{
|
||||
}
|
||||
public static String c_stringFile = "conversation/nym_technician_2";
|
||||
public boolean nym_technician_2_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean nym_technician_2_condition_isOnStormSquadronQuest(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
return space_flags.hasSpaceFlag(player, "ss.findingAgent");
|
||||
}
|
||||
public int nym_technician_2_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
||||
{
|
||||
if (response.equals("s_8358e7c8"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_4c3cb236");
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (response.equals("s_67a590c3"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_cbb1bec7");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (nym_technician_2_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_76ac95c");
|
||||
}
|
||||
setObjVar(player, "conversation.nym_technician_2.branchId", 3);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (response.equals("s_62f865dd"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_501ea131");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (nym_technician_2_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_62f865dd");
|
||||
}
|
||||
setObjVar(player, "conversation.nym_technician_2.branchId", 5);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (response.equals("s_f49a789f"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_60900624");
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SCRIPT_DEFAULT;
|
||||
}
|
||||
public int nym_technician_2_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
||||
{
|
||||
if (response.equals("s_76ac95c"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_b7141451");
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SCRIPT_DEFAULT;
|
||||
}
|
||||
public int nym_technician_2_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
||||
{
|
||||
if (response.equals("s_62f865dd"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_b0c60048");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (nym_technician_2_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_5afecbb7");
|
||||
}
|
||||
setObjVar(player, "conversation.nym_technician_2.branchId", 6);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
chat.chat(npc, player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
return SCRIPT_DEFAULT;
|
||||
}
|
||||
public int nym_technician_2_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException
|
||||
{
|
||||
if (response.equals("s_5afecbb7"))
|
||||
{
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_b44f916c");
|
||||
removeObjVar(player, "conversation.nym_technician_2.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.nym_technician_2");
|
||||
}
|
||||
setCondition(self, CONDITION_CONVERSABLE);
|
||||
setInvulnerable(self, true);
|
||||
setCondition(self, CONDITION_SPACE_INTERESTING);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnAttach(obj_id self) throws InterruptedException
|
||||
{
|
||||
setCondition(self, CONDITION_CONVERSABLE);
|
||||
setInvulnerable(self, true);
|
||||
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);
|
||||
faceTo(self, player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException
|
||||
{
|
||||
clearCondition(self, CONDITION_CONVERSABLE);
|
||||
detachScript(self, "conversation.nym_technician_2");
|
||||
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 (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_6aa58622");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (nym_technician_2_condition__defaultCondition(player, npc))
|
||||
{
|
||||
++numberOfResponses;
|
||||
hasResponse = true;
|
||||
hasResponse0 = true;
|
||||
}
|
||||
boolean hasResponse1 = false;
|
||||
if (nym_technician_2_condition_isOnStormSquadronQuest(player, npc))
|
||||
{
|
||||
++numberOfResponses;
|
||||
hasResponse = true;
|
||||
hasResponse1 = true;
|
||||
}
|
||||
boolean hasResponse2 = false;
|
||||
if (nym_technician_2_condition_isOnStormSquadronQuest(player, npc))
|
||||
{
|
||||
++numberOfResponses;
|
||||
hasResponse = true;
|
||||
hasResponse2 = true;
|
||||
}
|
||||
boolean hasResponse3 = false;
|
||||
if (nym_technician_2_condition_isOnStormSquadronQuest(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_8358e7c8");
|
||||
}
|
||||
if (hasResponse1)
|
||||
{
|
||||
responses[responseIndex++] = new string_id(c_stringFile, "s_67a590c3");
|
||||
}
|
||||
if (hasResponse2)
|
||||
{
|
||||
responses[responseIndex++] = new string_id(c_stringFile, "s_62f865dd");
|
||||
}
|
||||
if (hasResponse3)
|
||||
{
|
||||
responses[responseIndex++] = new string_id(c_stringFile, "s_f49a789f");
|
||||
}
|
||||
setObjVar(player, "conversation.nym_technician_2.branchId", 1);
|
||||
npcStartConversation(player, npc, "nym_technician_2", 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("nym_technician_2"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
obj_id npc = self;
|
||||
int branchId = getIntObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
if (branchId == 1 && nym_technician_2_handleBranch1(player, npc, response) == SCRIPT_CONTINUE)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 3 && nym_technician_2_handleBranch3(player, npc, response) == SCRIPT_CONTINUE)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 5 && nym_technician_2_handleBranch5(player, npc, response) == SCRIPT_CONTINUE)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 6 && nym_technician_2_handleBranch6(player, npc, response) == SCRIPT_CONTINUE)
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(npc, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
||||
removeObjVar(player, "conversation.nym_technician_2.branchId");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user