When I do something like this
Doesn't work because the function GetTriggeringTrigger works only in those functions wich were executed by the trigger (with TriggerAddAction). But, in the filter that function doesn't work. What function can I use to get the handle ID of the trigger in the filter function??
thanks and sorry for my english
JASS:
static method onExit takes nothing returns boolean
local trigger trr=GetTriggeringTrigger()
local thistype this=GetTriggerData(trr)
local unit l=GetFilterUnit()
local unit d
if IsUnitEnemy(l,.p) and GetWidgetLife(l)>.405 and not IsUnitType(l,UNIT_TYPE_STRUCTURE) then
set d=CreateUnit(.p,039;h000039;,GetUnitX(l),GetUnitY(l),0.)
call UnitAddAbility(d,039;A004039;)
call UnitApplyTimedLife(d,039;BTLF039;,.lvl)
call SetUnitAbilityLevel(d,039;A004039;,R2I(.lvl))
call IssueTargetOrder(d,"drunkenhaze",l)
set d=null
set l=null
return false
else
set l=null
return false
endif
endmethod
static method create takes nothing returns thistype
local thistype this=.allocate()
set .reg=CreateRegion()
set .tr=CreateTrigger()
set .p=GetOwningPlayer(.c)
set .sX=GetSpellTargetX()
set .sY=GetSpellTargetY()
set .lvl=GetUnitAbilityLevel(GetTriggerUnit(),039;A003039;)
set .rad=325+25*.lvl
set .r=Rect(.sX-.rad,.sY-.rad,.sX+.rad,.sY+.rad)
call RegionAddRect(.reg,.r)
call SetTriggerData(.tr,this)
call TriggerRegisterLeaveRegion(.tr,.reg,Filter(function thistype.onExit))
return this
endmethod
Doesn't work because the function GetTriggeringTrigger works only in those functions wich were executed by the trigger (with TriggerAddAction). But, in the filter that function doesn't work. What function can I use to get the handle ID of the trigger in the filter function??
thanks and sorry for my english