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

how to get unit/hero attack amount(not damage) with buff?

Status
Not open for further replies.
Level 3
Joined
Oct 9, 2012
Messages
28
Hi,

I'm designing an ability which is based on current hero attack amount value, I can't find a way to get the value. I'm thinking to calculate it by hero main stat(either strength/agility/intelligence) but it would be tedious to also calculate with attack increasing buffs/auras. What I want is simply
GetHeroStr(whichHero, includeBonuses) but for attack.

Any ideas/links? Thanks.
 
Level 12
Joined
Nov 3, 2013
Messages
989
native BlzGetUnitBaseDamage takes unit whichUnit, integer weaponIndex returns integer

Afaik this requires 1.31 or at least 1.30.4 version of warcraft 3.



Actually I just checked with 1.30.4 World Editor (I haven't updated to 1.31 yet cause there seem to be some problems with map corruptions... ehum), anyway the function is there, and it's in GUI.
  • Set damageVariable = (Base Damage of (Triggering unit) for weapon index 1)
Keep in mind that unlike damage dealt (as in when a unit attacks another unit) base damage is an "integer" instead of "real", so it could be easy to miss if you're looking in the wrong place.


tl:dr so long as you've got 1.30.4 or newer version of warcraft 3 you can get the base damage of a unit directly without having to jump through any kind of hoops.


  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real((Base Damage of (Triggering unit) for weapon index 1))) damage of attack type Hero and damage type Normal
 
Level 3
Joined
Oct 9, 2012
Messages
28
native BlzGetUnitBaseDamage takes unit whichUnit, integer weaponIndex returns integer

Afaik this requires 1.31 or at least 1.30.4 version of warcraft 3.



Actually I just checked with 1.30.4 World Editor (I haven't updated to 1.31 yet cause there seem to be some problems with map corruptions... ehum), anyway the function is there, and it's in GUI.
  • Set damageVariable = (Base Damage of (Triggering unit) for weapon index 1)
Keep in mind that unlike damage dealt (as in when a unit attacks another unit) base damage is an "integer" instead of "real", so it could be easy to miss if you're looking in the wrong place.


tl:dr so long as you've got 1.30.4 or newer version of warcraft 3 you can get the base damage of a unit directly without having to jump through any kind of hoops.


  • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real((Base Damage of (Triggering unit) for weapon index 1))) damage of attack type Hero and damage type Normal

Thanks! I'll check it out. I'm using JNGP, don't know if it works with latest version (I guess not). BTW what do you use for latest version? just vanilla WE or with some newer mods? I'm coding in JNGP because it supports vJass and auto code complete(I feel more comfortable with code than GUI)
 
Level 12
Joined
Nov 3, 2013
Messages
989
Thanks! I'll check it out. I'm using JNGP, don't know if it works with latest version (I guess not). BTW what do you use for latest version? just vanilla WE or with some newer mods? I'm coding in JNGP because it supports vJass and auto code complete(I feel more comfortable with code than GUI)
See that's my problem as well, I'm still on 1.27 most of the time so I can use JNGP and only open up the regular WE when I need to check some of the new stuff.
 
Level 12
Joined
Nov 3, 2013
Messages
989
Does this include dicerolls or simply the base damage of the unit?
As the damage calculation usually involves the number of dice as well as the base damage.

I'd love to test it but I'm away from my warcraft computer ; ;
there's two other functions for dice rolls and sides, so if on wants to get the tue min & max base damage one has to use all three.

After you introduced new stuff in your map, can you open and test it with JNGP?
I haven't really mapped seriously for quite some time now, so to be honest I don't really know, I've been using JNGP (1.27 version) and simply left things that I know or expect to be newer features blank for now.


New things like functions that don't exist in older WC3 versions obviously won't work, so you can't test them in JNGP.

So what I've done before is the opposite, do stuff in JNGP and then add it to the regular WE, but from what I've read in Patch 1.31 announced you should not open older maps in 1.31 atm (at least not without backups) because lots of people are reporting having their maps broken and corrupted.

So right now I'm not really sure what you can do besides just waiting for the next patch.
 
Level 3
Joined
Oct 9, 2012
Messages
28
Does this include dicerolls or simply the base damage of the unit?
As the damage calculation usually involves the number of dice as well as the base damage.

I'd love to test it but I'm away from my warcraft computer ; ;

Without dice will be ok. I'm designing a parry skill, I want deal damage base on my base attack(better with bonuses). :)
 
Level 3
Joined
Oct 9, 2012
Messages
28
there's two other functions for dice rolls and sides, so if on wants to get the tue min & max base damage one has to use all three.


I haven't really mapped seriously for quite some time now, so to be honest I don't really know, I've been using JNGP (1.27 version) and simply left things that I know or expect to be newer features blank for now.


New things like functions that don't exist in older WC3 versions obviously won't work, so you can't test them in JNGP.

So what I've done before is the opposite, do stuff in JNGP and then add it to the regular WE, but from what I've read in Patch 1.31 announced you should not open older maps in 1.31 atm (at least not without backups) because lots of people are reporting having their maps broken and corrupted.

So right now I'm not really sure what you can do besides just waiting for the next patch.

Thanks for remind me :)
 
Status
Not open for further replies.
Top