- Joined
- Apr 16, 2011
- Messages
- 158
Hello
the intent of this code should be so that when my unit attack their attack to create a current that passes through enemy units.
I lose myself when I use a code for other codes as a reference :Z
I am very confused
A001 = skill that generates the buff
B000 = buff is used to check
n00Z = dummy
A002 = ability dummy
I feel that something is missing, maybe I need GetFilterUnit ()
me a light ...
the intent of this code should be so that when my unit attack their attack to create a current that passes through enemy units.
I lose myself when I use a code for other codes as a reference :Z
I am very confused
A001 = skill that generates the buff
B000 = buff is used to check
n00Z = dummy
A002 = ability dummy
JASS:
function Trig_Raw takes nothing returns nothing
endfunction
function Trig_unit_attacked takes nothing returns boolean
if (not(GetUnitAbilityLevel(GetTriggerUnit(), 'B000') > 0))then
return false
endif
return true
endfunction
function Trig_chainlightning takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit e = GetEnumUnit()
local unit d = CreateUnit(GetOwningPlayer(u),'n00Z',GetUnitX(e),GetUnitY(e),0)
call UnitAddAbility(d,'A002')
call SetUnitAbilityLevel(d,'A002',GetUnitAbilityLevel(u,'A001')+4)
call IssueTargetOrder(d,"chainlightning",e)
call UnitApplyTimedLife(d,'BTLF',3)
set e = null
set d = null
endfunction
function InitTrig_Statick_fild takes nothing returns nothing
set gg_trg_Statick_fild = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Statick_fild, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Statick_fild, Condition( function Trig_unit_attacked ) )
call TriggerAddAction( gg_trg_Statick_fild, function Trig_Raw )
endfunction
I feel that something is missing, maybe I need GetFilterUnit ()
me a light ...