| name | description |
|---|---|
| wiki_verify_spells | Instructions for comparing spells and spellbooks in GnollHackWiki with the GnollHack C code data structures (objclass and SPELL macro) to spot mistakes in the documentation. |
When verifying spells and spellbooks on the GnollHackWiki against the GnollHack C code, you must compare the item's documentation with the struct objclass defined in include/objclass.h and the data instantiated via the SPELL macro in src/objects.c.
Important Rules
-
NEVER compare item weights. Do not check or update
oc_weightor the weight listed on the wiki. - Mana Cost Formatting: Mana costs under 100 have a single digit (e.g., 4.0), while mana costs of 100 and more have 0 digits (e.g., 160).
- Pay attention to which kind of data is present in
struct objclassand theSPELLmacro.
Data Sources
Spells and spellbooks are defined together in src/objects.c using the SPELL macro. The SPELL macro arguments populate the struct objclass for the spellbook object. The player's runtime spell knowledge is tracked using struct spell (include/spell.h), but static properties for documentation are found in the SPELL macro.
SPELL Macro Structure
SPELL(name, desc, effectdesc, contentdesc, itemdesc, skill, prob, learndelay, cooldown, \
level, manacost, attr, range, radius, skillchance, savingthrowadj, mgc, dir, dirsubtype, extraspelldata, \
sdice, sdam, sdmgplus, ldice, ldam, ldmgplus, \
sflags, sflags2, mflags, adtype, color, soundset, flags, flags2, flags3, flags4, flags5, flags6)
What to Compare
1. General Spell Properties
-
Level: Compare with the
levelargument (maps tooc_spell_level/oc_oc2). -
Mana Cost: Compare with the
manacostargument (maps tooc_spell_mana_cost/oc_oc3). -
Spell Category / Skill: Compare with the
skillargument (e.g.,P_ATTACK_SPELL,P_HEALING_SPELL; maps tooc_skill). -
Base Attribute: Compare with the
attrargument (e.g.,A_INT,A_WIS; maps tooc_spell_attribute/oc_oc4). -
Cooldown: Compare with the
cooldownargument (maps tooc_spell_cooldown/oc_oc1).
2. Spell Effects (Damage, Duration, Range)
-
Range: Compare with the
rangeargument (maps tooc_spell_range/oc_oc5). -
Radius: Compare with the
radiusargument (maps tooc_spell_radius/oc_oc6). -
Damage (Base): Compare with
sdice,sdam(die size), andsdmgplus. (maps tooc_spell_dmg_dice,oc_spell_dmg_diesize,oc_spell_dmg_plus). -
Damage (Per Level) / Duration: Compare with
ldice,ldam, andldmgplus. Depending on the spell, this represents per-level scaling or duration (maps tooc_spell_per_level_dice, etc.). -
Directionality: Compare with the
dirargument (e.g.,RAY,IMMEDIATE,NODIR; maps tooc_dir).
3. Spellbook Properties
-
Base Cost: Spells calculate cost dynamically based on level:
(level + 2) * 10 + (level + 1) * (level + 1) * 2 + 10. Verify the wiki price matches this formula. -
Reading Delay: Compare with the
learndelayargument (maps tooc_delay). -
Color/Description: Compare with the
descargument (e.g., "parchment", "silver-plated").
How to Verify
- Locate the spell in
src/objects.c(search forSPELL("spell_name"). - Map the macro arguments to the properties listed above.
- Check the wiki page for the spell and its corresponding spellbook to spot discrepancies.