Files
TekaohandGitHub 5c2e112349 Java 11.0.2 migration (#32)
* 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
2019-04-18 18:31:52 -05:00

136 lines
4.4 KiB
Java
Executable File

package script.test;
import script.obj_id;
import java.util.StringTokenizer;
public class qaham extends script.base_script
{
public qaham()
{
}
public static final String QA_REGEN_OBJVAR = "test.qaham.OriginalActionRegen";
public static final float QA_MASSIVE_REGEN_RATE = 10000;
public int OnAttach(obj_id self) throws InterruptedException
{
if (isGod(self))
{
if (getGodLevel(self) < 10)
{
detachScript(self, "test.qaham");
sendSystemMessage(self, "You do not have the appropriate access level to use this script.", null);
}
else
{
helpMessage(self);
}
}
else if (!isGod(self))
{
detachScript(self, "test.qaham");
}
return SCRIPT_CONTINUE;
}
public int OnDetach(obj_id self) throws InterruptedException
{
restoreActionRegenRate(self);
return SCRIPT_CONTINUE;
}
public int OnSpeaking(obj_id self, String text) throws InterruptedException
{
obj_id player = self;
if (isGod(player))
{
StringTokenizer st = new java.util.StringTokenizer(text);
int tokens = st.countTokens();
String command = null;
if (st.hasMoreTokens())
{
command = st.nextToken();
}
if (command.equals("stop_action_regen"))
{
stopActionRegenRate(player);
}
if (command.equals("restore_action_regen"))
{
restoreActionRegenRate(player);
}
if (command.equals("max_action_regen"))
{
setActionRegenRate(player, QA_MASSIVE_REGEN_RATE);
}
if (command.equals("qaham") || command.equals("test.qaham"))
{
helpMessage(player);
}
}
return SCRIPT_CONTINUE;
}
public void restoreActionRegenRate(obj_id player) throws InterruptedException
{
if (!isIdValid(player))
{
return;
}
if (!hasObjVar(player, QA_REGEN_OBJVAR))
{
return;
}
float myStoredRegen = getFloatObjVar(player, QA_REGEN_OBJVAR);
getActionRegenRate(player, myStoredRegen);
removeObjVar(player, QA_REGEN_OBJVAR);
if (!hasObjVar(player, QA_REGEN_OBJVAR))
{
sendSystemMessageTestingOnly(player, "Your Action Regen Rate has been restored");
}
else
{
sendSystemMessageTestingOnly(player, "Problem - Regen Rate was not restored!");
sendSystemMessageTestingOnly(player, "Contact the QA Tool Team about this character immediately.");
}
}
public void stopActionRegenRate(obj_id player) throws InterruptedException
{
if (!isIdValid(player))
{
return;
}
setActionRegenRate(player, 0.0f);
}
public void setActionRegenRate(obj_id player, float rate) throws InterruptedException
{
if (!isIdValid(player))
{
return;
}
float currentRegenRate = getActionRegenRate(player);
if (!hasObjVar(player, QA_REGEN_OBJVAR))
{
setObjVar(player, QA_REGEN_OBJVAR, currentRegenRate);
}
getActionRegenRate(player, rate);
if (hasObjVar(player, QA_REGEN_OBJVAR))
{
sendSystemMessageTestingOnly(player, "Your Action Regen Rate has been set to " + rate);
}
else
{
sendSystemMessageTestingOnly(player, "Problem - Regen Rate was not set correctly!");
sendSystemMessageTestingOnly(player, "Contact the QA Tool Team about this character immediately.");
}
}
public void helpMessage(obj_id player) throws InterruptedException
{
if (!isIdValid(player))
{
return;
}
sendSystemMessageTestingOnly(player, "Qaham Script Help Message");
sendSystemMessageTestingOnly(player, "Say any the following commands in chat:");
sendSystemMessageTestingOnly(player, "stop_action_regen");
sendSystemMessageTestingOnly(player, "restore_action_regen");
sendSystemMessageTestingOnly(player, "max_action_regen");
}
}