Atavism Version 2018.1AGIS API

atavism.agis.objects
Class AgisItem

java.lang.Object
  extended by atavism.server.objects.NamedPropertyClass
      extended by atavism.server.objects.Entity
          extended by atavism.server.objects.AOObject
              extended by atavism.agis.objects.AgisObject
                  extended by atavism.agis.objects.AgisItem
All Implemented Interfaces:
java.io.Serializable

public class AgisItem
extends AgisObject

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class atavism.server.objects.AOObject
AOObject.StateMap
 
Field Summary
static java.lang.String AMMO_CAPACITY
           
static java.lang.String AMMO_LOADED
           
static java.lang.String AMMO_TYPE
           
protected static java.lang.String EQUIP_INFO_PROP
           
static java.lang.String TEMPL_ACQUIRE_HOOK
           
static java.lang.String TEMPL_UNACQUIRE_HOOK
           
 
Fields inherited from class atavism.agis.objects.AgisObject
baseDCKey, cooldownStateMap, dcMapKey, templateID
 
Fields inherited from class atavism.server.objects.AOObject
aoidKey, dcKey, perceiverKey, stateMapKey, transferLock, wnodeKey
 
Fields inherited from class atavism.server.objects.Entity
log, staticLock, subObjectNamespacesInt, transientPropertyKeys, type
 
Fields inherited from class atavism.server.objects.NamedPropertyClass
lock, name
 
Constructor Summary
AgisItem()
           
AgisItem(OID oid)
           
 
Method Summary
 boolean acquired(OID activatorOid)
          Runs the AcquireHook for the item, returning false if the item is to be destroyed instead of adding it to the players bag.
 boolean activate(OID activatorOid, OID targetOid)
           
 void addAcquiredHook(AcquireHook hook)
          registers the method to call when this item is acquired by the user
 void addEquipSlot(AgisEquipSlot equipSlot)
          adds an equip mapping for this item.
 void addUnacquiredHook(UnacquireHook hook)
          register's the method to call when this item is acquired by the user
 void alterStackSize(OID itemOwner, int delta)
          Use to change the number of items in the stack.
 void bindToPlayer()
           
 boolean canBeTraded()
           
static AgisItem convert(AOObject obj)
           
 boolean equipSlotExists(AgisEquipSlot equipSlot)
           
 AcquireHook getAcquiredHooks()
           
 ActivateHook getActivateHook()
           
 AgisPermissionCallback getAgisPermissionCallback()
           
 java.util.List<AgisEquipSlot> getEquipSlots()
           
 java.lang.String getIcon()
           
 java.lang.String getItemType()
           
 AgisEquipSlot getPrimarySlot()
           
 int getPurchaseCost()
           
 int getPurchaseCurrency()
           
 int getStackLimit()
           
 int getStackSize()
           
 UnacquireHook getUnacquiredHooks()
           
 boolean isPlayerBound()
           
 void itemEquipped()
          Called when an item has been equipped.
 void setActivateHook(ActivateHook hook)
          register's the method to call when this item gets activated by the user
 void setEquipSlots(java.util.List<AgisEquipSlot> equipSlots)
           
 void setIcon(java.lang.String icon)
           
 void setItemType(java.lang.String itemType)
           
 void setPurchaseCost(int purchaseCost)
           
 void setPurchaseCurrency(int purchaseCurrency)
           
 void setStackLimit(int stackLimit)
           
 void setStackSize(int stackSize)
           
 boolean unacquired(OID activatorOid)
          Called when a player no longer has an item in their inventory.
 
Methods inherited from class atavism.agis.objects.AgisObject
addCooldownState, addDCMapping, addStun, attackable, attackable, baseDC, baseDC, convert, dcMap, dcMap, getBody, getCooldownState, getCooldownStateMap, getCurrentBody, getDCMapping, getDCV, getOwnerOID, getPD, getResistantPD, getSound, getStunCounter, getTemplateID, isDead, isDead, isStunned, modifyBody, modifyCurrentBody, removeCooldownState, removeStun, setBody, setCooldownStateMap, setCurrentBody, setOwnerOID, setSound, setStunCounter, setTemplateID
 
Methods inherited from class atavism.server.objects.AOObject
atavismID, atavismID, baseWorldNode, displayContext, displayContext, getAllObjects, getCurrentLoc, getDirection, getDirLocOrientTime, getLoc, getMasterOid, getObjCreateHook, getObject, getOrientation, getState, isItem, isLight, isMob, isStructure, isUser, perceiver, perceiver, permissionCallback, permissionCallback, readObject, registerObjCreateHook, scale, scale, scale, sendEvent, setState, toString, worldNode, worldNode, writeObject, writeString
 
Methods inherited from class atavism.server.objects.Entity
addSubObjectNamespace, equals, equals, getLock, getNamespace, getOid, getPersistenceFlag, getProperty, getSubObjectNamespaces, getSubObjectNamespacesInt, getTransientDataRef, getType, hashCode, hasSubObjectNamespace, isDeleted, registerTransientPropertyKey, removeProperty, removeSubObjectNamespace, setDeleted, setNamespace, setOid, setPersistenceFlag, setProperty, setSubObjectNamespaces, setSubObjectNamespacesInt, setType, toBytes, unregisterTransientPropertyKey
 
Methods inherited from class atavism.server.objects.NamedPropertyClass
getBooleanProperty, getIntProperty, getName, getPropertyMap, getPropertyMapRef, getStringProperty, lock, modifyIntProperty, setName, setPropertyMap, setupTransient, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EQUIP_INFO_PROP

protected static java.lang.String EQUIP_INFO_PROP

TEMPL_ACQUIRE_HOOK

public static java.lang.String TEMPL_ACQUIRE_HOOK

TEMPL_UNACQUIRE_HOOK

public static java.lang.String TEMPL_UNACQUIRE_HOOK

AMMO_TYPE

public static java.lang.String AMMO_TYPE

AMMO_CAPACITY

public static java.lang.String AMMO_CAPACITY

AMMO_LOADED

public static java.lang.String AMMO_LOADED
Constructor Detail

AgisItem

public AgisItem()

AgisItem

public AgisItem(OID oid)
Method Detail

convert

public static AgisItem convert(AOObject obj)

getAgisPermissionCallback

public AgisPermissionCallback getAgisPermissionCallback()

addEquipSlot

public void addEquipSlot(AgisEquipSlot equipSlot)
adds an equip mapping for this item. a mob can only equip this item if the slot if registered


setEquipSlots

public void setEquipSlots(java.util.List<AgisEquipSlot> equipSlots)

getEquipSlots

public java.util.List<AgisEquipSlot> getEquipSlots()

getPrimarySlot

public AgisEquipSlot getPrimarySlot()

equipSlotExists

public boolean equipSlotExists(AgisEquipSlot equipSlot)

itemEquipped

public void itemEquipped()
Called when an item has been equipped. Checks the binding value of the item and if it is bind on equip (1) it will bind the item to the player.


canBeTraded

public boolean canBeTraded()

setIcon

public void setIcon(java.lang.String icon)

getIcon

public java.lang.String getIcon()

setItemType

public void setItemType(java.lang.String itemType)

getItemType

public java.lang.String getItemType()

alterStackSize

public void alterStackSize(OID itemOwner,
                           int delta)
Use to change the number of items in the stack. If the item is in a standard inventory bag it will send the ItemAcquiredStatusChange so its effects can be re-applied.

Parameters:
itemOwner -
delta -

setStackSize

public void setStackSize(int stackSize)

getStackSize

public int getStackSize()

setStackLimit

public void setStackLimit(int stackLimit)

getStackLimit

public int getStackLimit()

setPurchaseCurrency

public void setPurchaseCurrency(int purchaseCurrency)

getPurchaseCurrency

public int getPurchaseCurrency()

setPurchaseCost

public void setPurchaseCost(int purchaseCost)

getPurchaseCost

public int getPurchaseCost()

bindToPlayer

public void bindToPlayer()

isPlayerBound

public boolean isPlayerBound()

setActivateHook

public void setActivateHook(ActivateHook hook)
register's the method to call when this item gets activated by the user


getActivateHook

public ActivateHook getActivateHook()

activate

public boolean activate(OID activatorOid,
                        OID targetOid)

addAcquiredHook

public void addAcquiredHook(AcquireHook hook)
registers the method to call when this item is acquired by the user


getAcquiredHooks

public AcquireHook getAcquiredHooks()

acquired

public boolean acquired(OID activatorOid)
Runs the AcquireHook for the item, returning false if the item is to be destroyed instead of adding it to the players bag.

Parameters:
activatorOid -
Returns:
should the item be destroyed

addUnacquiredHook

public void addUnacquiredHook(UnacquireHook hook)
register's the method to call when this item is acquired by the user


getUnacquiredHooks

public UnacquireHook getUnacquiredHooks()

unacquired

public boolean unacquired(OID activatorOid)
Called when a player no longer has an item in their inventory. Calls any unacquireHooks which can perform actions when this item is being removed from the player.

Parameters:
activatorOid -
Returns:


Copyright © 2018 Dragonsan Studios Sp. z o.o.