Okay, JassHelper wont compile this:
I am ofcourse using NewGen - so vJASS...
My error lies here:
- the error i get is Unexpected "takes"
EDIT: Added the full code.
JASS:
scope Omnislash initializer Init
globals
private constant integer omnislash = 039;A000039;
private constant real damage = 200.0
private constant integer slashes = 5
private constant real range = 600.0
endglobals
private function True takes nothing returns boolean
return true
endfunction
private function enemy takes nothing returns boolean
return IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit())) and GetWidgetLife(GetEnumUnit()) >= 0.407
private function SlashUnit takes unit u returns nothing
local unit o = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call SetUnitPosition(o, x, y)
call SetUnitAnimation(o, "attack")
call UnitDamageTarget(o, u, damage, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_DEATH, WEAPON_TYPE_CLAW_LIGHT_SLICE)
call TriggerSleepAction(0.1)
endfunction
private function Actions takes nothing returns nothing
local group g = CreateGroup()
local unit o = GetTriggerUnit()
local integer i = 0
if (GetSpellAbilityId() == omnislash) then
call PauseUnit(o, true)
call SlashUnit(GetSpellTargetUnit())
loop
exitwhen i >= slashes
call GroupEnumUnitsInRange(g, GetUnitX(o), GetUnitX(o), range, function enemy)
call PauseUnit(o, false)
endif
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local integer i = 0
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, Filter(function True))
set i = i + 1
endloop
call TriggerAddAction(t, function Actions)
endfunction
endscope
I am ofcourse using NewGen - so vJASS...
My error lies here:
- the error i get is Unexpected "takes"
EDIT: Added the full code.