Interface FieldObject<T>

Type Parameters:
T -
All Superinterfaces:
ScriptObject<T>

public interface FieldObject<T>
extends ScriptObject<T>
This is a script proxy for field/map objects. should be your implementation of maps/fields.
  • Method Details

    • getId

      int getId()
      Returns:
      the field object's .wz id
    • getUsers

      Collection<UserObject> getUsers()
    • streamUsers

      default Stream<UserObject> streamUsers()
    • streamUsers

      default Stream<UserObject> streamUsers​(Predicate<UserObject> filter)
    • getUserCount

      default int getUserCount()
      Returns:
      a count of all users in the field.
    • getMobs

      Collection<MobObject> getMobs()
    • streamMobs

      default Stream<MobObject> streamMobs()
    • streamMobs

      default Stream<MobObject> streamMobs​(Predicate<MobObject> filter)
    • getMobCount

      default int getMobCount​(int mobId)
      Returns a count of the mobs in a map, by ID.
      Parameters:
      mobId - the ID of the mob to count
      Returns:
      a count of the mob specified in the map
    • getMobHp

      long getMobHp​(int mobId)
      Nexon's comment: Returns the HP of the Mob. Valid only when there is only one Mob with a specific ID. If there is no Mob, return -1
      Parameters:
      mobId - the template ID of the mob
      Returns:
      See nexon's note.
    • countUserInArea

      int countUserInArea​(String areaName)
    • countMaleInArea

      int countMaleInArea​(String areaName)
    • countFemaleInArea

      int countFemaleInArea​(String areaName)
    • enablePortal

      boolean enablePortal​(String portalName, boolean enable)
      Sends a packet to the Field, enabling or disabling a portal.
      Parameters:
      portalName - the name of the portal to enable.
      enable - TRUE if enabling, FALSE if disabling.
      Returns:
      TRUE if the portal is now enabled, false otherwise.
    • enablePortal

      default boolean enablePortal​(String portalName)
    • disablePortal

      default boolean disablePortal​(String portalName)
    • summonMob

      boolean summonMob​(int templateId, int xPos, int yPos)
      Summons a mob in the current field instance.
      Parameters:
      templateId - The mob's template ID. OR mob sack item?
      xPos - the mob's proposed x position.
      yPos - the mob's proposed y position.
      Returns:
      TRUE if all is well, the mob is summoned.
    • notice

      void notice​(Integer type, String... message)
    • isItemInArea

      boolean isItemInArea​(String areaName, int itemID)
    • removeMob

      boolean removeMob​(int mobId)