- Joined
- Feb 2, 2006
- Messages
- 1,577
Hello there,
for my custom grimoire system I use the spellbook ability from Warcraft. Unfortunately, whenever I remove spells from the spellbook (using another spellbook ability with the same id as described here: http://www.wc3c.net/showthread.php?t=81742) it closes the spellbook which I want to prevent.
Besides I am not able to capture any order id when I click on the spellbook so I don't know how to trigger reopening it manually.
For removing abilities from spellbook I simply call:
where grimoireAbility() returns the ability id of the spellbook ability with the same id but only the one single spell which should be removed from the spellbook.
Adding works like this:
for my custom grimoire system I use the spellbook ability from Warcraft. Unfortunately, whenever I remove spells from the spellbook (using another spellbook ability with the same id as described here: http://www.wc3c.net/showthread.php?t=81742) it closes the spellbook which I want to prevent.
Besides I am not able to capture any order id when I click on the spellbook so I don't know how to trigger reopening it manually.
For removing abilities from spellbook I simply call:
JASS:
call UnitRemoveAbility(this.grimoire().character().unit(), this.grimoireAbility())
Adding works like this:
JASS:
call UnitAddAbility(this.grimoire().character().unit(), this.grimoireAbility())
call SetPlayerAbilityAvailable(this.grimoire().character().player(), this.grimoireAbility(), false)
call SetUnitAbilityLevel(this.grimoire().character().unit(), this.ability(), 1)