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

(GUI) Advanced Armor/Defense system

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
Hi.
I am requesting ideas/demo map/triggers, how could i make this system:

Lets say:
Attacked unit has 20 armor
Attacking unit has 30 damage
So it will does Attacked Units armor - Attacking Unit damage = 10
any idea how can i make it?
only count for normal attacks, NOT for spells

+rep and credits
 
Level 16
Joined
Aug 7, 2009
Messages
1,403
Well, actually "Attacked Units armor - Attacking Unit damage" = -10, not 10 :p

Also, what you need to achieve this:
-A damage detection system that allows you to block the incoming damage if you want;
-You have to know the actual attack damage of your unit;
-and a trigger that handles these things for you.

So how is this done on my map? It's plain simple:
I've implemented J4L's Damage system. Using this system and by triggering all spell damage I can easily determine whether the incoming damage os from spell or from attack. Each time a unit is attacked the trigger blocks all the damage and fires the proper method with the calculated value (armor, armor penetration, things like that). The method checks if the unit is alive, handles absorbs and crits, fires the proper events and if the unit has Lifesteal heals the attacker.

This is the only way I can imagine.

PS: about the triggers: well, the whole damage and heal thing is in one long vJASS trigger, it's 50% hardcoded, so I won't post it, sorry. But you can easily recreate it or ask someone to do it for you.
 
Status
Not open for further replies.
Top