HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making abilities stick

06-16-2006, 08:47 AM#1
The_AwaKening
I have a trigger to add an ability to a unit if he acquires an item.
Collapse JASS:
    if GetItemTypeId(GetManipulatedItem())=='gopr' then
        if UnitHasItem(GetManipulatingUnit(),GetManipulatedItem()) then
            call UnitAddAbility(GetManipulatingUnit(),'A040')
        else
            call UnitRemoveAbility(GetManipulatingUnit(),'A040')
        endif
        return
    endif
It works fine expcept for this. If it is a morphing hero such as alchemist, then he loses the ability when casting chemical rage "morphs". How do I make the ability to stick on them?
06-16-2006, 08:53 AM#2
MercyfulJester
By giving it to them again when they morph. Make a boolean, which tells if the hero has learned the ability. Then make a check every time Morph is cast and if the boolean is True, add the ability to the hero.
06-16-2006, 09:29 AM#3
blu_da_noob
Much easier way:
Collapse JASS:
call UnitMakeAbilityPermanent(GetManipulatingUnit(),true,'A040')
Put it after you add the ability (call it with false before removing the ability I guess, just to be safe).
06-16-2006, 04:57 PM#4
The_AwaKening
Ah thank you. I knew there was a way but wasn't sure of the command.