• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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
 
Level 26
Joined
Mar 19, 2008
Messages
3,140
@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