• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Spell] Metamorphosis to change hero's spells?

Status
Not open for further replies.
Level 13
Joined
May 9, 2009
Messages
735
I am trying to make a transformation spell that changes the abilities of the hero but it's not working out. I have the alternative hero's spells working fine when I place him alone, but when the normal hero morphs into him he retains the normal hero's spells. Is there a simple way to make metamorphosis give alternative spells to the hero or do I have to do with it triggers?
 
Triggers are a simple way

Unit casts the ability:

local unit u2u = GetCastingUnit()
call UnitRemoveAbility('myabil1',u2u)
call UnitRemoveAbility('myabil2',u2u)
call UnitAddAbility('myabil3',u2u)
call UnitAddAbility('myabil4',u2u)
call PolledWait(30)
call UnitRemoveAbility('myabil3',u2u)
call UnitRemoveAbility('myabil4',u2u)
call UnitAddAbility('myabil1',u2u)
call UnitAddAbility('myabil2',u2u)
set u2u = null
 
It's not as simple as that as that would only change the current spells of the hero. So when he morphs the spells he already unlocked are changed but he can still only pick the normal spells when he levels up resulting in both spells being available.

Is there a trigger to make the spells that are not yer learned change as well?
 
Couldn't you just add/remove hero abilities and they would behave that way? Then just set the level of the corresponding skill.

You could also use multiple units and Hide the original.
 
Status
Not open for further replies.
Back
Top