Thats what I tried before
But the problem with it is that in this case, it doesn't consider that the caster unit damaged the target unit.
So, if the enemy dies, the killing player/unit gains no credit.
Unless I check unit life every time before I do the life change, and if it is lesser than the damage that will be dealt, the unit will die and credit will go to the owner of casting unit. It works, but... I believe there should be an easier way to do it, like in WC3 editor (Unit damage unit) action.
You could create a new ability for the unit that does the damage you want to deal, then issue the order to use the ability through triggers. Abilities don't need to be on the command card for the trigger editor to use so the user will never be able to access it.
You need a dummy damage effect and use the Catalog Field Set function. Here's an example from my map where I want to reflect damage back at the attacker. ReflectiveArmor is the dummy damage effect and the variable Reflective is how many levels of that ability the hero has.
How can I do it? Like when a spell X is cast, the triggering unit will deal Y damage to the target of the ability (in a trigger)
@Aztron: Go
Replace Frenzy by your spell, and change the value of Y, and you should be good to go (Unless I misunderstood you totally, of course ;D)
@Moooyaah: Go
Thats what I tried before But the problem with it is that in this case, it doesn't consider that the caster unit damaged the target unit. So, if the enemy dies, the killing player/unit gains no credit.
Unless I check unit life every time before I do the life change, and if it is lesser than the damage that will be dealt, the unit will die and credit will go to the owner of casting unit. It works, but... I believe there should be an easier way to do it, like in WC3 editor (Unit damage unit) action.
@Aztron: Go
You could create a new ability for the unit that does the damage you want to deal, then issue the order to use the ability through triggers. Abilities don't need to be on the command card for the trigger editor to use so the user will never be able to access it.
@Aztron: Go
You need a dummy damage effect and use the Catalog Field Set function. Here's an example from my map where I want to reflect damage back at the attacker. ReflectiveArmor is the dummy damage effect and the variable Reflective is how many levels of that ability the hero has.
@Elemeno: Go
It doesn't work the way I want because the damage is variable based on unit attribute. (Think Spell Power in WoW)
@ProxyTooMuch: Go
This is exactly what I want, thank you much :D
But I still think blizz should just put back the Order Unit to Damage Unit action in trigger.
Thanks, just what I needed.
Any data editor only solution?