How can i make a spell that when a hero kills a unit to increase the damage of the killing unit by +2.. And max damage to be 60... And when the hero dies that damage to be halved...??
Create a 60-level damage bonus ability and set the bonus field of a level to that level. (lvl 1 = 1, lvl 2 = 2, ...)
Trigger below increases the damage by 2, and halves it when the unit is dead (by using the ability).
Trigger:
Events
Unit - A unit Dies
Actions
Set level = ((Level of Damage Bonus for (Dying unit)) / 2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
level Greater than 0
Then - Actions
Unit - Set level of Damage Bonus for (Dying unit) to level
Else - Actions
Unit - Remove Damage Bonus from (Dying unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Killing unit) Not equal to No unit
Then - Actions
Set level = (Level of Damage Bonus for (Killing unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
level Equal to 0
Then - Actions
Unit - Add Damage Bonus to (Killing unit)
-------- You may need to call UnitMakeAbilityPermanent in order to make the damage bonus persist regardless of morphs. --------
Else - Actions
Unit - Set level of Damage Bonus for (Killing unit) to (level + 2)
Else - Actions
Add appropriate conditions to filter the target unit. Decimal part is discarded, and I don't think there is any straightforward ways to deal with it. Also, I suggest you to preload that bonus ability by using a dummy preplaced unit.