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

Giving ability to morphed units

Status
Not open for further replies.
Level 11
Joined
Jul 17, 2013
Messages
544
Hi i have an ability that can give another passive ability to unit for duration, but the issue is that if u give it to the unit that morphed, then after morph ends the orginal unit doesnt have this skill anymore. Any idea how to fix it??
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,892
JASS:
UnitMakeAbilityPermanent     takes unit whichUnit, boolean permanent, integer abilityId returns boolean
When you want toadd your desired ability you make
JASS:
call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'AHbz')
Note that it doesn't need to be the triggering unit. You can simply create a unit variable like "MyUnit", set it to your desired unit and then use "udg_MyUnit" inside the custom script. 'AHbz' is the raw code of blizzard ability, change it to your custom ability by toggling CTRL + D and see the raw code along with the ability name.
 
Status
Not open for further replies.
Top