Yes it is possible. Take the "Channel" ability and change it so it would work like how you want your cleave to work (in regards of targeting, mana cost, cooldown, etc.). The ability will do nothing of course, you will have to trigger the damage part.
It's easy to calculate the damage of a hero, but you need to know a few things beforehand.
What you need to know are these fields from Object editor:
- Which one is primary stat of a hero
- Combat - Attack 1 (or Attack 2, whichever your hero uses) - Damage Base
- Combat - Attack 1 / 2 - Damage Number of Dice
- Combat - Attack 1 / 2 - Damage Side per Die
Hero's damage value looks like this: (lower_boundary up to upper_boundary) ... e.g. (10 - 20)
Hero's damage is calculated as follows:
Lower boundary: Primary_stat_amount * attack_bonus_constant + damage_base + number_of_dice
Upper boundary: Primary_stat_amount * attack_bonus_constant + damage_base + (number_of_dice * sides_per_dice)
The attack_bonus_constant is a constant found in gameplay constants (top bar menu in the editor -> Advanced -> Gameplay Constants -> Hero Attributes - Attack bonus per Primary Att. Point) and has default value 1.00 (so it can be omitted in the calculation unless you changed the value).
For example take the Paladin hero without doing any changes to him. He has these object editor values:
- Primary stat: Strength
- Combat - Attack 1 - Damage Base: 0
- Combat - Attack 1 - Damage Number of Dice: 2
- Combat - Attack 1 - Damage Sides per Die: 6
At level 1 the Paladin has 22 Strength. So the calculation is as follows:
Lower boundary: 22 * 1.00 + 0 + 2 = 24
Upper boundary: 22 * 1.00 + 0 + (2 * 6) = 34
So the damage for Paladin at level 1 is 24 - 34.
The same formula is used for all heroes.
Now you can get the value of a hero attribute via triggers, but you have no way to detect which attribute is primary attribute and also you have no way to detect the Combat - Attack fields I wrote about above, that's why you need to set them in variables beforehand. Below is the action for getting hero's attribute amount (including or excluding bonuses from items and abilities):
-
-------- These are "INTEGER" variables --------
-
Set agi = (Agility of some_unit (Include bonuses))
-
Set int = (Intelligence of some_unit (Exclude bonuses))
-
Set str = (Strength of some_unit (Exclude bonuses))
The only other problem here is that you need to manually detect when hero picks any items that increases his damage - for example Claws of Attack and other similar items.