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

Dealing damage everytime the unit loses mana

Status
Not open for further replies.
Level 5
Joined
Jan 27, 2007
Messages
154
I seem to have a problem with this, no damage is dealt upon losing mana.

  • Events
    • Time - Every 0.01 seconds of game time
  • Actions
    • Set xmana = (Mana of ken)
    • Set xloc = (Position of ken)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Mana of ken) Less than xmana
      • Then - Actions
        • Set xtarget = (Units within 400.00 of xloc matching (((Matching unit) belongs to an enemy of (Owner of ken)) Equal to True))
        • Unit Group - Pick every unit in xtarget and do (Actions)
          • Loop - Actions
            • Unit - Cause ken to damage (Picked unit), dealing (xmana x ((Real((Level of Violent Mana for ken))) x 0.25)) damage of attack type Spells and damage type Normal
      • Else - Actions
 
Level 4
Joined
Apr 16, 2009
Messages
85
  • Set xmana = (Mana of ken)
overrides your variable every time - instead you should try setting that value when "ken" is created and override it at the END of your current trigger not at the start
 
  • Set xmana = (Mana of ken)
overrides your variable every time - instead you should try setting that value when "ken" is created and override it at the END of your current trigger not at the start

follow Void's idea, place
  • Set xmana = (Mana of ken)
into the end of the trigger
because if you set it at the start then it will really not cause damage since Mana of Ken would be equal to xmana...
 
Status
Not open for further replies.
Top