Hi, I was thinking of creating a Omnislash skill on my own after i read some tutorials. So I made all this by my self but it wont work -.-' He wont even "jump" to the enemies. Check this code and see whats wrong please ;o
JASS:
function OmniSlashCondition takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function OmniSlashAction takes nothing returns nothing
local unit h = GetSpellAbilityUnit()
local group eg = CreateGroup()
local unit temp
local location hloc = GetUnitLoc(h)
local location eloc
local integer times = 8
call DisplayTextToForce(GetPlayersAll(), "Test1")
call GroupEnumUnitsInRangeOfLoc(eg, hloc, 800.00, null)
loop
set temp = FirstOfGroup(eg)
exitwhen times == 0
if IsUnitEnemy(temp, GetOwningPlayer(h)) then
call DisplayTextToForce(GetPlayersAll(), "Test2")
set times = times - 1
set eloc = GetUnitLoc(e)
call SetUnitPositionLoc(h, eloc)
call IssueTargetOrder(h, "attack", e)
call PolledWait(0.5)
endif
endloop
call DisplayTextToForce(GetPlayersAll(), "Test3")
set h = null
set eg = null
set e = null
set hloc = null
set eloc = null
set times = 0
endfunction
function InitTrig_OmniSlash takes nothing returns nothing
local trigger T
set T = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(T, Condition(function OmniSlashCondition))
call TriggerAddAction(T, function OmniSlashAction)
endfunction