how to make a % damage taken to transfered to other unit?

aredee

New Member
Reaction score
2
i want to make a spell that makes "when activated, all hero nearby caster will only take 50% damage, while the other 50% damage will be transferred (suffered) to the caster"

i made a trigger like this
Code:
event
a unit is attacked
condition
attacked unit equal to guarded_hero (a variable i created in a trigger with "a unit start the effect of ability", this variable refers to the hero nearby the caster)
action
unit - set life of guarded_hero to (life of guarded_hero + (1/2xdamage taken))
unit - set life of guardian (a variable refer to the caster of the skill) to (life of guarded hero - (1/2xdamage taken))

and it's failed, after few try, i notice that "event response - damage taken" in real only respond for event using "damage taken", and damage taken can only be used in "spesific unit event", but the target is not in the map yet

can anyone help me solve this??
 

Faust

You can change this now in User CP.
Reaction score
123
Dynamic Damage system. Or something like that. Search.
 

Romek

Super Moderator
Reaction score
963
I made a spell which does exactly this. I'm not bothered to release it yet.

I'll explain it to you though:
Lets say 'T' is the unit who will take less damage and 'U' is the unit which will take the damage for the target.
You use damage detection system to check when 'T' takes damage. When it does get the Damage taken ('D'), and multiply it by however much you want to have it reduced by. Then restore that amount to T. You'll then multiply D by ( 1 - Reduction Percentage), to get the remaining damage. Then you simply set U's HP to it's current HP - that amount.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top