• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Special Hero-Attack Types

Status
Not open for further replies.
Level 16
Joined
May 2, 2011
Messages
1,350
How can we make different attack types for different heroes, yet not the same as the units?For example,

1.I want The ranger hero (like Sylvanus) to have pierce-like attack.That is, she does extra damage for flying units like pierce attack but her damage is not reduced when she attacks heroes. Same applies to the Archmage (like magic attacks) and other heroes.

2.I want some heroes to have more than an attack type. For instance, I want the Mountain King to to have both normal (blade) attack type and siege attack type. I want him to attack medium armor units with normal attack (blade); and to attack unarmored units or fortified units with siege attacks; or, any case, choose the best attack type that does more damage.
Is the best way to create new attack types?And how can we create new attack types?

Feel free to show any brilliant bright idea.
Waiting to be astonished.
Thank you.
 
Last edited:
Level 5
Joined
Dec 12, 2011
Messages
116
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 :p
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
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Third : This is the hardest part. No it is not, code that someone gave me a while back

JASS:
function DamageEngine_HookSpell takes unit source, widget target, real amount, boolean b1, boolean b2, attacktype at, damagetype dt, weapontype wt returns nothing
    set udg_DamageEventType = udg_DamageTypeSpell
endfunction

function DamageEngine_HookSpellBJ takes unit c, unit t, real amt, attacktype attype, damagetype dmgtype returns nothing
    set udg_DamageEventType = udg_DamageTypeSpell
endfunction

hook UnitDamageTarget DamageEngine_HookSpell
hook UnitDamageTargetBJ DamageEngine_HookSpellBJ

This will make DamageEventType spell or physical attack.

Now make some buffs and apply them to an "Orb of x" ability and give it to your hero. The buffs will correspond with what damage type the unit deals. So than if you check the unit has that buff. If he does, than siege damage was dealt, or normal, or etc...
 
Level 5
Joined
Dec 12, 2011
Messages
116
Hey, i've never seen that 'hook' thing on JASS...
Anyways, it seems that you are, through this, adding a "set udg_DamageEventType = udg_DamageTypeSpell" to the Damage Target function at GUI and it's JASS corresponding.
But the fact is that this obviously does not cover the warcraft's standard abilities like chain lighning, star fall, storm bolt etc.
BTW I would not suggest the usage of an Orb skill because it can overwrite other orb skills you have in your map (the famous "Orb effects do not stack" on DotA: http://www.playdota.com/mechanics/Orb_Effects)
 
Level 16
Joined
May 2, 2011
Messages
1,350
I think I need to look more closely to what you said to understand what you are exactly saying (too complicated for me and I did not finish it, with respect) but how about this:
I make each hero have two attacks, one can only attack heroes(hero-attack type), and the other can only attack non-hero units(pierce or siege or magic...). This is like the night elves' chimaera's attacks: it has one for buildings and the other for normal units.
Good Idea huh?
Still it may not be very useful to the mountain king. I want him to have siege attack and normal attack. I want him to use normal attack on medium armor(on archer's and units who take more from blade attacks(normal attacks)) and units who take no less damage from blade attacks, and I want him to use siege attacks on buildings and units who take more damage from siege ( like unarmored units and units with metallic armor).
And, if could possibly be done, I want mountain king to use the first animation (attacking with hammer) for siege, and the second animation ( attacking with his axe) for the blade attack type.How would this be?
no one can have the Medium armor type
I think you mean normal armor, for it was used in ROC(Reign of Chaos) only, or am I wrong?
 
Last edited:
Level 5
Joined
Dec 12, 2011
Messages
116
Yeah, I have good news to you. (=

First, at the third part of my main post, I said you needed to trigger ALL spell damage from your map (what is VERY hard). But, now I realize the good news: you only need to trigger the spells that Mountain King uses.

Second, you Chimaera's example was good. But, I don't know if it is possible to set the conditions to is-hero or non-hero. I'll check and post here soon. It may be a faster solution to your Sylvanus, but surely is not a solution to your Mountain King.

Third, if you achieve the part that mountain king does normal and siege attack correctly, configuring the attack animations will be easy (not thaaat easy though).

Fourth, I really wanted to say Medium armor. Perhaps you didn't understand, the fact is that I wanted a armor type to be made to be used only on flying units. I took Medium as an example, but you can choose another, like Unarmored as I said.
 
Level 5
Joined
Dec 12, 2011
Messages
116
Checked what I said at Second. Yeah, you can use two attacks, like chimaera's for example, and there is an option to put attack 1 to hero only and attack 2 to non-hero only.

This will help a lot.

So, what you say ?
 
Status
Not open for further replies.
Top