Armor and Spells: Damage reduction Question

Post Reply
User avatar
GnaReffotsirk
Zerg Larva Herder
Zerg Larva Herder
Posts: 338
Joined: Sat Nov 15, 2008 4:54 am

Armor and Spells: Damage reduction Question

Post by GnaReffotsirk »

Is it possible to create a spell that has the same damage rating to a given armor type, as piercing, normal, magic, etc.? Like, for example, fireball spell that does 120% damage to medium armor, but does 50% to heavy armor.

Is it possible to create this effect?

Is there a spell in WC3 that follows this mechanic?

How can this be done?

Also, is it possible to edit the distance between units in formation? Like, say, footmen would walk closer together than the default.

Is it possible to edit the formations? like, instead of box formation, we have a line formation, or wedge as default.
Last edited by GnaReffotsirk on Wed Dec 10, 2008 4:32 am, edited 1 time in total.
Image
User avatar
Ricky_Honejasi
Xel'naga Solar Moderator
Xel'naga Solar Moderator
Posts: 2011
Joined: Wed Aug 16, 2006 3:50 pm

Re: Armor and Spells: Damage reduction Question

Post by Ricky_Honejasi »

GnaReffotsirk wrote: Is it possible to create a spell that has the same damage rating to a given armor type, as piercing, normal, magic, etc.? Like, for example, fireball spell that does 120% damage to medium armor, but does 50% to heavy armor.

Is it possible to create this effect?
It might be possible but you will need to consider every possible case on a unit-type basis instead of armor since there is no easy way to do it. For example, if it's a knight (which is a unit-type with heavy armor), it only suffers 50% damage instead of "picked unit-type has heavy armor so 50% damage".

This is obviously painful if we consider every single creep creature possible in addition of whatever custom unit added in the mix. Obviously requires an array unit-type variable along with some other array variable to remember their armor type if you want to keep any sanity in this.

This is also presuming you want specific spells with different spell damage ratings for the same armor-type instead of all dealing the same % of damage on a specific armor-type. Otherwise, you modify the gameplay constants.
Is there a spell in WC3 that follows this mechanic?
Only some and very partially (only one or two specific armor types) so ultimately better say no in the grand scheme of things.
Also, is it possible to edit the distance between units in formation? Like, say, footmen would walk closer together than the default. Is it possible to edit the formations? like, instead of box formation, we have a line formation, or wedge as default.
I believe not. Probably hardcoded too. Even with lots of triggers, you will have force a whole group to move each unit individually so you can make your own formation by constantly order each unit the way you want.

Honestly, more pain than it is worth unless you have a very special reason to go that far.
User avatar
GnaReffotsirk
Zerg Larva Herder
Zerg Larva Herder
Posts: 338
Joined: Sat Nov 15, 2008 4:54 am

Re: Armor and Spells: Damage reduction Question

Post by GnaReffotsirk »

Thanks Ricky!
Image
User avatar
Mucky
Protoss Khalai Missionary
Protoss Khalai Missionary
Posts: 1014
Joined: Thu Aug 24, 2006 10:35 pm

Re: Armor and Spells: Damage reduction Question

Post by Mucky »

Open WorldEdit -> Click Advanced -> Go to Gameplay Constants -> Find 'Combat - Damage Bonus Table - Spells'

There is nothing in trigger conditions that can calculate a unit's armor or armor-type, unfortunately.
User avatar
Milldawg
Zerg Defiler Nutritionist
Zerg Defiler Nutritionist
Posts: 729
Joined: Fri Aug 25, 2006 1:00 pm
Location: US

Re: Armor and Spells: Damage reduction Question

Post by Milldawg »

Another option would be to trigger the spell using dummy units. Whenever your guy "casts fireball," it creates an invisible dummy unit who has an attack animation that looks like a fireball and whose damage is piercing, magic, etc. Ricky can tell you more about dummy units ;)
User avatar
Mucky
Protoss Khalai Missionary
Protoss Khalai Missionary
Posts: 1014
Joined: Thu Aug 24, 2006 10:35 pm

Re: Armor and Spells: Damage reduction Question

Post by Mucky »

The problem with dummy units is that they're supposed to emulate the caster launching the fireball. If you don't know exactly what you're doing (probably involves a lot of trial-and-error in the unit's art fields), the fireball's origin point will be offset from the caster. Whether you're using dummy units to fire the projectile or simply having the caster fire it, you'd need to go to Gameplay Constants to get the values you want. Unless you only want Fireball obeying these rules, I'd take the simpler route and modify the Spells damage value tables.
User avatar
RazorclawX
Xel'naga World Shaper
Xel'naga World Shaper
Posts: 2079
Joined: Thu Aug 24, 2006 7:19 pm

Re: Armor and Spells: Damage reduction Question

Post by RazorclawX »

Mucky wrote: Open WorldEdit -> Click Advanced -> Go to Gameplay Constants -> Find 'Combat - Damage Bonus Table - Spells'

There is nothing in trigger conditions that can calculate a unit's armor or armor-type, unfortunately.
That affects every spell; if you only wanted it to affect one spell you're out of luck.
Image
-- Razorclaw X
Creator of Wanderers of Sorceria and Vision of the Future
User avatar
GnaReffotsirk
Zerg Larva Herder
Zerg Larva Herder
Posts: 338
Joined: Sat Nov 15, 2008 4:54 am

Re: Armor and Spells: Damage reduction Question

Post by GnaReffotsirk »

What about a damage modifier spell which adds damage bonus to a unit's attack, and costs mana everytime the unit attacks?

Like, the Searing Arrow hero spell? Say, we give it to the footman and archer, and the bonus is +20, does the Searing Arrow bonus adhere to each unit's damage ratings over their targets?

What I wanted to do was give a kind of limited attack bonus for each unit in WC3. If these units engage in battle too long, their attack potential is exhausted (mana depleted by attacking targets).
Last edited by GnaReffotsirk on Thu Dec 11, 2008 7:05 am, edited 1 time in total.
Image
User avatar
Mucky
Protoss Khalai Missionary
Protoss Khalai Missionary
Posts: 1014
Joined: Thu Aug 24, 2006 10:35 pm

Re: Armor and Spells: Damage reduction Question

Post by Mucky »

When a unit uses Searing Arrows, it deals damage using the same damage type as the unit.

...If that's what your question is.

Also, giving a melee unit an arrow orb will cause some issues.
User avatar
GnaReffotsirk
Zerg Larva Herder
Zerg Larva Herder
Posts: 338
Joined: Sat Nov 15, 2008 4:54 am

Re: Armor and Spells: Damage reduction Question

Post by GnaReffotsirk »

Yup, that was the question.

You're awesome! Thanks, Mucky!!

Woot!
Image
tipereth
Zerg Hydralisk Nail Stylist
Zerg Hydralisk Nail Stylist
Posts: 597
Joined: Tue Sep 19, 2006 7:37 pm

Re: Armor and Spells: Damage reduction Question

Post by tipereth »

Fyi you could easily do the effect Milldawg was talking about, have the fireball spell art shoot a fireball projectile or whatever and then have the dummy unit use an invisible projectile with the same speed as the fireball. They wont sync perfectly but it will be close enough that it will be hard to notice.

This would still involve triggering every spell that did reduced/bonus damage though, so if its a ton of spells you might be better off just changing global constants.
User avatar
GnaReffotsirk
Zerg Larva Herder
Zerg Larva Herder
Posts: 338
Joined: Sat Nov 15, 2008 4:54 am

Re: Armor and Spells: Damage reduction Question

Post by GnaReffotsirk »

The problem is, there are a lot of units engaging on screen with less spaces. And the coding would hurt. The searing arrows would do fine for this little project for now.

However, if you don't mind, maybe the project would need the method you're proposing, so, I might PM you for help.

You guys are the best!
Image
Post Reply