• 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.

capturing spellbook order/keep spellbook open

Status
Not open for further replies.
Level 27
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:
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