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

[vJASS] Spellbook with multiple pages using an item

Status
Not open for further replies.
Level 28
Joined
Feb 2, 2006
Messages
1,630
Hello,
you might know the trick to hide and show icons in a spellbook by using this code:
JASS:
public method show take unit whichUnit returns nothing
call UnitAddAbility(whichUnit, this.spellbookAbilityId())
call SetPlayerAbilityAvailable(GetOwningPlayer(whichUnit), this.spellbookAbilityId(), false)
call SetUnitAbilityLevel(whichUnit, this.abilityId(), 1)
endmethod

public method hide takes unit whichUnit returns nothing
call UnitRemoveAbility(whichUnit, this.spellbookAbilityId())
endmethod
The spellbook ability must have the same ID as the shown spell book ability and only contain the ability which you want to add. This works fine when the visible spell book is an ability of the unit.

But I need this to work for an item which is carried by the unit. I tried the code above but it does not work. Nothing is shown in the spellbook. Is it even possible?
 
Status
Not open for further replies.
Top