Bascially, I can't seem to figure out how to catch an ability deactivation event
The current ability is mana shield. (Immolation would be a second example)
I can get the event when it is turned on by using EVENT_PLAYER_UNIT_SPELL_EFFECT
But I can't seem to get the reverse event.
This is the code, incase anyone has a suggestion to do it another way.
I've also tried a faster approach, but for the life of me can't seem to figure out what the hell blizzard means by "buff".
So I'm pretty much asking for some way to catch a deactivation event, or atleast figure out if my "buffcode" input is being used correctly.
The current ability is mana shield. (Immolation would be a second example)
I can get the event when it is turned on by using EVENT_PLAYER_UNIT_SPELL_EFFECT
But I can't seem to get the reverse event.
This is the code, incase anyone has a suggestion to do it another way.
JASS:
function HBC takes nothing returns boolean
return GetSpellAbilityId() == 'A012'
endfunction
function HBA takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local integer v = GetHeroLevel(u)
local integer h = 2*v //health counter
local integer m = 1*v //mana counter
loop
exitwhen GetUnitUserData(u) == 0
//Custom data set, a deactivation trigger catching the deactivation would set
// to another number
call TriggerSleepAction(1)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE)-h)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MANA)+m)
endloop
//First one subtracts health
//Second one adds mana
set u = null
endfunction
I've also tried a faster approach, but for the life of me can't seem to figure out what the hell blizzard means by "buff".
JASS:
function HBC takes nothing returns boolean
return GetSpellAbilityId() == 'A012'
endfunction
function HBA takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local integer v = GetHeroLevel(u)
local integer h = 2*v //health counter
local integer m = 1*v //mana counter
loop
exitwhen UnitHasBuffBJ(u, 'B007')
//'B007' Given to me by the world editor for my custom buff effect
//(GetUnitAbilityLevel(u, 'B007') > 0) which is essentially the Junction did not
//work either
call TriggerSleepAction(1)
call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u, UNIT_STATE_LIFE)-h)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MANA)+m)
endloop
//First one subtracts health
//Second one adds mana
set u = null
endfunction
So I'm pretty much asking for some way to catch a deactivation event, or atleast figure out if my "buffcode" input is being used correctly.