HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Question for Weeaddar:

01-30-2004, 08:40 AM#1
Alakafizz
Is there any chance you could cook up a snippet of code as addendum for your addBonus script? Im looking for a callable function that returns the total amount of +dmg on a unit, including bonuses from items if possible.

I've tried on my own for, hrm, 2 hours now heh, but im seriously lacking in the JASS department :)

Thanks in advance!
Ala
01-30-2004, 12:42 PM#2
weaaddar
Bonus mod works because it knows the abilities that can add bonuses. The only solution is to convert your items abils to use bonusmod.

Sorry.
01-30-2004, 02:05 PM#3
Alakafizz
Okay, and thanks for replying :)

Would it be possible then to make a function that just counts the total damage added to a specifik unit by addBonus, and returns this as an integer?
01-30-2004, 06:30 PM#4
weaaddar
Yeah there already is such a function:
getBonus(unit u,type t)
01-30-2004, 09:27 PM#5
Alakafizz
Ah okay - but how do i save the returned integer to a variable that i can work with?
01-30-2004, 09:49 PM#6
weaaddar
let say you have a variable in worldedit called BonusAmount

to get the bonus damage the triggering unit has you would in custom script go
set udg_BonusAmount=getBonus(GetTriggerUnit(),0)

Then when you used BonusAmount in your trigger it'll have the value of the bonuses he has.
01-31-2004, 07:56 AM#7
Alakafizz
Rar thanks! Love you man :D