mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-12 23:45:12 -04:00
who isn't sick of converting the freaking scripts? this negates the need
This commit is contained in:
@@ -0,0 +1,285 @@
|
||||
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.jedi_trials;
|
||||
|
||||
public class padawan_pannaqa_03 extends script.base_script
|
||||
{
|
||||
public padawan_pannaqa_03()
|
||||
{
|
||||
}
|
||||
public static String c_stringFile = "conversation/padawan_pannaqa_03";
|
||||
public boolean padawan_pannaqa_03_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean padawan_pannaqa_03_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("pannaqa"))
|
||||
{
|
||||
return !hasObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_02");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void padawan_pannaqa_03_action_sendBackBeginning(obj_id player, obj_id npc) throws InterruptedException
|
||||
{
|
||||
setObjVar(player, "jedi_trials.padawan_trials.temp.spokeToTarget_02", true);
|
||||
messageTo(player, "handleSetBeginLoc", null, 1, false);
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
{
|
||||
if ((!isMob(self)) || (isPlayer(self)))
|
||||
{
|
||||
detachScript(self, "npc.conversation.padawan_pannaqa_03");
|
||||
}
|
||||
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_pannaqa_03");
|
||||
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_pannaqa_03_condition_isTrialPlayer(player, self))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_70fea75d");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (padawan_pannaqa_03_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_4cc97351");
|
||||
}
|
||||
setObjVar(player, "conversation.padawan_pannaqa_03.branchId", 1);
|
||||
npcStartConversation(player, self, "padawan_pannaqa_03", message, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
chat.chat(self, message);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_552042df");
|
||||
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_pannaqa_03"))
|
||||
{
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
int branchId = getIntObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
if (branchId == 1 && response.equals("s_4cc97351"))
|
||||
{
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_9035e1f5");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (padawan_pannaqa_03_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_2b0e7d3c");
|
||||
}
|
||||
setObjVar(player, "conversation.padawan_pannaqa_03.branchId", 2);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
npcSpeak(player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'Um, hello?' were false.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 2 && response.equals("s_2b0e7d3c"))
|
||||
{
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
doAnimationAction(self, "tap_head");
|
||||
string_id message = new string_id(c_stringFile, "s_6abc7ab9");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
++numberOfResponses;
|
||||
hasResponse = true;
|
||||
hasResponse0 = true;
|
||||
}
|
||||
boolean hasResponse1 = false;
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
++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_7bbf7ffe");
|
||||
}
|
||||
if (hasResponse1)
|
||||
{
|
||||
responses[responseIndex++] = new string_id(c_stringFile, "s_b7bc9ab");
|
||||
}
|
||||
setObjVar(player, "conversation.padawan_pannaqa_03.branchId", 3);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
npcSpeak(player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'Um, who?' were false.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 3 && response.equals("s_7bbf7ffe"))
|
||||
{
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
string_id message = new string_id(c_stringFile, "s_eb635904");
|
||||
int numberOfResponses = 0;
|
||||
boolean hasResponse = false;
|
||||
boolean hasResponse0 = false;
|
||||
if (padawan_pannaqa_03_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_1a22a5dc");
|
||||
}
|
||||
setObjVar(player, "conversation.padawan_pannaqa_03.branchId", 4);
|
||||
npcSpeak(player, message);
|
||||
npcSetConversationResponses(player, responses);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
npcSpeak(player, message);
|
||||
npcEndConversation(player);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'No kidding eh? I guess I should probably get on that huh?' were false.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 3 && response.equals("s_b7bc9ab"))
|
||||
{
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
doAnimationAction(self, "rub_belly");
|
||||
padawan_pannaqa_03_action_sendBackBeginning(player, self);
|
||||
string_id message = new string_id(c_stringFile, "s_e51e11cc");
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
npcSpeak(player, message);
|
||||
npcEndConversation(player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'No kidding eh? I guess I should probably get on that huh?' were false.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (branchId == 4 && response.equals("s_1a22a5dc"))
|
||||
{
|
||||
if (padawan_pannaqa_03_condition__defaultCondition(player, self))
|
||||
{
|
||||
doAnimationAction(self, "celebrate1");
|
||||
padawan_pannaqa_03_action_sendBackBeginning(player, self);
|
||||
string_id message = new string_id(c_stringFile, "s_b6307da0");
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
npcSpeak(player, message);
|
||||
npcEndConversation(player);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: All conditions for OnNpcConversationResponse for branch 'So you are going to take the part for me, and I can stay here and drink?' were false.");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
chat.chat(self, "Error: Fell through all branches and responses for OnNpcConversationResponse.");
|
||||
removeObjVar(player, "conversation.padawan_pannaqa_03.branchId");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user