java.lang.Object
games.stendhal.server.core.rule.defaultruleset.DefaultItem

public class DefaultItem extends Object
All default items which can be reduced to stuff that increase the attack point and stuff that increase the defense points.
Author:
Matthias Totz, chad3f
  • Constructor Details

    • DefaultItem

      public DefaultItem(String clazz, String subclazz, String name, int tileid)
  • Method Details

    • setWeight

      public void setWeight(double weight)
    • getWeight

      public double getWeight()
    • getAttributes

      public Map<String,​String> getAttributes()
    • setAttributes

      public void setAttributes(Map<String,​String> attributes)
    • setEquipableSlots

      public void setEquipableSlots(List<String> slots)
    • getEquipableSlots

      public List<String> getEquipableSlots()
    • setDescription

      public void setDescription(String text)
    • getDescription

      public String getDescription()
    • setDamageType

      public void setDamageType(String type)
    • setSusceptibilities

      public void setSusceptibilities(Map<String,​Double> sus)
      Set the susceptibilities. The key of each map entry should be a string corresponding to a damage type. The value is the susceptibility value of that damage type. The content of the mapping is copied, so it can be safely modified afterwards.
      Parameters:
      sus - susceptibility mapping
    • initializeActiveSlotsList

      public void initializeActiveSlotsList(String slots)
      Add slots to list where SlotActivatedItem can be activated when equipped.
      Parameters:
      slots - String list of slots separated by semicolon
    • initializeStatusResistancesList

      public void initializeStatusResistancesList(Map<String,​Double> res)
      Set the types of status attacks that this StatusResistantItem can resist.
      Parameters:
      res - The status type and the resistance value
    • setImplementation

      public void setImplementation(Class<?> implementation)
    • setBehavior

      public void setBehavior(UseBehavior behavior)
      Set the use behavior.
      Parameters:
      behavior - new behavior
    • getImplementation

      public Class<?> getImplementation()
    • buildCreator

      protected AbstractCreator<Item> buildCreator(Class<?> implementation)
      Build a creator for the class. It uses the following constructor search order:
      • Class(name, clazz, subclazz, attributes)
      • Class(attributes)
      • Class()
      Parameters:
      implementation - The implementation class.
      Returns:
      A creator, or null if none found.
    • getItem

      public Item getItem()
      Returns an item-instance.
      Returns:
      An item, or null on error.
    • getTileId

      public int getTileId()
      Returns:
      the tile id .
    • setTileId

      public void setTileId(int val)
    • setValue

      public void setValue(int val)
    • getValue

      public int getValue()
    • getItemClass

      public String getItemClass()
      Returns:
      the class.
    • setItemClass

      public void setItemClass(String val)
    • getItemSubclass

      public String getItemSubclass()
      Returns:
      the subclass.
    • setItemSubclass

      public void setItemSubclass(String val)
    • getItemName

      public String getItemName()
    • setItemName

      public void setItemName(String val)
    • toXML

      public String toXML()