mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-21 07:13:00 -04:00
Optimized and validated operation of event functions.
This commit is contained in:
Regular → Executable
+12
-25
@@ -1,22 +1,13 @@
|
||||
package script.event;
|
||||
|
||||
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.utils;
|
||||
import java.util.StringTokenizer;
|
||||
import script.obj_id;
|
||||
|
||||
public class shield_ring extends script.base_script
|
||||
{
|
||||
public shield_ring()
|
||||
{
|
||||
}
|
||||
public static final String[] HELP_TEXT =
|
||||
private static final String[] HELP_TEXT =
|
||||
{
|
||||
"=========================================",
|
||||
"USAGE: ShieldRing [Armor Effectiveness 1-100] (default effectiveness is 20)",
|
||||
@@ -38,10 +29,9 @@ public class shield_ring extends script.base_script
|
||||
sendSystemMessage(self, "You must be in God Mode for this script to take hold.", null);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if (isGod(self))
|
||||
else
|
||||
{
|
||||
int godLevel = getGodLevel(self);
|
||||
if (godLevel < 15)
|
||||
if (getGodLevel(self) < 15)
|
||||
{
|
||||
detachScript(self, "event.shield_ring");
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this script.", null);
|
||||
@@ -58,10 +48,9 @@ public class shield_ring extends script.base_script
|
||||
detachScript(self, "event.shield_ring");
|
||||
sendSystemMessage(self, "You must be in God Mode to use this script.", null);
|
||||
}
|
||||
if (isGod(self))
|
||||
else
|
||||
{
|
||||
int godLevel = getGodLevel(self);
|
||||
if (godLevel < 15)
|
||||
if (getGodLevel(self) < 15)
|
||||
{
|
||||
detachScript(self, "event.shield_ring");
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this script.", null);
|
||||
@@ -78,15 +67,14 @@ public class shield_ring extends script.base_script
|
||||
}
|
||||
if (isGod(self))
|
||||
{
|
||||
int godLevel = getGodLevel(self);
|
||||
if (godLevel < 15)
|
||||
if (getGodLevel(self) < 15)
|
||||
{
|
||||
detachScript(self, "event.shield_ring");
|
||||
sendSystemMessage(self, "You do not have the appropriate access level to use this script.", null);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (!isGod(self))
|
||||
else
|
||||
{
|
||||
detachScript(self, "event.shield_ring");
|
||||
sendSystemMessage(self, "You must be in God Mode to use this script.", null);
|
||||
@@ -96,16 +84,15 @@ public class shield_ring extends script.base_script
|
||||
{
|
||||
sendSystemMessage(self, "This command has been temporarily disabled. See S. Jakab or T. Blair", null);
|
||||
}
|
||||
if ((toLower(strText)).equals("detach"))
|
||||
else if ((toLower(strText)).equals("detach"))
|
||||
{
|
||||
detachScript(self, "event.shield_ring");
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
if ((toLower(strText)).equals("help"))
|
||||
else if ((toLower(strText)).equals("help"))
|
||||
{
|
||||
for (int i = 0; i < HELP_TEXT.length; i++)
|
||||
{
|
||||
sendSystemMessage(self, HELP_TEXT[i], null);
|
||||
for (String helpText : HELP_TEXT) {
|
||||
sendSystemMessage(self, helpText, null);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user