• 🏆 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!

[Trigger] Chance to miss on attacks based on attribute?

Status
Not open for further replies.
Level 17
Joined
Aug 19, 2007
Messages
1,380
Hello, I need some help with a new system I'm making. I've changed the attribute Agility to Dexterity and I want that Dexterity and the level of an enemy determine the chance that my hero will deliver an attack succesfully. The higher the Dexterity, the lower the chance my hero will miss when attacking and the higher the level of the enemy unit my hero is attacking, the higher the chance my hero will miss when attacking.

This is what I got so far (but it doesn't work, I think because it adds the evasion ability after the hero has done it's damage) with the lower the dodge level, the lower the chance my hero will miss when attacking:
  • Dexterity Attribute
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Your Hero
    • Actions
      • Set temp_attackunit = (Attacked unit)
      • Unit - Add Dodge Chance to temp_attackunit
      • Unit - Set level of Dodge Chance for temp_attackunit to ((Level of temp_attackunit) + (57 - ((Agility of (Attacking unit) (Include bonuses)) / 3)))
      • Unit - Remove Dodge Chance from temp_attackunit
Thanks for taking the time :infl_thumbs_up:
 
Status
Not open for further replies.
Top