/datum/spellbook_entry

Wizard spellbooks are automatically populated with a list of every spellbook entry subtype when they're made.
Wizards can then buy entries from the book to learn magic, invoke rituals, or summon items.
Vars | |
buy_word | Flavor. Verb used in saying how the spell is aquired. Ex "[Learn] Fireball" or "[Summon] Ghosts" |
---|---|
category | What category the entry falls in |
cooldown | The cooldown of the spell |
cost | How many book charges does the spell take |
desc | The description of the entry |
limit | The limit on number of purchases from this entry in a given spellbook. If null, infinite are allowed. |
name | The name of the entry |
no_coexistance_typecache | Used so you can't have specific spells together |
refundable | Is this refundable? |
requires_wizard_garb | Whether the spell requires wizard garb or not |
spell_type | The type of spell that the entry grants (typepath) |
times | How many times has the spell been purchased. Compared against limit. |
Procs | |
buy_spell | Actually buy the entry for the user |
can_be_purchased | Determines if this entry can be purchased from a spellbook Used for configs / round related restrictions. |
can_buy | Checks if the user, with the supplied spellbook, can purchase the given entry. |
can_refund | Checks if the user, with the supplied spellbook, can refund the entry |
refund_spell | Actually refund the entry for the user |
set_spell_info | Set any of the spell info saved on our entry after something has occured |
Var Details
buy_word

Flavor. Verb used in saying how the spell is aquired. Ex "[Learn] Fireball" or "[Summon] Ghosts"
category

What category the entry falls in
cooldown

The cooldown of the spell
cost

How many book charges does the spell take
desc

The description of the entry
limit

The limit on number of purchases from this entry in a given spellbook. If null, infinite are allowed.
name

The name of the entry
no_coexistance_typecache

Used so you can't have specific spells together
refundable

Is this refundable?
requires_wizard_garb

Whether the spell requires wizard garb or not
spell_type

The type of spell that the entry grants (typepath)
times

How many times has the spell been purchased. Compared against limit.
Proc Details
buy_spell
Actually buy the entry for the user
Arguments
- user - the mob who's bought the spell
- book - what book they've bought the spell from
Return TRUE if the purchase was successful, FALSE otherwise
can_be_purchased
Determines if this entry can be purchased from a spellbook Used for configs / round related restrictions.
Return FALSE to prevent the entry from being added to wizard spellbooks, TRUE otherwise
can_buy
Checks if the user, with the supplied spellbook, can purchase the given entry.
Arguments
- user - the mob who's buying the spell
- book - what book they're buying the spell from
Return TRUE if it can be bought, FALSE otherwise
can_refund
Checks if the user, with the supplied spellbook, can refund the entry
Arguments
- user - the mob who's refunding the spell
- book - what book they're refunding the spell from
Return TRUE if it can refunded, FALSE otherwise
refund_spell
Actually refund the entry for the user
Arguments
- user - the mob who's refunded the spell
- book - what book they're refunding the spell from
Return -1 on failure, or return the point value of the refund on success
set_spell_info
Set any of the spell info saved on our entry after something has occured
For example, updating the cooldown after upgrading it