This system you want is possible, but will be a bit hard to achieve.
So, let's see how can I help you:
TO YOUR NUMBER 1 QUESTION
Let's work with examples. You said you want the Sylvanus hero to do Pierce attacks, in such a way that it causes more damage to flying units.
Go to Advanced - Gameplay Constants and search for the attack type table.
Change the values there for what you want.
OBS: when reading my answer to your question 2, you'll need the CHAOS attack type, so, don't touch it. Use any other.
So, go to Pierce attack type and make it deal 1.5 damage to the Medium armor.
Go to your Sylvanus hero at the Object Editor and set its attack type to Pierce.
Check all other units you have at the Object Editor: no one can have the Medium armor type**.
Then, go to all flying units you have at the Object Editor and set their armor type to Medium.
**this was suggested because could remain units that originally had its armor type being Medium and are not flying ones, so things would mess up.
(notice that we used "Medium" here but the name has nothing to do with the effect you want. you could have used "unarmored" if you want too.)
Do just like this to every other attack type you want. If you want more attack types than warcraft gave us, it will be still possible, but MUCH more difficult to do (and you were already thinking THIS was difficult, huh?)
==========================
YOUR QUESTION NUMBER 2
OBS: this one will be VEERY hard.
First, you'll need a system to detect damage. I suggest Bribe's one:
http://www.hiveworkshop.com/forums/spells-569/gui-damage-engine-201016/
Second, create two new Integer variables: DamageTypePhysicalSiege and DamageTypePhysicalNormal . Their initial values doesn't matter.
go to the Damage Engine trigger (from Bribe) and change:
-
-------- - --------
-
Set DamageTypeSpell = 1
-
Set DamageTypeDOT = 2
-
Set DamageTypeRanged = 3
-
-------- - --------
to
-
-------- - --------
-
Set DamageTypeSpell = 1
-
Set DamageTypeDOT = 2
-
Set DamageTypeRanged = 3
-
Set DamageTypePhysicalSiege = 4
-
Set DamageTypePhysicalNormal = 5
-
-------- - --------
Third: this is the hardest one.
You'll need to trigger all spell damage of your map. I mean, if you have a Chain Lightning skill on your map, you'll have to make a fully triggered version of it by your own: creating all lightning effects, and causing damage to each unit, calculating the damage reduction, calculating where will happen every jump, check the level, etc.
Why? because this is the only way to detect:
"Unit - A unit takes damage from an attack"
Fourth
Go to your Mountain King at the Object Editor and select its attack type to CHAOS.
So, you'll create a new real variable called TempDamage
So, you'll create two triggers:
-
Adjust Mountain King Damage Part I
-
Events
-
Game - DamageModifierEvent becomes Equal to 1.00
-
Conditions
-
DamageEventOverride Equal to False
-
(Unit-type of DamageEventSource) Equal to Footman
-
Actions
-
Set TempDamage = DamageEventAmount
-
Set DamageEventOverride = True
-
Set DamageEventAmount = 0.00
-
Adjust Mountain King Damage Part II
-
Events
-
Game - DamageEvent becomes Equal to 2.00
-
Conditions
-
(Unit-type of DamageEventSource) Equal to Footman
-
Actions
-
-------- put here your functions that will decide the used "attack type" of the mountain king. --------
-
-------- if your functions decide that the NORMAL attack should be used, set the value of the MountainKingAttackType variable to 1 --------
-
-------- if your functions decide that the SIEGE attack should be used, set the value of the MountainKingAttackType variable to 2 --------
-
-------- by the way, you can't use waits here. --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MountainKingAttackType Equal to 1
-
Then - Actions
-
Set DamageEventType = DamageTypePhysicalNormal
-
Set DamageEventOverride = True
-
Unit - Cause DamageEventSource to damage DamageEventTarget, dealing TempDamage damage of attack type Normal and damage type Normal
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MountainKingAttackType Equal to 2
-
Then - Actions
-
Set DamageEventType = DamageTypePhysicalSiege
-
Set DamageEventOverride = True
-
Unit - Cause DamageEventSource to damage DamageEventTarget, dealing TempDamage damage of attack type Siege and damage type Normal
-
Else - Actions
PS: notice that I didn't created the function that decide which attack type mountain king will use. You'll have to create it.
PS2: I would like +rep because of my 40 mins work here.
PS3: When you achieve things exactly as I said, tell me because it is not ready yet
We'll need to add some math at the last things of trigger 2 to compensate the amount of damage that was already reduced.
(my english was bad here, it seems that already is not the right word, but I guess you've got my point)
PS4: i would like also that someone else give his oppinion to what I made here. If I commited a mistake, for example.
I EDITED SOME THINGS 3 MINUTES AFTER POSTING.
hamsterpellet