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

[Solved] Attack Type Index Integers

Level 18
Joined
Mar 16, 2008
Messages
721
Maybe this will be useful to someone else since I can't find this anywhere.

0 - sets back to normal possibly default for that unit?
1 - normal
2 - piercing
3 - siege
4 - magic
5 - chaos
6 - hero
7 - n/a

Also it seems some units start at weapon index 0 and some start at 1.
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
It is defined in common.j file as constants, you can see it for example here jassdoc/common.j at 8a4da7d7ea7f3cfeb55084cfb34857f1c2cfaa9c · lep/jassdoc
Do note that ATTACK_TYPE_NORMAL is "Spells" attack type in GUI/WE, while ATTACK_TYPE_MELEE is "Normal" attack type in GUI/WE

Also it seems some units start at weapon index 0 and some start at 1
I think some units have both - for example one for attacking ground units and other for attacking flying units. I think Rexxar unit had this. And I think peasants/peons also have this, where the second attack type allows them to target trees.

As for index 0 and 1, I assume you mean which index you set when using GUI actions like 'Set unit weapon integer field' etc.? Because I know for a fact that Blizz was there very inconsistent, so some actions expect 0-based indexing while other actions 1-based indexing
 
Top