Class ScriptingSandbox

java.lang.Object
games.stendhal.server.core.scripting.ScriptingSandbox
Direct Known Subclasses:
ScriptInGroovy, ScriptInJava, ScriptInLua

public abstract class ScriptingSandbox extends Object
  • Constructor Details

    • ScriptingSandbox

      public ScriptingSandbox(String filename)
  • Method Details

    • getZone

      public StendhalRPZone getZone(RPObject rpobject)
    • getZone

      public StendhalRPZone getZone(String zoneName)
      Retrieves a zone by string ID.
      Parameters:
      zoneName - Name of zone to retrieve.
      Returns:
      StendhalRPZone, if exists, null otherwise.
    • setZone

      public boolean setZone(String name)
    • setZone

      public boolean setZone(StendhalRPZone zone)
    • playerIsInZone

      public boolean playerIsInZone(Player player, String zoneName)
    • add

      public void add(NPC npc)
    • add

      public void add(RPObject object, Boolean expire)
    • add

      public void add(RPObject object)
    • getCreatures

      public Creature[] getCreatures()
    • getCreature

      public Creature getCreature(String clazz)
    • getItems

      public Item[] getItems()
    • getItem

      public Item getItem(String name)
    • add

      public Creature add(Creature template, int x, int y)
    • addGameEvent

      public void addGameEvent(String source, String event, List<String> params)
    • modify

      public void modify(RPEntity entity)
    • privateText

      public void privateText(Player player, String text)
    • load

      public abstract boolean load(Player player, List<String> args)
    • getMessage

      public String getMessage()
    • setMessage

      protected void setMessage(String message)
    • remove

      public void remove(NPC npc)
    • remove

      public void remove(RPObject object)
    • unload

      public void unload(Player player, List<String> args)
      Unloads this script.
      Parameters:
      player - the admin who load it or null on server start.
      args - the arguments the admin specified or null on server start.
    • preExecute

      protected void preExecute(Player player, List<String> args)
      Prepares execution of the script.
      Parameters:
      player - the admin who load it or null on server start.
      args - the arguments the admin specified or null on server start.
    • postExecute

      protected void postExecute(Player player, List<String> args, boolean result)
      Cleans up execution of the script.
      Parameters:
      player - the admin who load it or null on server start.
      args - the arguments the admin specified or null on server start.
      result - true, if the execution was successful; false otherwise
    • execute

      public boolean execute(Player player, List<String> args)
      Executes this script.
      Parameters:
      player - the admin who load it or null on server start.
      args - the arguments the admin specified or null on server start.
      Returns:
      true at successful execution, otherwise false