• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Why unit damaged by 2 time?

Status
Not open for further replies.
Level 10
Joined
Jun 17, 2014
Messages
236
Hello, everyone!

I have a trigger that damage unit by 2 time to specific unit, i need it to only damage 1 time to specific unit.
i've try to add the unit to group, so the unit not damaged again, but it's not worked :ogre_rage:.

i will give +REP for someone who try to helping

here is my trigger

  • For each (Integer LP_Index[3]) from 1 to 4, do (Actions)
    • Loop - Actions
      • Set LP_Point[LP_Index[3]] = (LP_Point[5] offset by (100.00 x (Real(LP_Index[3]))) towards (Facing of LP_Caster[LP_Index[2]]) degrees)
      • Special Effect - Create a special effect at LP_Point[LP_Index[3]] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set LP_Group2[LP_Index[2]] = (Units within 100.00 of LP_Point[LP_Index[3]] matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of LP_Caster[LP_Index[2]])) Equal to True)))
      • Unit Group - Pick every unit in LP_Group2[LP_Index[2]] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in LP_Group) Equal to False
            • Then - Actions
              • Set NextDamageType = DamageTypePhysicalSpell
              • Unit - Cause LP_Caster[LP_Index[2]] to damage (Picked unit), dealing LP_Damage[LP_Index[2]] damage of attack type Hero and damage type Normal
              • Trigger - Run ClearDamageEvent (checking conditions)
              • Unit Group - Add (Picked unit) to LP_Group
            • Else - Actions
      • Custom script: call RemoveLocation(udg_LP_Point[udg_LP_Index[3]])
  • Custom script: call DestroyGroup(udg_LP_Group2[udg_LP_Index[2]])
  • Custom script: call DestroyGroup(udg_LP_Group)
Here is the whoolee trigger
  • Lash of Pain
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Lara) Lash of Pain
    • Actions
      • Set LP_Index[1] = (LP_Index[1] + 1)
      • Set LP_Caster[LP_Index[1]] = (Triggering unit)
      • Set LP_Level[LP_Index[1]] = (Level of (Ability being cast) for LP_Caster[LP_Index[1]])
      • Set LP_IsChannel[LP_Index[1]] = True
      • Set LP_IsAttack[LP_Index[1]] = False
      • Set LP_IsComplete[LP_Index[1]] = False
      • Set LP_Timer[LP_Index[1]] = 0
      • Set LP_Damage[LP_Index[1]] = ((40.00 + (80.00 x (Real(LP_Level[LP_Index[1]])))) + (0.60 x UnitAttack[(Custom value of LP_Caster[LP_Index[1]])]))
      • Unit - Add (Lara) Cancel Lash of Pain to LP_Caster[LP_Index[1]]
      • Custom script: call SetPlayerAbilityAvailable( GetOwningPlayer(udg_LP_Caster[udg_LP_Index[1]]), 'Aatk', false )
      • Custom script: call SetPlayerAbilityAvailable( GetOwningPlayer(udg_LP_Caster[udg_LP_Index[1]]), 'Amov', false )
      • Player - Disable (Lara) Bear Trap for (Owner of LP_Caster[LP_Index[1]])
      • Player - Disable (Lara) Charm for (Owner of LP_Caster[LP_Index[1]])
      • Player - Disable (Lara) Lash of Pain for (Owner of LP_Caster[LP_Index[1]])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LP_Index[1] Equal to 1
        • Then - Actions
          • Trigger - Turn on LoopLP <gen>
          • Trigger - Turn on Cancel <gen>
        • Else - Actions

  • LoopLP
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LP_Index[2]) from 1 to LP_Index[1], do (Actions)
        • Loop - Actions
          • Set LP_Timer[LP_Index[2]] = (LP_Timer[LP_Index[2]] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LP_IsChannel[LP_Index[2]] Equal to True
              • LP_IsAttack[LP_Index[2]] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_Timer[LP_Index[2]] Equal to 25
                • Then - Actions
                  • Set LP_Damage[LP_Index[2]] = (LP_Damage[LP_Index[2]] x 1.25)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_Timer[LP_Index[2]] Equal to 50
                • Then - Actions
                  • Set LP_Damage[LP_Index[2]] = (LP_Damage[LP_Index[2]] x 1.25)
                  • Unit - Order LP_Caster[LP_Index[2]] to Orc Troll Berserker - Berserk
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LP_IsComplete[LP_Index[2]] Equal to True
            • Then - Actions
              • Unit - Remove (Lara) Cancel Lash of Pain from LP_Caster[LP_Index[2]]
              • Unit - Order LP_Caster[LP_Index[2]] to Stop
              • Unit - Pause LP_Caster[LP_Index[2]]
              • Animation - Change LP_Caster[LP_Index[2]]'s animation speed to 200.00% of its original speed
              • Custom script: call SetUnitAnimationByIndex ( udg_LP_Caster[udg_LP_Index[2]] , 4 )
              • Set LP_Timer[LP_Index[2]] = 0
              • Set LP_IsAttack[LP_Index[2]] = True
              • Set LP_IsComplete[LP_Index[2]] = False
              • Set LP_IsChannel[LP_Index[2]] = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LP_IsAttack[LP_Index[2]] Equal to True
              • LP_IsChannel[LP_Index[2]] Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_Timer[LP_Index[2]] Equal to 10
                • Then - Actions
                  • Set LP_Point[5] = (Position of LP_Caster[LP_Index[2]])
                  • For each (Integer LP_Index[3]) from 1 to 4, do (Actions)
                    • Loop - Actions
                      • Set LP_Point[LP_Index[3]] = (LP_Point[5] offset by (100.00 x (Real(LP_Index[3]))) towards (Facing of LP_Caster[LP_Index[2]]) degrees)
                      • Special Effect - Create a special effect at LP_Point[LP_Index[3]] using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Set LP_Group2[LP_Index[2]] = (Units within 100.00 of LP_Point[LP_Index[3]] matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of LP_Caster[LP_Index[2]])) Equal to True)))
                      • Unit Group - Pick every unit in LP_Group2[LP_Index[2]] and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Picked unit) is in LP_Group) Equal to False
                            • Then - Actions
                              • Set NextDamageType = DamageTypePhysicalSpell
                              • Unit - Cause LP_Caster[LP_Index[2]] to damage (Picked unit), dealing LP_Damage[LP_Index[2]] damage of attack type Hero and damage type Normal
                              • Trigger - Run ClearDamageEvent (checking conditions)
                              • Unit Group - Add (Picked unit) to LP_Group
                            • Else - Actions
                      • Custom script: call RemoveLocation (udg_LP_Point[udg_LP_Index[3]])
                  • Custom script: call ChangeUnitSpeed2 (udg_LP_Caster[udg_LP_Index[2]], 1.0 , 5.00 , false , 'A02M', false)
                  • Custom script: call RemoveLocation (udg_LP_Point[5])
                  • Animation - Change LP_Caster[LP_Index[2]]'s animation speed to 100.00% of its original speed
                  • Unit - Unpause LP_Caster[LP_Index[2]]
                  • Unit - Unpause LP_Caster[LP_Index[2]]
                  • Custom script: call SetPlayerAbilityAvailable( GetOwningPlayer(udg_LP_Caster[udg_LP_Index[2]]), 'Aatk', true )
                  • Custom script: call SetPlayerAbilityAvailable( GetOwningPlayer(udg_LP_Caster[udg_LP_Index[2]]), 'Amov', true )
                  • Player - Enable (Lara) Bear Trap for (Owner of LP_Caster[LP_Index[2]])
                  • Player - Enable (Lara) Charm for (Owner of LP_Caster[LP_Index[2]])
                  • Player - Enable (Lara) Lash of Pain for (Owner of LP_Caster[LP_Index[2]])
                  • Custom script: call DestroyGroup(udg_LP_Group)
                  • Custom script: call DestroyGroup(udg_LP_Group2[udg_LP_Index[2]])
                  • Set LP_Caster[LP_Index[2]] = LP_Caster[LP_Index[1]]
                  • Set LP_Timer[LP_Index[2]] = 0
                  • Set LP_Timer[LP_Index[2]] = LP_Timer[LP_Index[1]]
                  • Set LP_IsChannel[LP_Index[2]] = LP_IsChannel[LP_Index[1]]
                  • Set LP_IsAttack[LP_Index[2]] = LP_IsAttack[LP_Index[1]]
                  • Set LP_IsComplete[LP_Index[2]] = LP_IsComplete[LP_Index[1]]
                  • Set LP_Remove[LP_Index[2]] = LP_Remove[LP_Index[1]]
                  • Set LP_Damage[LP_Index[2]] = LP_Damage[LP_Index[1]]
                  • Set LP_Index[1] = (LP_Index[1] - 1)
                  • Set LP_Index[2] = (LP_Index[2] - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • LP_Index[1] Equal to 0
                    • Then - Actions
                      • Trigger - Turn off Cancel <gen>
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
            • Else - Actions
  • Cancel
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Lara) Cancel Lash of Pain
    • Actions
      • For each (Integer LP_Index[2]) from 1 to LP_Index[1], do (Actions)
        • Loop - Actions
          • Set LP_IsComplete[LP_Index[2]] = True
          • Set LP_IsChannel[LP_Index[2]] = False


I only need to fix the damage problem not other!
so dont read all of the trigger.
STATUS : UNSOLVED
 
Status
Not open for further replies.
Top