benilla-re systems structs docs

GetSpellPowerCost

function · spell · primitive

Address
0x6e31b0 · 335 bytes, up to 0x6e32fe
Signature
int32_t __fastcall (uint32_t spellId, uint32_t pet)
Meaning
Computes a spell's power cost from level, percentage, the school cost fields and op 14
Confidence
verified, proof one
Finding
spell/records#power-cost
Test
spell::spell_power_cost_difftest

Finding: Power cost in spell: records

0x6e31b0(spellId, pet) returns −1 without a record or caster. Else, with L the level from slot 42 over 5: c = (L − base)·perLevel + cost from +0x70, +0x84, +0x80; if +0x270 is nonzero, c += P·pct/100 with P from 0x612c50 for the power type +0x7c (base mana for 0, base health for −2, 1000 for 1, 100 for 2 and 3, else 0). Then c += M[s] and c = rint((float)((1.0 + K[s])·c)) for the school s at +0x04, M and K the unit's int32_t at +0x29c and float at +0x2b8; c ≤ 0 gives 0; then the integer applier with op 14, unclamped.

The derivation is in the doc.

Callers 5

Callees 4

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