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

Another damage to variable question.

Status
Not open for further replies.
Level 7
Joined
Jul 29, 2007
Messages
172
Well I wish to make a spell with the fuction of :

Every X damage you dealt, a spell will be autocasted.

What should I do with the X? How should I set it to a Real variable?
 
This only works if a Player has only 1 Unit with this skill.
  • INITSample
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Sample <gen> the event (Unit - (Picked unit) Takes damage)
  • Sample
    • Events
    • Conditions
      • (Level of <SKILLNAME> for (Damage source)) Greater than 0
    • Actions
      • Set Skill_DamageDealt[(Player number of (Owner of (Damage source)))] = (Skill_DamageDealt[(Player number of (Owner of (Damage source)))] + (Damage taken))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Skill_DamageDealt[(Player number of (Owner of (Damage source)))] Greater than or equal to <DAMAGEAMOUNT>
        • Then - Actions
          • Do your stuff...
          • Set Skill_DamageDealt[(Player number of (Owner of (Damage source)))] = 0.00
        • Else - Actions

If you want to have multiple units per player to have this skill you have to work with Custom Value of Unit:
(NOTE: A Unit can only have ONE Custom Value, so you can't use it for other triggers)
  • Unit - Set the custom value of (Damage source) to ((Custom value of (Damage source)) + (Integer((Damage taken))))
 
Status
Not open for further replies.
Top