Excuse me I made a mistake yesterday :
scope BLSpell
native UnitAlive takes unit id returns boolean
globals
private constant integer SPELL_ID = 'A000'
endglobals
private constant function Damage takes integer lvl returns real
return 0.
endfunction
private constant function Aoe takes integer lvl returns real
return 1000.
endfunction
private function UnitFilter takes unit targ, player source returns boolean
return UnitAlive(targ) and IsUnitEnemy(targ, source) and not IsUnitType(targ, UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitType(targ, UNIT_TYPE_STRUCTURE)
endfunction
private struct BL extends array
static group g
static method c takes nothing returns boolean
local unit u
local integer i
local unit v
local player p
local real x
local real y
local real r
if GetSpellAbilityId() == SPELL_ID then
set u = GetTriggerUnit()
set i = GetUnitAbilityLevel(u, SPELL_ID)
set p = GetOwningPlayer(u)
set x = GetUnitX(u)
set y = GetUnitY(u)
call GroupEnumUnitsInRange(g, GetSpellTargetX(), GetSpellTargetY(), Aoe(i), null)
loop
set v = FirstOfGroup(g)
exitwhen v==null
call GroupRemoveUnit(g, v)
set r = RAbsBJ(Atan2(GetUnitY(v)-y, GetUnitX(v)-x)*bj_RADTODEG - GetUnitFacing(v))
if UnitFilter(v,p) and r<=225. and r>=135 then
if GetLocalPlayer() == GetOwningPlayer(v) then
call CinematicFilterGenericBJ( 3.00, BLEND_MODE_BLEND, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100, 100, 100, 100, 0, 0, 0, 0 )
endif
endif
endloop
set u = null
set p = null
endif
return false
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t, Condition(function thistype.c))
set g = CreateGroup()
set t = null
endmethod
endstruct
endscope