IsSpellUsable
function · spell · primitive
- Address
0x6e3d60· 666 bytes, up to0x6e3ff9- Signature
uint8_t __fastcall (const void *rec, uint32_t *noPower)- Meaning
- Tests twelve ordered gates for the active player using a spell; sets noPower only when the power gate fails
- Confidence
- verified, proof one
- Finding
- spell/checks#usability-predicate
Finding: Usability predicate in spell: checks
0x6e3d60(rec, &noPower) returns 1 when the active player can use the spell now, else 0, and
reports nothing. It clears noPower, returns 0 when there is no active player object, and returns
1 at once when the first effect is 47. Otherwise it applies these gates in order; the first that
fails returns 0:
| # | fails when |
|---|---|
| 1 | 0x605f30 is true and Attributes & 0x800000 is clear |
| 2 | 0xb4b3e4 is zero and no scan exempts the spell (Lost control exemption) |
| 3 | 0x6e4000(player, rec, 0) returns 0 |
| 4 | 0x6e40e0(player, rec, ammo 1, report 0) returns 0 |
| 5 | AttributesEx & 0x500000 and PLAYER_FIELD_BYTES byte 1 is 0 |
| 6 | the form test 0x612480 returns 0 |
| 7 | Attributes & 0x20000 and UNIT_FIELD_BYTES_1 byte 3 lacks 2 |
| 8 | Attributes & 0x10000000 and UNIT_FIELD_FLAGS & 0x80000 |
| 9 | CasterAuraState n is nonzero and bit n−1 of UNIT_FIELD_AURASTATE is clear |
| 10 | TargetAuraState n is nonzero and: no unit at 0xb4e2d8, its bit n−1 clear, first implicit target 6 and 0x606980 false, or 21 and 0x6066f0 false |
| 11 | Attributes & 0x2000000 and 0x6e2fa0(rec, 0) is nonzero |
| 12 | the cost 0x6e31b0(id, 0) exceeds the power (signed); sets noPower to 1 |
The power is UNIT_FIELD_HEALTH for power type −2, else UNIT_FIELD_POWER1 plus the type.
The derivation is in the doc.
Callers 3
Callees 13
- ClntObjMgrObjectPtr objectlayer
- ClntObjMgrGetActivePlayer objectlayer
- IsDeadOrGhost objectlayer
- CGUnit_C::CanAssist_Unit objectlayer
- CGUnit_C::CanAttack objectlayer
- CheckSpellShapeshiftForm objectlayer
- IsSpellCooldownOnHold spell
- GetSpellPowerCost spell
- CheckSpellTotemsAndReagents spell
- CheckSpellEquippedItem spell
- ScanFearAuras spell
- ScanConfuseAuras spell
- ScanCharmAuras spell
Calls and jumps by a bare address, from tables/calls.tsv.