this is what i got out of 3 days with jass
22 problems detected
JASS:
function trg_spell takes nothing returns boolean
return GetSpellAbilityId() == 'SPELL ID'
endfunction
function trg_spell_Condition takes nothing returns boolean
return IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false and IsUnitType(GetFilterUnit(), UNIT_TYPE_MECHANICAL) == false and IsPlayerEnemy(GetOwningPlayer(GetTriggerUnit()), GetWidgetLife(GetFilterUnit()) > 0.405
endfunction
function trg_spell_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local real y = GetUnitY(c)
local real x = GetUnitX(c)
local integer i = GetUnitAbilityLevel(c, 'SPELL ID')
local group g = CreateGroup()
local group g = GetUnitsInRangeOfLocAll(300*i(c()), Condition(function trg_spell_Condition)
local unit u
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl", x, y))
call GroupEnumUnitsInRangeOfLoc(g, c, 300*i)
loop
set u = FirstOfGroup(g)
exitwhen f == null
call UnitDamageTarget(c, u, 100*i, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null
call GroupRemoveUnit(n, F)
endloop
endfunction
//======================================================================
function Init_spell takes nothing returns nothing
set gg_trg_spell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_spell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_spell, Condition( function trg_spell_Condition ) )
call TriggerAddAction( gg_trg_spell, function trg_spell_Actions )
call Preload("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl")
endfunction
22 problems detected