• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

(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