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

Show Magic Resistance, Critical, Lifesteal And Evasion value of hero

Status
Not open for further replies.
Level 5
Joined
Jul 31, 2011
Messages
103
Hi HIVE!

I created this thread because i want show the hero actually magic resistance, Critical, Lifesteal And Evasion value.

But i dont know how get that value in the game.

Can you help me?

I want show that value in a multiboard
 
Level 39
Joined
Feb 27, 2007
Messages
4,992
You can't "get" a unit's crit or evasion chance in-game in any way other than brute force estimating by havring it attack mass units or having units attack it. Lifesteal, armor, magic resistance can all be gotten from one attack.

IMO the best/only real way to do this accurately is to save information about sources of these stats (abilities/items (buffs are kind of a different story)) and then manually compute the values yourself. Something like
  • -------- items --------
  • Set LifestealItemCount = 2
  • Set LifestealItem[1] = Bone Chimes
  • Set LifestealItemAMT[1] = 0.25
  • Set LifestealItem[2] = Life Sword
  • Set LifestealItemAMT[2] = 0.10
  • -------- Abilities --------
  • Set LifestealAbilCount = 1
  • Set LifestealAbil[1] = Vampire Strike
  • Set LifestealAbilAMT[1] = 0.20
  • -------- same format for other stats --------
  • Set MRItemCount = ...
  • Set MRItem[1] = ...
  • Set Stat = 0.00
  • For each (Integer A) from 1 to LifestealItemCount do (Actions)
    • Loop - Actions
      • If (All conditions are true) then do ( actions) else (actions)
        • If - Conditions
          • (<your unit> has an item of type LifestealItem[(Integer A)]) equal to true
        • Then - Actions
          • Set Stat = (Stat + LifestealItemAMT[(Integer A)])
        • Else - Actions
  • For each (Integer A) from 1 to LifestealAbilCount do (Actions)
    • Loop - Actions
      • If (All conditions are true) then do ( actions) else (actions)
        • If - Conditions
          • (Level of LifestealAbil[(Integer A)] for <your unit>) greater than 0
        • Then - Actions
          • Set Stat = (Stat + LifestealAbilAMT[(Integer A)])
        • Else - Actions
  • -------- Same structure for testing other stats --------
If you want it to properly compute values for a unit having multiple of the same item, different levels of abilities giving different amounts of stats, or for any buff-based stat changes your trigger will need to become more complicated.
 
Last edited:
Level 10
Joined
Sep 16, 2016
Messages
269
Control everything. Save the whole abilities and items relating those value into variables, then when a hero learn it, or acquired items, or get aura (custom aura ofc), get that value and change it in the multi-board.
 
Level 11
Joined
May 16, 2016
Messages
730
Another question its possible for show that value in the UI in the armor icon?
You have to change all interface literally. So it's impossible, however you can create a trigger which periodically checking unit's resistance and convert it into food limit for example (physic resistance as current food consumption and spel resistance as max food limit)
 
Level 5
Joined
Jul 31, 2011
Messages
103
You have to change all interface literally. So it's impossible, however you can create a trigger which periodically checking unit's resistance and convert it into food limit for example (physic resistance as current food consumption and spel resistance as max food limit)
I LIKE THAT IDEA CAN YOU HELP ME?

i edited your trigger for create the two dummys in center of the map, added 20000attack range and save into variable
 

Attachments

  • CHECK SPELL AND PHYSIC RESISTANCE.w3x
    14.5 KB · Views: 31
Status
Not open for further replies.
Top