• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

capturing spellbook order/keep spellbook open

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,689
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:
JASS:
call UnitRemoveAbility(this.grimoire().character().unit(), this.grimoireAbility())
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:
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)
 
Status
Not open for further replies.
Top