Remove Friendly Fire From My Spell Trigger

Manee

New Member
Reaction score
20
Code:
Triple Strafe Copy
    Events
        Unit - A unit Is attacked
    Conditions
        (Level of Triple Strafe  for (Attacking unit)) Equal to 1
        (Current research level of Triple Strafe  for (Owner of (Attacking unit))) Equal to 1
    Actions
        Set TripleStrafeInteger = (Random integer number between 1 and 100)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TripleStrafeInteger Less than or equal to (20 x (Level of Triple Strafe  for (Attacking unit)))
            Then - Actions
                Set TripleStrafeAllies = (All allies of (Owner of (Attacking unit)))
                Set TempPoint = (Position of (Attacking unit))
                Player Group - Pick every player in TripleStrafeAllies and do (Set TripleStrafeTarget = (Random 2 units from (Units within 800.00 of (Position of (Attacking unit)) matching (((Owner of (Attacked unit)) Not equal to (Picked player)) and ((Owner of (Attacked unit)) Not equal to (Owner of (Attacking unit)))))))
                Unit Group - Pick every unit in TripleStrafeTarget and do (Actions)
                    Loop - Actions
                        Unit - Create 1 Triple Strafe Dummy for (Owner of (Attacking unit)) at TempPoint facing 0.00 degrees
                        Unit - Add Storm Bolt  to (Last created unit)
                        Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                        Unit - Cause (Attacking unit) to damage (Picked unit), dealing 20.00 damage of attack type Pierce and damage type Normal
                        Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                Custom script:   call DestroyGroup (udg_TripleStrafeTarget)
                Custom script:   call RemoveLocation (udg_TempPoint)
            Else - Actions

the ability is now working but the problem is that sometimes the stormbolts targets allies and the unit with this ability
how can i remove or disable friendly fire in this trigger? =/
 

vypur85

Hibernate
Reaction score
803
There's a Boolean that checks if the matching unit is the enemy or not.

Code:
...matching (Matching unit) is an enemy of (Owner of (Attacking unit))...
 
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