Chances are you have the wrong object data
You need to be more descriptive when you ask for help, like, it doesn't compile, it doesn't cast, it doesn't damage the correct damage
Saying "it doesn't work, tell me why" is like saying "God, I need your help, I am retarded"
I really didn't look into it, but if it still doesn't work, post your map and I'll take a better look
EDIT - Looked at it again, there are a few things that might cause problems
Starting from the top, you probably don't know what boolexprs are, you should use them when you enumerate groups, I will not explain it to you, you need to look further into it
You created a location at the casters position, and never removed it
That will cause a leak
If there are any effects to be used with your newly enumerated group, the group was enum'ed by your caster, not the target of the spell, so loop through the group will only affect nearby units
I see you nested a loop to remove all allied units, this is normally used with boolexprs, but since you do not know what they are, you should instead put the enemies in a new group, and remove the old group
Then working with the new group, damage all of the enemies
I highly suggest not using nested loops when looping through groups, because it gets very very complicated
Here is how I would go about it...
JASS:
function NoLeak takes nothing returns boolean
return true
endfunction
//Don't worry about this function, it is a little bug with using 'null' for a
//boolexpr parameter
constant function Nova_RawCode takes nothing returns integer
return 'ACfn'
endfunction
function Trig_Frost_Nova_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit temptarget = GetSpellTargetUnit()
local unit u //An empty variable for looping
local player own = GetOwningPlayer(caster)
//It would be very inefficient to constantly get the owning player
//every time you looped
local integer level = GetUnitAbilityLeve(caster, Nova_RawCode())
local real range = 300.00 + level *100.00 //PEMDAS
local location temploc = GetUnitLoc(temptarget)
local group g = CreateGroup()
local group g2 = CreateGroup()
local integer unitlimit = 4 + level * 2
local real dmg = 50.00 //Unnecessary, but we will keep it
call GroupEnumUnitsInRangeOfLoc(g, temploc, range, Condition(function NoLeak))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g, u)
if IsUnitEnemy(u, own) then
call GroupAddUnit(g2, u)
endif
endloop
call DestroyGroup(g)
set g = null
//Enums the second group with only enemies
loop
set u = FirstOfGroup(g2)
exitwhen unitlimit == 0 or u == null
call GroupRemoveUnit(g2,u)
call UnitDamageTarget(caster, u, dmg, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
set unitlimit = unitlimit - 1
endloop
//Damages 'unitlimit' # of units in 2nd group
call GroupClear(g2)
call DestroyGroup(g2)
set g2 = null
call RemoveLocation(temploc)
set temploc = null
set caster = null
set temptarget = null
set u = null
endfunction
I really have no idea what you were trying to do, but here is a fix on what you had that should damage only enemy units in range of the target approx. 50 damage (units have armor, generally)
The WEAPON_TYPE_WHOKNOWS is a constant, I'm not sure what it does, but I believe it has some effect sound, it may be an incorrect name (WEAPON_TYPE_WHO_KNOWS may be the correct one) I don't remember exactly, but you can change it back to null if you need to
If the code looks really confusing to you, just go through it line-by-line, and it should make sense