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

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 28
Joined
Nov 18, 2012
Messages
1,993
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