• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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