Class SpellService


  • public class SpellService
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SpellService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cast​(Spells spell)
      Clicks on a spell in the spellbook.
      Spellbook getCurrentSpellbook()
      Get the current active spellbook
      boolean hasRequiredRunes​(Spells spell)
      Returns true if the player has the required runes to cast the given spell.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpellService

        public SpellService()
    • Method Detail

      • cast

        public boolean cast​(Spells spell)
        Clicks on a spell in the spellbook. This method checks the following conditions before casting a spell: 1. Player is on the right spellbook 2. Player has the magic level required to cast the spell 3. Player has the required runes to cast the spell 4. Player has the required prayer to cast the spell (if applicable)
        Parameters:
        spell - The spell to be clicked.
        Returns:
        True if the cast was successful and false otherwise
      • hasRequiredRunes

        public boolean hasRequiredRunes​(Spells spell)
        Returns true if the player has the required runes to cast the given spell. This method checks both the inventory and the rune pouch for the required runes.
        Parameters:
        spell - The spell to check for required runes.
        Returns:
        true if the player has all required runes, false otherwise.
      • getCurrentSpellbook

        public Spellbook getCurrentSpellbook()
        Get the current active spellbook
        Returns:
        The currently active Spellbook