Damage Problem

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
For target-unit type spell
  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to UnitGroupVariable
  • Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UnitGroupVariable and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - YourDamageVariable)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
When you do it every 0.03 seconds, it is not only 1 time. What have unit groups to do with damage? There is a function

native UnitDamageTarget takes unit whichUnit, widget target, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns boolean
 
@defskull Why Set unit life instead of:
  • Unit Group - Pick every unit in UnitGroupVariable and do (Actions)
    • Loop - Actions
      • Unit - Cause unit1 to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal
unit1 should be set to unit to want to deal damage to picked units. You can also use (Picked unit) again - meaning unit will damage itself.
 
Level 13
Joined
Oct 25, 2009
Messages
995
Why this won't work?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (DR_TargetUnit[DR_TempInt] is in DR_EnemyGroup[1]) Equal to True
    • Then - Actions
      • Unit Group - Add DR_TargetUnit[DR_TempInt] to DR_EnemyGroup[1]
    • Else - Actions
      • Animation - Play DR_Caster[DR_TempInt]'s attack animation
      • Unit - Cause DR_Caster[DR_TempInt] to damage DR_TargetUnit[DR_TempInt], dealing DR_Damage[DR_TempInt] damage of attack type Spells and damage type Normal
      • Unit Group - Add DR_TargetUnit[DR_TempInt] to DR_EnemyGroup[1]
I just want to damage the target unit with 1 time,but it every 0.03 second looping.
 
Status
Not open for further replies.
Top