Is there a way to set a variable equal to a unit's dmg?

Reaction score
86
The unit has to attack first. That and the damage varies depending on armor type and weapon types. Before the unit attacks, you make a trigger with this-

Trig 1
Events-
Conditions-
Actions-
Set VariableWhatever = (DamageTaken)
Custom Script: "call ResetTrigger(GetTriggeringTrigger())"

Then, in the another trigger, whenever the specific unit attacks Ex.

Events-
A unit is attacked
conditions-
Attacking unit == Hero1 (or w/e)
Actions-
Trigger Add Event (Attacked Unit) takes damage to Trig1

Then Variable whatever is set to the damage given by Hero1.

I used a custom script so that you can reuse Trig1 to set dmgs from a bunch of sources, otherwise, put a condition for a specific unit deals the damage.
 
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