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

Changing Primary Attribute

Status
Not open for further replies.
Level 10
Joined
Aug 14, 2009
Messages
309
Is there a way of changing a hero's primary attribute, without replacing him with another unit?
OR
Is there a way to replace a hero without him loosing the buffs that he has and abilities added by triggers?
:vw_wtf:

I think the only way to do it is to replace the unit, like you've said yourself.

To change the hero add metamorphosis to it and make it cast it. The hero then changes into the other hero which has a different primary attribute.
If I'm not mistaking buffs get transfered automatically this way. Abilities should be added by the function
JASS:
MakeUnitAbilityPermanent(unit, abilID)
or something like that, just make sure to set it to permanent.

By the way, maybe you want to hide the metamorphosis button, to do this you should give the hero a spellbook with the metamorphosis in it and disable the use of the spellbook ability for the player (you can do this with a trigger action).
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It does if the hero you morph in has a different primary attribute set. Its on off the hero's units statistics.

Have you even try this yet ?
You must try before giving people false information

I have already tested it, passive transformation or whatever does work (changing the unit into something else, stats and all) but one thing cannot be changed, its Primary Attribute.

I tried changing a Paladin (STR) to a Blood Mage (INT), the process does occur but its Primary Attribute remains STR.


I suggest you should stick to the Replace unit function or another method is to hide 2 dummy Heroes in the map, when STR uses ability to convert to AGI, AGI Hero would be unhide and hide the STR Heroes.

It's more efficient than replacing unit over and over again as the game will leak of units (the system can no longer uphold the memory of replaced units)
 
Status
Not open for further replies.
Top