HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Damage Modifying...

07-26-2007, 03:50 AM#1
Ignitedstar
Hello, everyone. Once again, I am stuck on a certain problem. I'm sorry if this question is a nuisance, but I need a straight answer. Some people ask, but I don't care if the solution is in JASS or GUI.

Okay, so what I plan to do is have an ability that reduces the amount of damage they do by exactly half(50% reduction). Now, this doesn't apply to all enemies, so what I did was make a ability to identify that "type" of enemy. Example: I made a dummy ability that identifies the unit as Undead. (I did not use the actual race check)

Now here's the problem: The damage reduction is to regular attacks. I don't believe there was any default Wc3 ability that reduced all types of damage by half when hitting certain targets. And at that, classified units using dummy abilities. If there is, call me stupid and tell where it is.

So it looked like I had to trigger the effect. I know that there's a way to find the damage source and then find the exact amount of damage done, then I could deal more damage by triggers or heal by triggers to fake the resisted damage(or to do the opposite effect- deal 50% more damage to a certain type of unit). However, I have no idea how to start. Anyone have any ideas?

I think that sounded confusing, so let me summarize the point:

I want to trigger an effect that is based on an ability that will deal more damage to a type of unit. The type of unit is determined by a dummy ability. But, how do I find the amount of damage done to the unit when it recieves damage? If I could do that, then I could increase/decrease the amount of damage done to the target by making conditiosn to suit situations.

Example: Unit A hits Unit B with Piercing damage. Unit B is Undead(dummy ability based), so Unit B will take half(50%) the damage Unit A would have dealt.

Wow, now that that I've written it down, it seems like a lot less of a problem.

Well, that was one problem. I think the above question and this are relative, so I'm going to put them in the same thread. Here's the next:

Okay, so I made abilities that would reduce the amount of damage done to the target depending on the kind of damage done. For example, this ability reduces Piercing damage by 50%. Once again, I don't think there's a default Wc3 passive ability that reduces Piercing damage by 50% or any other type of damage(excluding spell damage, of course[Runed Bracers]).

Unlike the previous problem, this doesn't deal with types of enemies, it just deals with how certain abilities will increase/decrease damage done to the target based on the damage type the target is attacked with. Once again, I need to find out how much damage is done to the target. How would I go about doing this one?

Example: Unit A hits Unit B with Normal attack damage. Unit B is strong againest Normal attack damage, thus decreasing the amount of damage done by half(50%).

If I could change the game constants within the game or modify it with triggers, this wouldn't be a problem.
07-26-2007, 04:12 AM#2
Ghan_04
It sounds like what you are describing is the normal weapon-armor system of WC3. What is it exactly that you want to be different? As far as I know, there is no way for a trigger to detect the type of attack that a unit uses.
07-26-2007, 06:53 AM#3
Pyrogasm
There is a table in Gameplay constants in which you can change these settings.
07-27-2007, 12:23 AM#4
Ignitedstar
I know that, and I am using it to my needs. The problem is how to "change" it during a game.

What I want to do is fake extra resistance/damage. I thought there was a way to find out how much damage is done to a unit when hit normally?

Say, if there was a unit that got hit 20, I could store that number in a integer/real variable and use it. Otherwise, it seems like what I'm doing is impossible with what the world editor has to offer.
07-27-2007, 12:39 AM#5
Rising_Dusk
In the damage event callback, GetEventDamage() gives the damage [After armor and all other reductions are already applied] that the unit will take from said damage.
The problem is, there's no way to get what damage type was used to deal said damage.

If you monitored and triggered ALL damage in your map, these sorts of things would be pretty easy to manage.
But that might be too much for your intentions.
07-27-2007, 01:03 AM#6
Ignitedstar
That is completely fine. I can still do the other half of stuff I wanted to do, which is finding out what "type" of unit was attacked. Thanks for the help, Rising_Dusk.