- Joined
- Feb 11, 2011
- Messages
- 1,860
[SOLVED]Fan of Daggers Help
Hi guys,
I have yet another JASS question
In my map I have 9 customized heroes which all have abilities that are triggered. I want to "upgrade" to JASS to make things less buggy. One of the hero's abilities is the normal "Fan of Knives" except when it's cast it ensnares all enemies within 200 range. It worked fine with GUI but I am having trouble converting to JASS. Please take a look and see what I've done wrong:
Any help will be much appreciated!
Hi guys,
I have yet another JASS question
In my map I have 9 customized heroes which all have abilities that are triggered. I want to "upgrade" to JASS to make things less buggy. One of the hero's abilities is the normal "Fan of Knives" except when it's cast it ensnares all enemies within 200 range. It worked fine with GUI but I am having trouble converting to JASS. Please take a look and see what I've done wrong:
JASS:
function Condition_Fan_of_Daggers takes nothing returns boolean
return (GetOwningPlayer(GetFilterUnit()) == Player(11))
endfunction
function Fan_of_Daggers takes unit u returns nothing
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local group ug = CreateGroup()
local unit temp
call GroupEnumUnitsInRange(ug, x, y, 200.00, Condition(function Condition_Fan_of_Daggers))
loop
set temp = FirstOfGroup(ug)
exitwhen temp == null
if (IsUnitEnemy(temp, GetOwningPlayer(u))) then
set bj_lastCreatedUnit = CreateUnit(GetOwningPlayer(u), 'h003', x, y, bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit, 'A00B')
call SetUnitAbilityLevel(bj_lastCreatedUnit, 'A00B', GetUnitAbilityLevel(u, 'A01E'))
call IssueTargetOrder(bj_lastCreatedUnit, "ensnare", temp)
call UnitApplyTimedLife(bj_lastCreatedUnit, 'BTLF', 1)
endif
call GroupRemoveUnit(ug, temp)
endloop
set temp = null
call DestroyGroup(ug)
endfunction
Last edited: