mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -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
109 lines
3.9 KiB
Java
Executable File
109 lines
3.9 KiB
Java
Executable File
package script.test;
|
|
|
|
import script.library.pgc_quests;
|
|
import script.location;
|
|
import script.obj_id;
|
|
|
|
public class mfarone_test extends script.base_script
|
|
{
|
|
public mfarone_test()
|
|
{
|
|
}
|
|
public int OnAttach(obj_id self) throws InterruptedException
|
|
{
|
|
if (!isGod(self) || getGodLevel(self) < 50 || !isPlayer(self)) {
|
|
detachScript(self, "test.mfarone_test");
|
|
}
|
|
else if (hasObjVar(self, "idiot_testing"))
|
|
{
|
|
sendSystemMessage(self, "mfarone_test script attached.", "");
|
|
}
|
|
else
|
|
{
|
|
sendSystemMessage(self, "Attaching script failed.", "");
|
|
detachScript(self, "test.mfarone_test");
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
public void areaDebugMessaging(obj_id self, String message) throws InterruptedException
|
|
{
|
|
obj_id[] players = getAllPlayers(getLocation(getTopMostContainer(self)), 35.0f);
|
|
if (players != null && players.length > 0)
|
|
{
|
|
for (obj_id player : players) {
|
|
sendSystemMessage(player, message, "");
|
|
}
|
|
}
|
|
}
|
|
public int OnSpeaking(obj_id self, String text) throws InterruptedException
|
|
{
|
|
if (!isGod(self))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
obj_id player = self;
|
|
location here = getLocation(player);
|
|
int stringCheck = -1;
|
|
obj_id target = getIntendedTarget(self);
|
|
if (!isIdValid(target))
|
|
{
|
|
target = getLookAtTarget(self);
|
|
}
|
|
String[] commands =
|
|
{
|
|
"idiot_pgc_grant_all_tasks",
|
|
"idiot_pgc_revoke_all_tasks"
|
|
};
|
|
java.util.StringTokenizer st = new java.util.StringTokenizer(text);
|
|
String command = st.nextToken();
|
|
stringCheck = text.indexOf("idiot_pgc_list");
|
|
if (stringCheck > -1)
|
|
{
|
|
for (String command1 : commands) {
|
|
sendSystemMessage(self, command1, "");
|
|
}
|
|
}
|
|
stringCheck = text.indexOf("idiot_pgc_grant_all_tasks");
|
|
if (stringCheck > -1)
|
|
{
|
|
for (int i = 0; i < pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES.length; i++)
|
|
{
|
|
String collectionName = pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES[i];
|
|
String[] collctionSlots = getAllCollectionSlotsInCollection(collectionName);
|
|
if (collctionSlots != null && collctionSlots.length > 0)
|
|
{
|
|
for (String slotName : collctionSlots) {
|
|
if (slotName != null && slotName.length() > 0) {
|
|
if (getCollectionSlotValue(self, slotName) <= 0) {
|
|
modifyCollectionSlotValue(self, slotName, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
stringCheck = text.indexOf("idiot_pgc_revoke_all_tasks");
|
|
if (stringCheck > -1)
|
|
{
|
|
for (int i = 0; i < pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES.length; i++)
|
|
{
|
|
String collectionName = pgc_quests.ALL_PGC_COLLECTION_TASK_NAMES[i];
|
|
String[] collctionSlots = getAllCollectionSlotsInCollection(collectionName);
|
|
if (collctionSlots != null && collctionSlots.length > 0)
|
|
{
|
|
for (String slotName : collctionSlots) {
|
|
if (slotName != null && slotName.length() > 0) {
|
|
while (getCollectionSlotValue(self, slotName) > 0) {
|
|
modifyCollectionSlotValue(self, slotName, -1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
}
|