This trigger here works perfectly when my hero kills a hero by normal attacks or basic spells. Just wondering, would this work properly when damage is dealt by TRIGGER and kills the target hero? Thanks
JASS:
scope Spell
globals
private constant integer SPELLID = 039;A00039;
endglobals
function Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetKillingUnit(),SPELLID)>0
endfunction
function Actions takes nothing returns nothing
local unit c = GetKillingUnit()
if IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO) then
call SetHeroStr(c,GetHeroStr(c,false)+2,true)
endif
set c=null
endfunction
function InitTrig_Spell takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function Conditions))
call TriggerAddAction(t,function Actions)
set t=null
endfunction
endscope