• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

ABILITY_SLF_SPELL_LIST not work?

Level 2
Joined
Jul 21, 2024
Messages
2
I wanted to dynamically modify spell list of spellbook with BlzSetAbilityStringLevelField, but it just do nothing with ABILITY_SLF_SPELL_LIST field.
code is like this, A003 is spellbook.
Lua:
local a = BlzGetUnitAbility(u, FourCC('A003'))
print(BlzGetAbilityStringLevelField(a, ABILITY_SLF_SPELL_LIST, 0))

IncUnitAbilityLevel(u, FourCC('A003'))
BlzSetAbilityStringLevelField(a, ABILITY_SLF_SPELL_LIST, 0, '')
DecUnitAbilityLevel(u, FourCC('A003'))

print(BlzGetAbilityStringLevelField(a, ABILITY_SLF_SPELL_LIST, 0))
 
Yeah, looks like that native doesn't work for that field. Bummer. I tried testing it with a few variants as well (BlzSetAbilityStringLevelArrayField) but that didn't work either.

You'll probably have to update the spells in the spellbook the old-school way:

The TL;DR is that you need to make a new spellbook for each spell you want to dynamically add, and then make sure the "Data - Base Order Id" is the same as the spellbook you want to add it to. Next, disable those spellbooks for all players via code (e.g. map init). Finally, when you want to add a specific ability to your main spellbook--add the disabled spellbook containing that ability instead. Similarly, if you want to remove that ability, just remove the disabled spellbook ability from the unit.
 
Top