java.lang.Object
com.realtime.crossfire.jxclient.spells.Spell

public class Spell extends Object
Describes a Crossfire spell.
  • Constructor Details

    • Spell

      public Spell(@NotNull @NotNull String name, @NotNull @NotNull SkillSet skillSet, @NotNull @NotNull Stats stats)
      Creates a new instance.
      Parameters:
      name - the spell name
      skillSet - the skills
      stats - the stats instance
  • Method Details

    • getTag

      public int getTag()
      Returns the tag ID.
      Returns:
      the tag ID
    • getLevel

      public int getLevel()
      Returns the spell level.
      Returns:
      the spell level
    • getCastingTime

      public int getCastingTime()
      Returns the casting time.
      Returns:
      the casting time
    • getMana

      public int getMana()
      Returns the mana needed to cast the spell.
      Returns:
      the mana
    • getGrace

      public int getGrace()
      Returns the grace needed to cast the spell.
      Returns:
      the grace
    • getDamage

      public int getDamage()
      Returns the damage done by the spell.
      Returns:
      the damage
    • getSkill

      public int getSkill()
      Returns the spell's skill. See Stats.CS_STAT_SKILLINFO.
      Returns:
      the spell's skill
    • getPath

      public int getPath()
      Returns the spell path.
      Returns:
      the spell path
    • getName

      @NotNull public @NotNull String getName()
      Returns the spell name.
      Returns:
      the spell name
    • getMessage

      @NotNull public @NotNull String getMessage()
      Returns the description.
      Returns:
      the description
    • getFaceNum

      public int getFaceNum()
      Returns the face number.
      Returns:
      the face number
    • isUnknown

      public boolean isUnknown()
      Returns whether this spell is unknown to the character.
      Returns:
      whether this spell is unknown
    • setUnknown

      public void setUnknown(boolean unknown)
      Marks this spell as known or unknown for the character.
      Parameters:
      unknown - whether this spell is unknown
    • setParameters

      public void setParameters(int faceNum, int tag, @NotNull @NotNull String message, int level, int castingTime, int mana, int grace, int damage, int skill, int path)
      Updates the spell's parameters.
      Parameters:
      faceNum - the face number
      tag - the tag ID
      message - the description
      level - the spell level
      castingTime - the casting time
      mana - the mana needed to cast the spell
      grace - the grace needed to cast the spell
      damage - the damage done by the spell
      skill - the spell's skill
      path - the spell path
    • updateParameters

      public void updateParameters(boolean updateMana, int mana, boolean updateGrace, int grace, boolean updateDamage, int damage)
      Updates the spell's parameters.
      Parameters:
      updateMana - whether to update the mana
      mana - the mana needed to cast the spell
      updateGrace - whether to update the grace
      grace - the grace needed to cast the spell
      updateDamage - whether to update the damage
      damage - the damage done by the spell
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object
    • getTooltipText

      @NotNull public @NotNull String getTooltipText()
      Returns a description for this spell to be used in tooltips.
      Returns:
      the tooltip text
    • addSpellListener

      public void addSpellListener(@NotNull @NotNull SpellListener listener)
      Adds a SpellListener to be notified of changes.
      Parameters:
      listener - the listener to add
    • removeSpellListener

      public void removeSpellListener(@NotNull @NotNull SpellListener listener)
      Removes a SpellListener to be notified of changes.
      Parameters:
      listener - the listener to remove