HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to make a multi-ability passive hero skill in GUI

08-14-2008, 11:36 AM#1
Anitarf
This quick tutorial explains how to make a hero skill that has the effect of multiple passive abilities; for example, an ability that increases the hero's attack speed (done by abilities such as the one on gloves of haste) and attack damage (done by abilities such as the one on claws of attack).

First of all, we need to check which of our abilities display icons. Most passive item abilities don't display an icon on the unit's command card, which is a blessing because we only want one icon on our hero when he learns this skill. If multiple of the abilities we want to combine use display icons, then we need to hide them with the disabled spellbook trick, which I won't explain here, but in the Ability Guide here. If, on the other hand, none of our abilities show an icon, such as in the example above, we'll need to add a dummy passive ability that does display an icon to our list.

Not all of the abilities that we want to combine have to be passive, we can have one activated ability as well, for example if we want to make an ability that slowly regenerates the hero's life (done by abilities such as the one on ring of regeneration) but can also be used to instantly heal a target unit (like holy light). In that case, the active ability is that one that will display an icon, and all the passives will have to be of the type that don't.

Be careful, some abilities can't be used like this due to bugs in WC3. The bonus life and mana passive abilities used by items such as pendant of mana can't be used with multiple levels (unless they have the same value for each level), unless your map doesn't have a tome of retraining (those abilities only bug when removed from the unit when they're at a level higher than 1). Some abilities also don't level up properly at all.

So, once we have a bunch of abilities selected which we want to add to our hero as one passive hero skill, here's what we do:
  • Give all of the abilities the same number of levels.
  • Make the one ability that displays the icon a hero ability, and make all the rest unit abilities.
  • Give the hero ability proper tooltips and give it to the hero in the object editor.
  • Create the following triggers in the trigger editor:
Trigger:
PassiveAbility Learn
Collapse Events
Unit - A unit Learns a skill
Collapse Conditions
(Learned Hero Skill) Equal to HeroPassiveAbility
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of HeroPassiveAbility for (Triggering unit)) Equal to 1
Collapse Then - Actions
Unit - Add UnitAbility1 to (Triggering unit)
Unit - Add UnitAbility2 to (Triggering unit)
Collapse Else - Actions
Unit - Set level of UnitAbility1 for (Triggering unit) to (Level of HeroPassiveAbility for (Triggering unit))
Unit - Set level of UnitAbility2 for (Triggering unit) to (Level of HeroPassiveAbility for (Triggering unit))
Trigger:
PassiveAbility Retrain
Collapse Events
Unit - A unit Uses an item
Collapse Conditions
(Item-type of (Item being manipulated)) Equal to Tome of Retraining
Collapse Actions
Unit - Remove UnitAbility1 from (Triggering unit)
Unit - Remove UnitAbility2 from (Triggering unit)
08-14-2008, 11:47 AM#2
Pyrogasm
Short, sweet, and inspired by IRC.
10-04-2008, 11:18 AM#3
PitzerMike
Added a reference to an explanation of the disabled spellbook trick and approved.