• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] Cavalry Mana Unit

Level 11
Joined
Sep 30, 2017
Messages
169
I want to create a special unit for my project; it is based upon the idea of Hecarim's E ability from League of Legends, but it is a passive. Basically, this unit has 100 max mana, but like the undead destroyer, it has mana degeneration (-2.0). When this unit moves, it gathers mana (like 2.5 or 3 per 0.25 seconds). When the unit goes into attack and has 90 or more mana, it will deal bonus damage and stun the target for 2 seconds.

It sounds like a lot, but I want to know if this passive ability is possible.
 
1) "Unit is issued an order" event trigger, where you check if the order is move and then add the unit to a Unit Group. Turn on the loop trigger at number 3.
2) "Unit is issued an order" event trigger, where you check if the order isn't move, and then remove the unit from the Unit Group if it's not. Check to see if the Unit Group is empty, and if it is, turn off loop trigger at number 3.
3) A periodic loop trigger that goes through the unit group every 0.25 seconds and adds the mana.
4) "Unit is damaged" event trigger (assuming you're on latest patch, otherwise you'll have to use a damage engine for versions before 1.33), which checks if the unit has enough mana and if it does, sets the damage to a higher value and creates a dummy unit to stun the target.

This is the basic gist, you'll have to add some more conditions depending on what you're doing exactly and to optimize, but the ability you're trying to create is very possible.
 
Can you post the triggers? I'm lost with this.

Update: Still wanting, but I was playing a custom map with a unique tech tree by Yours Truly TC#14 Seraphic Union. He created a unit called "cavalier" with an ability called "trample." I believe this is the exact unit system I want to create, but I have no idea how to create something like this.
 
Last edited:
You can use this system to tell you whether a unit is moving or not:

Then you could periodically Add mana to your Knights as well as Add/Remove the Bash ability based on their current mana. Something like this:
  • Every 0.25 seconds
  • Pick every unit in KnightUnitGroup and do (Actions)
  • Set Variable UDex = (Custom value of (Picked unit))
  • If UnitMoving[UDex] Equal to true then Set (Picked unit) Mana = Mana + 5
  • If (Picked unit) current Mana >= 90 then Add Bash ELSE Remove Bash.

Then search Hive for tutorials on how to use the Periodic Interval event, Unit Groups, If Then Else statements, and anything else that you're having trouble with. Then open the demo map to find example triggers for working with the custom movement Event.

Edit: I attached an updated version of that system, it was using an out of date Unit Indexer. You should use this map instead.
 

Attachments

Last edited:
Back
Top