//
// BonusMod by Xonok
//
// This library is a replica of weaaddar's
// BonusMod libary. The reason why I am
// not using his is that I do not like
// systems that I don't fully understand
// and thus, I must create it myself.
//
//
globals
integer array AddDamageAbil
integer AddDamageAbils
integer array AddHealthAbil
integer AddHealthAbils
integer array AddArmorAbil
integer AddArmorAbils
integer array AddManaAbil
integer AddManaAbils
endglobals
library BonusMod requires ExtraFunctions
function AddDamage takes unit u,integer DamageToAdd returns nothing
local integer i = 0
loop
exitwhen i > AddDamageAbils
if GetUnitAbilityLevel(u,AddDamageAbil[i]) > 0 then
set DamageToAdd = DamageToAdd + IntPower(2,i)
call UnitRemoveAbility(u,AddDamageAbil[i])
endif
set i = i + 1
endloop
set i = AddDamageAbils
loop
exitwhen i < 0
if DamageToAdd >= IntPower(2,i) then
call UnitAddAbility(u,AddDamageAbil[i])
set DamageToAdd = DamageToAdd - IntPower(2,i)
endif
set i = i - 1
endloop
endfunction
function AddHealth takes unit u,integer HealthToAdd returns nothing
local integer i = 0
loop
exitwhen i > AddHealthAbils
if GetUnitAbilityLevel(u,AddHealthAbil[i]) > 0 then
set HealthToAdd = HealthToAdd + IntPower(2,i)
call UnitRemoveAbility(u,AddHealthAbil[i])
endif
set i = i + 1
endloop
set i = AddHealthAbils
loop
exitwhen i < 0
if HealthToAdd >= IntPower(2,i) then
call UnitAddAbility(u,AddHealthAbil[i])
set HealthToAdd = HealthToAdd - IntPower(2,i)
endif
set i = i - 1
endloop
endfunction
function AddArmor takes unit u,integer ArmorToAdd returns nothing
local integer i = 0
loop
exitwhen i > AddArmorAbils
if GetUnitAbilityLevel(u,AddArmorAbil[i]) > 0 then
set ArmorToAdd = ArmorToAdd + IntPower(2,i)
call UnitRemoveAbility(u,AddArmorAbil[i])
endif
set i = i + 1
endloop
set i = AddArmorAbils
loop
exitwhen i < 0
if ArmorToAdd >= IntPower(2,i) then
call UnitAddAbility(u,AddArmorAbil[i])
set ArmorToAdd = ArmorToAdd - IntPower(2,i)
endif
set i = i - 1
endloop
endfunction
function AddMana takes unit u,integer ManaToAdd returns nothing
local integer i = 0
loop
exitwhen i > AddManaAbils
if GetUnitAbilityLevel(u,AddManaAbil[i]) > 0 then
set ManaToAdd = ManaToAdd + IntPower(2,i)
call UnitRemoveAbility(u,AddManaAbil[i])
endif
set i = i + 1
endloop
set i = AddManaAbils
loop
exitwhen i < 0
if ManaToAdd >= IntPower(2,i) then
call UnitAddAbility(u,AddManaAbil[i])
set ManaToAdd = ManaToAdd - IntPower(2,i)
endif
set i = i - 1
endloop
endfunction
endlibrary
//===========================================================================
function InitTrig_BonusMod takes nothing returns nothing
//Damage
set AddDamageAbil[0] = 'A000' //+1
set AddDamageAbil[1] = 'A001' //+2
set AddDamageAbil[2] = 'A002' //+4
set AddDamageAbil[3] = 'A003' //+8
set AddDamageAbil[4] = 'A004' //+16
set AddDamageAbil[5] = 'A005' //+32
set AddDamageAbil[6] = 'A006' //+64
set AddDamageAbil[7] = 'A007' //+128
set AddDamageAbil[8] = 'A008' //+256
set AddDamageAbil[9] = 'A009' //+512
set AddDamageAbil[10] = 'A00A' //+1024
set AddDamageAbils = 10
//Health
set AddHealthAbil[0] = 'A00B' //+1
set AddHealthAbil[1] = 'A00C' //+2
set AddHealthAbil[2] = 'A00D' //+4
set AddHealthAbil[3] = 'A00E' //+8
set AddHealthAbil[4] = 'A00F' //+16
set AddHealthAbil[5] = 'A00G' //+32
set AddHealthAbil[6] = 'A00H' //+64
set AddHealthAbil[7] = 'A00I' //+128
set AddHealthAbil[8] = 'A00J' //+256
set AddHealthAbil[9] = 'A00K' //+512
set AddHealthAbil[10] = 'A00L' //+1024
set AddHealthAbil[11] = 'A00M' //+2048
set AddHealthAbil[12] = 'A00N' //+4096
set AddHealthAbil[13] = 'A00O' //+8192
set AddHealthAbils = 13
//Armor(whatever it does)
set AddArmorAbil[0] = 'A013' //+1
set AddArmorAbil[1] = 'A016' //+2
set AddArmorAbil[2] = 'A017' //+4
set AddArmorAbil[3] = 'A018' //+8
set AddArmorAbil[4] = 'A019' //+16
set AddArmorAbil[5] = 'A01A' //+32
set AddArmorAbil[6] = 'A01B' //+64
set AddArmorAbil[7] = 'A01C' //+128
set AddArmorAbil[8] = 'A01D' //+256
set AddArmorAbil[9] = 'A01E' //+512
set AddArmorAbil[10] = 'A01F' //+1024
set AddArmorAbils = 10
//Mana
set AddManaAbil[0] = 'A01G' //+1
set AddManaAbil[1] = 'A01H' //+2
set AddManaAbil[2] = 'A01I' //+4
set AddManaAbil[3] = 'A01J' //+8
set AddManaAbil[4] = 'A01K' //+16
set AddManaAbil[5] = 'A01L' //+32
set AddManaAbil[6] = 'A01M' //+64
set AddManaAbil[7] = 'A01N' //+128
set AddManaAbil[8] = 'A01O' //+256
set AddManaAbil[9] = 'A01P' //+512
set AddManaAbil[10] = 'A01Q' //+1024
set AddManaAbil[11] = 'A01R' //+2048
set AddManaAbil[12] = 'A01S' //+4096
set AddManaAbil[13] = 'A01T' //+8192
set AddManaAbils = 13
endfunction