mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
* Code compiles - execution NOT tested * updating gitignore * Removed intellij settings files * Removed more intellij files * Added exclusion for JDK classes. * Fixed purchasing script for vendors that have listed coin types. * Updated script to not kick off until the entire preload is complete. * adds static name entry for Solo movie poster and tcg9 vendor entry * clean up empty and orphaned object templates * adds placeholder black market (static) spawns * corrects entries for the video game table to correctly set it in tcg series 2 and remove series 1 console errors * Updated gitignore and removed intellij project files * Fixed appearance reference for thranta payroll and kashyyyk door, added skipLosCheck objvar due to cannit see issue. Requires updated src * Fixed appearance and template for terminal (#2) * Fixed appearance and template for terminal (#3) * Fixed appearance and template for terminal (#4) * Deleted another faulty/orphaned object template * Fixed gcw ranks option on frog. Only issue is that it doesn't award the officer commands or badges. * Fixed some unneeded java 11 changes
157 lines
6.6 KiB
Java
Executable File
157 lines
6.6 KiB
Java
Executable File
package script.poi.heromark;
|
|
|
|
import script.library.*;
|
|
import script.obj_id;
|
|
import script.string_id;
|
|
|
|
import java.util.Vector;
|
|
|
|
public class mediator extends script.poi.base.scenario_actor
|
|
{
|
|
public mediator()
|
|
{
|
|
}
|
|
public static final String SCRIPT_CONVERSE = "npc.converse.npc_converse_menu";
|
|
public static final String LOG_NAME = "poiHeroMark Mediator";
|
|
public static final int CONV_GREET = 0;
|
|
public static final int CONV_SPOKE = 1;
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
attachScript(self, SCRIPT_CONVERSE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnInitialize(obj_id self) throws InterruptedException
|
|
{
|
|
attachScript(self, SCRIPT_CONVERSE);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException
|
|
{
|
|
if (ai_lib.isInCombat(self))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String convo = scenario.getConvo();
|
|
if (convo.equals(""))
|
|
{
|
|
npcEndConversation(speaker);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
int progress = scenario.getPlayerProgress(speaker);
|
|
string_id msg = new string_id(convo, "a_greet");
|
|
Vector responses = new Vector();
|
|
responses.setSize(0);
|
|
if (badge.hasBadge(speaker, "poi_heromark"))
|
|
{
|
|
poi.quickSay(self, "m_heroreturned");
|
|
npcEndConversation(speaker);
|
|
}
|
|
else if (progress == CONV_SPOKE)
|
|
{
|
|
int idx = rand(1, 4);
|
|
poi.quickSay(self, "m_chatter_" + idx);
|
|
npcEndConversation(speaker);
|
|
}
|
|
else
|
|
{
|
|
if (badge.hasBadge(speaker, "poi_prisonbreak") && badge.hasBadge(speaker, "poi_factoryliberation") && badge.hasBadge(speaker, "poi_rabidbeast") && badge.hasBadge(speaker, "poi_twoliars"))
|
|
{
|
|
msg = new string_id(convo, "m_youareahero");
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_relatestory"));
|
|
npcStartConversation(speaker, self, convo, msg, responses);
|
|
}
|
|
else
|
|
{
|
|
msg = new string_id(convo, "m_greet");
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_greet"));
|
|
npcStartConversation(speaker, self, convo, msg, responses);
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public int OnNpcConversationResponse(obj_id self, String convoName, obj_id speaker, string_id response) throws InterruptedException
|
|
{
|
|
if (ai_lib.isInCombat(self))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String convo = scenario.getConvo();
|
|
if (convo.equals(""))
|
|
{
|
|
npcEndConversation(speaker);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (!convoName.equals(convo))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
String aId = response.getAsciiId();
|
|
Vector responses = new Vector();
|
|
responses.setSize(0);
|
|
npcSetConversationResponses(speaker, responses);
|
|
switch (aId) {
|
|
case "r_m_greet":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk1"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk1"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk1":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk2"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk2"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk2":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk3"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk3"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk3":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk4"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_empirebad"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_empiregood"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_empiregood":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk5"));
|
|
scenario.setPlayerProgress(speaker, CONV_SPOKE);
|
|
break;
|
|
case "r_m_empirebad":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk6"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk6"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk6":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk7"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk7"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk7":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk8"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk8"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk8":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk9"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk9"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk9":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk10"));
|
|
responses = utils.addElement(responses, new string_id(convo, "r_m_herotalk10"));
|
|
npcSetConversationResponses(speaker, responses);
|
|
break;
|
|
case "r_m_herotalk10":
|
|
npcSpeak(speaker, new string_id(convo, "m_herotalk11"));
|
|
scenario.setPlayerProgress(speaker, CONV_SPOKE);
|
|
break;
|
|
case "r_m_relatestory":
|
|
npcSpeak(speaker, new string_id(convo, "m_youareahero2"));
|
|
scenario.setPlayerProgress(speaker, CONV_SPOKE);
|
|
badge.grantBadge(speaker, "poi_heromark");
|
|
scenario.complete();
|
|
break;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|