require recent patch. I tested following code on 1.31.1
the idea is to dynamically modify ability field when some spell ordered, using BlzSetAbilityXXXLevelField functions. Don't know if someone posted it before.
edit: use
EVENT_PLAYER_UNIT_SPELL_* events instead of EVENT_PLAYER_UNIT_ISSUED_ORDER should also works
the idea is to dynamically modify ability field when some spell ordered, using BlzSetAbilityXXXLevelField functions. Don't know if someone posted it before.
Code:
private function ordered takes nothing returns boolean
local ability ab
if GetIssuedOrderId() == OrderId("fanofknives") then
call BJDebugMsg("ordered, level: " + I2S(GetUnitAbilityLevel(GetOrderedUnit(), 'AEfk')))
set ab = BlzGetUnitAbility(GetOrderedUnit(), 'AEfk')
call BlzSetAbilityRealLevelField(ab, ABILITY_RLF_DAMAGE_PER_TARGET_EFK1, GetUnitAbilityLevel(GetOrderedUnit(), 'AEfk') - 1, 100.0 * GetHeroAgi(GetOrderedUnit(), true))
endif
set ab = null
return false
endfunction
private function init takes nothing returns nothing
call RegisterAnyPlayerUnitEvent(EVENT_PLAYER_UNIT_ISSUED_ORDER, function ordered)
endfunction
edit: use
EVENT_PLAYER_UNIT_SPELL_* events instead of EVENT_PLAYER_UNIT_ISSUED_ORDER should also works
Last edited: