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

bone shield (from diablo2) help

Status
Not open for further replies.
Level 10
Joined
Jul 2, 2004
Messages
690
is there anyway to make a spell like the bone shield/armor from diablo 2? it takes a certain amount of damage for you before it dissipates. the anti-magic shell (banshee skill) is also similar but i think it only absorbs magic damage.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Since Defensive Matrixes have already been made, I can tell you that it's possible. You can try my Defensive Matrix but its still buggy and it absorbs 100% damage, not only part of it, such as Bone Armor does. Not that it would be a problem to solve. I can tell you an idea:

-> Shield's life can be stored in the unit's custom value
-> Once Shield's life reaches 0 you remove the buff
-> You have a trigger which activates when caster x is damaged
-> You remove a percentage of that damage and you immediately increase the life of the unit, as it is damaged.

Cheers!

~Daelin
 
Level 10
Joined
Jul 2, 2004
Messages
690
so the custom value is like a variable?

and...

how would i determine damage if the attacking unit is a hero with items?

sorry about my little understanding of triggers
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
It doesn't matter that its a hero. The thing is that you can have only ONE unit with this ability (not MUI unfortunately). And now, there will be two triggers.

Trigger 1
Event - An Unit Starts The Effect of an Ability
Conditions - Ability Being Cast equal to BoneArmor
Actions - Set ArmorCast = (Triggering Unit)
- Enable Trigger 2
- Set Custom Value of (Triggering Unit) to x //Instead of x put the life of the armor
- Disable (Triggering Trigger) //This will prevent another unit to use the ability

Trigger 2 (initially disabled)
Event - ArmorCast is Damaged
Actions - //DEFENSE PHASE

And now to explain the Defense Phase (I'm too lazy to write it right now). The thing is to recover the percentage of the Damage Received. BUT at the same time, you must decrease the "life" of the armor through the custom value. Just be careful to assure that the percentage damage isn't more than the armor's life. If it is, just increase the life with the value equal to the custom value and set armor's value to 0.

At the end of the second trigger check if the life of the armor is equal to 0. If it is, remove the buff, deactive the (Triggering Trigger) and Reactivate the first trigger. Voila, this should kinda be all.

~Daelin
 
Status
Not open for further replies.
Top