mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
331 lines
15 KiB
Java
Executable File
331 lines
15 KiB
Java
Executable File
package script.conversation;
|
|
|
|
import script.library.ai_lib;
|
|
import script.library.chat;
|
|
import script.library.jedi_trials;
|
|
import script.*;
|
|
|
|
public class padawan_artist_02 extends script.base_script
|
|
{
|
|
public padawan_artist_02()
|
|
{
|
|
}
|
|
public static String c_stringFile = "conversation/padawan_artist_02";
|
|
public boolean padawan_artist_02_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
return true;
|
|
}
|
|
public boolean padawan_artist_02_condition_isTrialPlayer(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
obj_id trialPlayer = getObjIdObjVar(npc, jedi_trials.PADAWAN_TRIAL_PLAYER_OBJVAR);
|
|
if (player == trialPlayer)
|
|
{
|
|
String trialName = jedi_trials.getJediTrialName(player);
|
|
if (trialName != null && trialName.equals("artist"))
|
|
{
|
|
return !hasObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
public void padawan_artist_02_action_setSpokeToNpc(obj_id player, obj_id npc) throws InterruptedException
|
|
{
|
|
setObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_01", true);
|
|
messageTo(player, "handleSetBeginLoc", null, 1, false);
|
|
return;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
if ((!isMob(self)) || (isPlayer(self)))
|
|
{
|
|
detachScript(self, "npc.conversation.padawan_artist_02");
|
|
}
|
|
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, "npc.conversation.padawan_artist_02");
|
|
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
|
|
{
|
|
if (ai_lib.isInCombat(self) || ai_lib.isInCombat(player))
|
|
{
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
if (padawan_artist_02_condition_isTrialPlayer(player, self))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_e00a6a73");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_7fb2178f");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 1);
|
|
npcStartConversation(player, self, "padawan_artist_02", message, responses);
|
|
}
|
|
else
|
|
{
|
|
chat.chat(self, message);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_a54bac2d");
|
|
chat.chat(self, message);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
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
|
|
{
|
|
if (!conversationId.equals("padawan_artist_02"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
int branchId = getIntObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
if (branchId == 1 && response.equals("s_7fb2178f"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
doAnimationAction(self, "dismiss");
|
|
string_id message = new string_id(c_stringFile, "s_5c12a1a9");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_5439ef9");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 2);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'I see she has already found a replacement for me.' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 2 && response.equals("s_5439ef9"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
doAnimationAction(self, "shrug_hands");
|
|
string_id message = new string_id(c_stringFile, "s_70d2d7a8");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_b4b8a975");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 3);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'I've told her already, I'm not fetching her 'mud and refuse' ever again.' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 3 && response.equals("s_b4b8a975"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
string_id message = new string_id(c_stringFile, "s_f0a76084");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_b19ae492");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 4);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'Because... I... I've lost all direction in my life, where do I go from here? There must be something better than fetching dirt and droppings from various places. But I have nowhere else to go.' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 4 && response.equals("s_b19ae492"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
doAnimationAction(self, "pound_fist_palm");
|
|
string_id message = new string_id(c_stringFile, "s_c5493e9b");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_cb5a9d1b");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 5);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'You don't have to lie to make me feel better.' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 5 && response.equals("s_cb5a9d1b"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
doAnimationAction(self, "slump_head");
|
|
string_id message = new string_id(c_stringFile, "s_e83d11f6");
|
|
int numberOfResponses = 0;
|
|
boolean hasResponse = false;
|
|
boolean hasResponse0 = false;
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
++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_1ed6eefa");
|
|
}
|
|
setObjVar(player, "conversation.padawan_artist_02.branchId", 6);
|
|
npcSpeak(player, message);
|
|
npcSetConversationResponses(player, responses);
|
|
}
|
|
else
|
|
{
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'I have hopes and dreams too! I have talent!' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (branchId == 6 && response.equals("s_1ed6eefa"))
|
|
{
|
|
if (padawan_artist_02_condition__defaultCondition(player, self))
|
|
{
|
|
doAnimationAction(self, "nod_head_once");
|
|
padawan_artist_02_action_setSpokeToNpc(player, self);
|
|
string_id message = new string_id(c_stringFile, "s_26360156");
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
npcSpeak(player, message);
|
|
npcEndConversation(player);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'No, I don't have it in me.' were false.");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
|
removeObjVar(player, "conversation.padawan_artist_02.branchId");
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|