• 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.

[Trigger] Get item damage bonus

Status
Not open for further replies.
Level 3
Joined
Oct 25, 2017
Messages
43
Hello,

I just have a short question: is there any way to get item damage on hero?

I have this trigger:

JASS:
function GetUnitDmg takes unit u returns integer
   
   local real baseDamage
   local real diceNumber
   local real diceSides
   local integer minDmg
   local integer maxDmg
   local integer randomDamageRange

    set baseDamage = BlzGetUnitBaseDamage(u, 1)
    set diceNumber = BlzGetUnitDiceNumber(u, 1)
    set diceSides  = BlzGetUnitDiceSides(u, 1)

    set minDmg = ( R2I(baseDamage) + R2I(diceNumber) )
    set maxDmg = ( R2I(baseDamage) + R2I(diceNumber) * R2I(diceSides) )
    set randomDamageRange = GetRandomInt(minDmg, maxDmg)

   return randomDamageRange

endfunction

However, this only takes the 'white' damage and calculates/outputs the integer, ignoring the bonus damage. I need some way to get the bonus in order to use it for calculating the output.

( I know I can use another trigger to get the damage by checking the items but I would like to not clog up the map with that if possible)
 
Status
Not open for further replies.
Top