- 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 Summary
Modifier and Type Method Description intcountFemaleInArea(String areaName)intcountMaleInArea(String areaName)intcountUserInArea(String areaName)default booleandisablePortal(String portalName)default booleanenablePortal(String portalName)booleanenablePortal(String portalName, boolean enable)Sends a packet to the Field, enabling or disabling a portal.intgetId()default intgetMobCount(int mobId)Returns a count of the mobs in a map, by ID.longgetMobHp(int mobId)Nexon's comment: Returns the HP of the Mob.Collection<MobObject>getMobs()default intgetUserCount()Collection<UserObject>getUsers()booleanisItemInArea(String areaName, int itemID)voidnotice(Integer type, String... message)booleanremoveMob(int mobId)default Stream<MobObject>streamMobs()default Stream<MobObject>streamMobs(Predicate<MobObject> filter)default Stream<UserObject>streamUsers()default Stream<UserObject>streamUsers(Predicate<UserObject> filter)booleansummonMob(int templateId, int xPos, int yPos)Summons a mob in the current field instance.
-
Method Details
-
getId
int getId()- Returns:
- the field object's .wz id
-
getUsers
Collection<UserObject> getUsers() -
streamUsers
-
streamUsers
-
getUserCount
default int getUserCount()- Returns:
- a count of all users in the field.
-
getMobs
Collection<MobObject> getMobs() -
streamMobs
-
streamMobs
-
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
-
countMaleInArea
-
countFemaleInArea
-
enablePortal
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
-
disablePortal
-
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
-
isItemInArea
-
removeMob
boolean removeMob(int mobId)
-