benilla-re systems structs docs

SpellRangeRec

struct · dbc · 88 bytes

Meaning
Holds one SpellRange.dbc row: id, minimum and maximum range, flags and names
Confidence
inferred
Finding
spell/records#range

Finding: Range in spell: records

GetMinMaxRange(caster, spellId, &min, &max, target) zeroes both and returns for a null caster or no record, or with max = 100.0 for +0x18 & 0x404. target is a unit when its type has bit 3. With R(u) a unit's float at unit field +0x1f0: a SpellRange row (+0x90) with flag bit 0 sets min = 0 and max = S if S = R(t) + R(caster) + 4/3 > 5.0, else 5.0, t being the unit target, else the unit whose guid is at caster +0xc48, else the caster. Another row copies its +0x04 and +0x08; a target of type bit 3 or 7 adds R(caster) + R(unit target, else caster) to max, and to min unless min == 0.

The derivation is in the doc.

Fields 3

offsetsizetypenamemeaningconfidencefinding
0x00044floatm_rangeMinHolds the minimum range, copied when flag bit 0 is clearverified, proof onespell/records#range
0x00084floatm_rangeMaxHolds the maximum range, copied when flag bit 0 is clearverified, proof onespell/records#range
0x000c4uint32_tm_flagsHolds flags; bit 0 selects the reach-based rangeverified, proof onespell/records#range