Like the title says, I want an ability like that, and all the other threads doesnt seem to help me that much.
I am using the land mine ability wherein it automatically dies when an enemy unit comes nearby.
Pretty much everything seems to be correct, but my trigger will not cast the ensnare ability, and believe me it doesnt have a manacost or an upgrade requirement.
Below is my trigger:
Here's a picture i thought it will show up like how it is in the trigger editor
I tried adding the text below to see if everything seems to be detected, and it does because it appears, but the purpose of the ability doesnt work
PS: I know it will leak in locations, and I'm going to fix that soon, so dont worry.
I am using the land mine ability wherein it automatically dies when an enemy unit comes nearby.
Pretty much everything seems to be correct, but my trigger will not cast the ensnare ability, and believe me it doesnt have a manacost or an upgrade requirement.
Below is my trigger:
Code:
function Trig_Entangling_Rock_Trap_Copy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'o035' ) ) then
return false
endif
return true
endfunction
function Trig_Entangling_Rock_Trap_Copy_Func001A takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A020', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "ensnare", GetEnumUnit() )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_3413" )
endfunction
function Trig_Entangling_Rock_Trap_Copy_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocAll(150.00, GetUnitLoc(GetTriggerUnit())), function Trig_Entangling_Rock_Trap_Copy_Func001A )
endfunction
//===========================================================================
function InitTrig_Entangling_Rock_Trap_Copy takes nothing returns nothing
set gg_trg_Entangling_Rock_Trap_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Entangling_Rock_Trap_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Entangling_Rock_Trap_Copy, Condition( function Trig_Entangling_Rock_Trap_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Entangling_Rock_Trap_Copy, function Trig_Entangling_Rock_Trap_Copy_Actions )
endfunction
Here's a picture i thought it will show up like how it is in the trigger editor
I tried adding the text below to see if everything seems to be detected, and it does because it appears, but the purpose of the ability doesnt work
PS: I know it will leak in locations, and I'm going to fix that soon, so dont worry.