- Joined
- Nov 3, 2013
- Messages
- 989
For some reason I keep getting an error with this function below, specifically Syntax Error, unexpected: "takes" on this line
Here's the whole trigger:
function Demonic_Flames_Targets_Filter takes nothing returns boolean
JASS:
function Demonic_Flames_Targets_Filter takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u, GetTriggerPlayer()) == true and IsUnitType(u, UNIT_TYPE_GROUND) == true and IsUnitType(u UNIT_TYPE_STRUCTURE == false then
return true
endif
return false
endfunction
Here's the whole trigger:
JASS:
globals
real dem_fla_dmgInc = 50 //per level increase of base damage
real dem_fla_dmgBase = (100 - dem_fla_dmgInc) //base damage
real dem_fla_dmgMulti_inc = 0.2 //how much attributes increase the damage by (per level)
real dem_fla_dmgMulti_base = (1 - dem_fla_dmgMulti_inc) //how much attributes increase the damage by (base)
real dem_fla_range_radius_inc = 15 //how big the AoE increase per level is
real dem_fla_range_radius_base = (325 - dem_fla_range_radius_inc) //how big the base AOE is
endglobals
function Trig_Demonic_Flames_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'A043' then
return true
endif
return false
endfunction
function Demonic_Flames_Damage takes real dmgAmount returns nothing
local unit u = GetEnumUnit()
//call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), ( ( 125.00 * I2R(GetUnitAbilityLevelSwapped('A043', GetTriggerUnit())) ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true)) * ( I2R(GetUnitAbilityLevelSwapped('A043', GetTriggerUnit())) * 0.75 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call UnitDamageTarget(sourceUnit, u, dmgAmount, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\Weapons\FireBallMissile\FireBallMissile.mdl", u, "chest"))
endfuction
function Demonic_Flames_Targets_Filter takes nothing returns boolean
local unit u = GetFilterUnit()
if IsUnitEnemy(u, GetTriggerPlayer()) == true and IsUnitType(u, UNIT_TYPE_GROUND) == true and IsUnitType(u UNIT_TYPE_STRUCTURE == false then
return true
endif
return false
endfunction
function Demonic_Flames_TimerEnd takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer timerId = GetHandleId(t)
local unit sourceUnit = LoadUnitHandle(udg_Hashtable, timerId, 0)
local real x = GetUnitX(sourceUnit)
local real y = GetUnitY(sourceUnit)
local integer abilLevel = GetUnitAbilityLevel(sourceUnit, 'A043')
local real abilLevel_real = I2R(abilLevel)
local real dmgAoE = dem_fla_range_radius_base + dem_fla_range_radius_inc * abilLevel_real
local real dmgHeroStat = I2R(GetHeroInt(sourceUnit, true)) * (dem_fla_dmgMulti_base + dem_fla_dmgMulti_inc * abilLevel_real)
local real dmgAmount = dem_fla_dmgBase + dem_fla_dmgBase * abilLevel_real + dmgHeroStat
local group dmgTargets = CreateGroup()
call DestroyEffect(AddSpecialEffect("Abilities\Spells\Other\Doom\DoomDeath.mdl", x, y))
call GroupEnumUnitsInRange(dmgTargets, x, y,dmgAoE , Condition(function Demonic_Flames_Targets_Filter))
call ForGroup(dmgTargets, function Demonic_Flames_Damage(dmgAmount))
call DestroyGroup(dmgTargets)
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(udg_Hashtable, timerId)
endfunction
function Trig_Demonic_Flames_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetTriggerUnit()
call SaveUnitHandle(udg_Hashtable, GetHandleId(t), 0, u)
call TimerStart(t, 2, false, function Demonic_Flames_TimerEnd)
endfunction
//===========================================================================
function InitTrig_Demonic_Flames takes nothing returns nothing
set gg_trg_Demonic_Flames = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Demonic_Flames, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Demonic_Flames, Condition( function Trig_Demonic_Flames_Conditions ) )
call TriggerAddAction( gg_trg_Demonic_Flames, function Trig_Demonic_Flames_Actions )
endfunction