• 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.

[Trigger] Extra Damage

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2013
Messages
1,105
So the idea of this trigger is to give the unit additional damage depending on the number of heroes within an area, however during my trials it either adds it once and never removes it OR it adds and removes it so fast that I never see any "+dmg" Any help would be terrific! :D

  • Extra Damage Owner Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Extra Dmg
    • Actions
      • Set ExtraDmg_Owner = (Learning Hero)
  • Extra Damage
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of ExtraDmg_Owner)
      • Set TempGroup = (Units within 350.00 of TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of ExtraDmg_Owner)) Equal to True
            • Then - Actions
              • Unit - Add Item Damage Bonus +5 to ExtraDmg_Owner
              • Unit Group - Add (Picked unit) to ExtraDmg_UnitGroup
            • Else - Actions
      • Unit Group - Pick every unit in ExtraDmg_UnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TempPoint and TempPoint2) Greater than or equal to 351.00
            • Then - Actions
              • Unit - Remove Item Damage Bonus +5 from ExtraDmg_Owner
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: set udg_TempGroup = null
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
In the ITE of TempGroup iteration, you don't filter out picked unit already in ExtraDmgGroup and dead units -> corpses cause the ability to stay. In the ExtraDmgGroup iteration, you never remove the "left" unit from the group. Therefore >351 range units stay in the group and the ability is always removed when said units are looped -> instant remove no matter what.

Abilities with the same ID cannot be added multiple times to a unit. You need to switch to level.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Hm, I did what I believe you instructed but still can't get it to work :(

  • Extra Damage
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of ExtraDmg_Owner)
      • Set TempGroup = (Units within 350.00 of TempPoint)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of ExtraDmg_Owner)) Equal to True
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) is in ExtraDmg_UnitGroup) Not equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Real((Level of Item Damage Bonus Leveled for (Attacking unit)))) Equal to 0.00
                • Then - Actions
                  • Unit - Add Item Damage Bonus Leveled to ExtraDmg_Owner
                • Else - Actions
                  • Unit - Set level of Item Damage Bonus Leveled for (Attacking unit) to ((Level of Item Damage Bonus Leveled for (Attacking unit)) + 1)
              • Unit Group - Add (Picked unit) to ExtraDmg_UnitGroup
            • Else - Actions
      • Unit Group - Pick every unit in ExtraDmg_UnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TempPoint and TempPoint2) Greater than or equal to 351.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Real((Level of Item Damage Bonus Leveled for (Attacking unit)))) Less than or equal to 0.00
                • Then - Actions
                  • Unit - Remove Item Damage Bonus Leveled from ExtraDmg_Owner
                • Else - Actions
                  • Unit - Set level of Item Damage Bonus Leveled for (Attacking unit) to ((Level of Item Damage Bonus Leveled for (Attacking unit)) - 1)
              • Unit Group - Remove (Picked unit) from ExtraDmg_UnitGroup
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: set udg_TempGroup = null
 
Status
Not open for further replies.
Top