• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

how can i make this?

Status
Not open for further replies.
Level 19
Joined
May 1, 2008
Messages
1,130
i have my blademaster that has this swipe ability that damages an area in front of him
i want to give hero units an evasion ability based on their agility (it will be done by triggers and it will be something like random integer from 0 to 100 is less or equal to agility of hero/4) so when the blademaster uses the swipe ability, heroes in front will have a chance not to get damage based on their agility.
now how can i do that? :confused: idk what event to give...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's probably something like this:
  • Swipe spell
  • Actions
    • Set TempUnitGroup = [Units being hit]
    • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 100) Less than ((Agility of Picked Unit (Include bonuses)) / 4)
          • Then - Actions
          • Else - Actions
            • Unit - Cause Triggering Unit to damage (Picked unit), dealing [Your Damage] damage of attack type Spells and damage type Normal
    • Custom script: call DestroyGroup(udg_TempUnitGroup)
If the ability doesn't deal trigger-based damage, use this action:
  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ([Damage] x (Real((Level of [Swipe Spell] for (Triggering unit))))))
 
Level 19
Joined
May 1, 2008
Messages
1,130
ye but the problem is that if there are multiple heroes in that group with different agility points hmm... the pick every unit will take them all as 1 unit
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
ye but the problem is that if there are multiple heroes in that group with different agility points hmm... the pick every unit will take them all as 1 unit

Really?
Ohh, I thought it would calculate every unit seperately :s
I will think about this problem... :/

Edit:
What if you pick a random unit of the unit group (for each integer A from 1 to units in unit group), calculate it for that hero and remove it from the unit group?
 
Status
Not open for further replies.
Top