Unit Takes Damage Trigger, Why doesnt this work? +rep for help!

Furberg

Ultra Cool Member
Reaction score
45
So i am trying to make a Unit Takes damage kind of trigger. It doesnt work at all, i dont even regenerate the HP when attacked. Here are both triggers:

Code:
Protection
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Unholy Protection 
    Actions
        Set unitProtected = (Triggering unit)
        Set integerDamage = 0
        Trigger - Add to Return damage <gen> the event (Unit - unitProtected Takes damage)
        Wait 4.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (unitProtected has buff Unholy Protection ) Equal to True
            Then - Actions
                Unit Group - Pick every unit in (Units within 500.00 of (Position of unitProtected) matching (((Matching unit) belongs to an enemy of (Owner of unitProtected)) Equal to True)) and do (Actions)
                    Loop - Actions
                        Unit Group - Add (Picked unit) to DamageGroup
                Set unitChosen = (Random unit from DamageGroup)
                Unit - Move unitProtected instantly to (Position of unitChosen)
                Special Effect - Create a special effect at (Position of unitChosen) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                Special Effect - Destroy (Last created special effect)
                Unit - Cause unitProtected to damage unitChosen, dealing ((Real(integerDamage)) x (Real((Level of Unholy Protection  for unitProtected)))) damage of attack type Spells and damage type Normal
            Else - Actions
                Do nothing

Code:
Return damage
    Events
    Conditions
        (unitProtected has buff Unholy Protection ) Equal to True
    Actions
        Unit - Set life of unitProtected to ((Life of unitProtected) + (Damage taken))
        Set integerDamage = (integerDamage + (Integer((Damage taken))))

Please help, i will +rep you ^^ (what everybody wants :p):
 

und34d-rul3

New Member
Reaction score
12
At the beginning of the protection trigger try Casting Unit instead of Triggering unit, only thing I could think of. Also when does the buff expire? If it expires in 4 seconds then maybe when you check to see if the unit has the buff after waiting 4 seconds it returns flase - Add something to the else like a message for testing purposes only.
 

Furberg

Ultra Cool Member
Reaction score
45
At the beginning of the protection trigger try Casting Unit instead of Triggering unit, only thing I could think of. Also when does the buff expire? If it expires in 4 seconds then maybe when you check to see if the unit has the buff after waiting 4 seconds it returns flase - Add something to the else like a message for testing purposes only.

Aaah all i needed! thanks!!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top