• 🏆 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!

[Spell] Adding and removing abilities question.

Status
Not open for further replies.
Level 13
Joined
May 10, 2009
Messages
868
What do you mean? I couldn't understand you, sorry. Perhaps this might be helpful:
JASS:
    native UnitAddAbility takes unit whichUnit, integer abilityId returns boolean
    native UnitRemoveAbility takes unit whichUnit, integer abilityId returns boolean
JASS:
    call UnitAddAbility( udg_MyUnit, 'A000' )
    call UnitRemoveAbility( udg_MyUnit, 'A000' )
  • Custom script: call UnitAddAbility( udg_MyUnit, 'A000' )
  • Custom script: call UnitRemoveAbility( udg_MyUnit, 'A000' )
I think you already know how to get/see Raw Code of abilities. (If not, then go to object editor and press: Ctrl + D)
 
Level 11
Joined
Nov 15, 2007
Messages
781
Since he said hero ability, I assume he wants this. Test map because this bug/feature is sortof hard to explain.
 

Attachments

  • abilitytest.w3x
    19.1 KB · Views: 82
Level 11
Joined
Nov 15, 2007
Messages
781
Thank you very much, you are always helpful. But a question : why in that map when removing the ability instantly it works but in my it doesn't?

You need to use the Engineering Upgrade ability to switch the removed ability with a disabled one. Otherwise removing a hero ability will just unlearn it and add it back to your learnable skills.
 
Status
Not open for further replies.
Top