• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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