Generic title, generic plea of help. I'm getting two errors here. One error registers only in JassCraft as:
"Undeclared variable: gg_trg_SpellName"
pointing to the line:
"call TriggerRegisterAnyUnitEventBJ(...)"
The second error registers only in WE as:
"Expected a function name"
pointing to the line:
"call DamageUnitsInAOE(...)"
Here's the code. I have no clue why these errors are happening and why one registers only in JassCraft and the other registers only in the WE.
"Undeclared variable: gg_trg_SpellName"
pointing to the line:
"call TriggerRegisterAnyUnitEventBJ(...)"
The second error registers only in WE as:
"Expected a function name"
pointing to the line:
"call DamageUnitsInAOE(...)"
Here's the code. I have no clue why these errors are happening and why one registers only in JassCraft and the other registers only in the WE.
JASS:
function cond_SpellName takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction
function action_SpellName takes nothing returns nothing
local unit udg_Caster = GetTriggerUnit()
local real udg_CasterX = GetLocationX(GetUnitLoc(udg_Caster))
local real udg_CasterY = GetLocationY(GetUnitLoc(udg_Caster))
local location udg_TargetLocation = GetSpellTargetLoc()
local real udg_TargetX = GetLocationX(udg_TargetLocation)
local real udg_TargetY = GetLocationY(udg_TargetLocation)
local real udg_SpellRadius = 0.00
local effect udg_SpecialEffect1 = AddSpecialEffect("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",udg_TargetX,udg_TargetY)
local effect udg_SpecialEffect2 = AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",udg_TargetX,udg_TargetY)
local effect udg_SpecialEffect3 = AddSpecialEffect("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",udg_CasterX,udg_CasterY)
call DestroyEffectBJ(udg_SpecialEffect1)
call DestroyEffectBJ(udg_SpecialEffect2)
call DestroyEffectBJ(udg_SpecialEffect3)
if(GetUnitAbilityLevel(udg_Caster,'A003')<=2)then
set udg_SpellRadius = 200.00
else
if(GetUnitAbilityLevel(udg_Caster,'A003')<=4)then
set udg_SpellRadius = 300.00
else
set udg_SpellRadius = 400.00
endif
endif
call DamageUnitsInAOE(GetOwningPlayer(udg_Caster),(I2R((150+(GetUnitAbilityLevel(udg_Caster,'A003')*50)))),udg_TargetX,udg_TargetY,udg_SpellRadius,false)
set udg_Caster = null
call RemoveLocation(udg_TargetLocation)
endfunction
function InitTrig_SpellName takes nothing returns nothing
set gg_trg_SpellName = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_SpellName, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_SpellName,Condition(function cond_SpellName))
call TriggerAddAction(gg_trg_SpellName,function action_SpellName)
endfunction