benilla-re systems structs docs

AddSpellToBook

function · ui · primitive

Address
0x4b25b0 · 1535 bytes, up to 0x4b2bae
Signature
void __fastcall (uint32_t spellId, bool live, uint32_t oldId)
Meaning
Marks a spell known, prints its learn line and enters it in its tab of the book
Confidence
verified, proof one
Finding
ui/spellbook#adding-a-spell

Finding: Adding a spell in ui: the spell book

0x4b25b0(id, live, old) adds a learned spell to the book. It rejects an id outside the Spell table and sets the id's bit in the known set. It records a few spells by their first effect (effects 83, 84, 95 and 116 in four globals, 39 into a table by misc value, 33 into a list) and updates three more lists (dispel types 0xb71110, ui/reactivespells, ui/petbar#form-list). Past that, a spell with Attributes & 0x80 goes no further. A spell with Attributes & 0x20 (a trade skill spell) prints its learn line when live is set and goes no further. Any other prints its line when live is set, and enters the book unless its CastUI field (+0xc) is above 0.

The derivation is in the doc.

Callers 2

Callees 25

Calls and jumps by a bare address, from tables/calls.tsv.