killingdyl
Active Member
- Reaction score
- 6
Bare with me, i am very new to jass. I am making this trigger but i keep getting this error with an undeclared variable and i know i declared it.
Heres the code
Also if u find any leaks tell me please. Thanks
Heres the code
JASS:
function Trig_Elemental_Vortex_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A000039; ) ) then
return false
endif
return true
endfunction
function Trig_Elemental_Vortex_Func011Func001Func001Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(Dummy[(bj_forLoopAIndex)]) == 039;h002039; ) ) then
return false
endif
return true
endfunction
function Trig_Elemental_Vortex_Func011Func001Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false ) ) then
return false
endif
if ( not ( IsUnitAlly(GetEnumUnit(), GetOwningPlayer(GetTriggerUnit())) == false ) ) then
return false
endif
return true
endfunction
function Trig_Elemental_Vortex_Func011Func001A takes nothing returns nothing
if ( Trig_Elemental_Vortex_Func011Func001Func001C() ) then
if ( Trig_Elemental_Vortex_Func011Func001Func001Func002C() ) then
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD )
call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" )
else
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE )
call AddSpecialEffectLocBJ( GetUnitLoc(GetEnumUnit()), "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
endif
else
call DoNothing( )
endif
endfunction
function Trig_Elemental_Vortex_Actions takes nothing returns nothing
local unit caster = GetTriggerUnit()
local location casterLoc = GetUnitLoc(GetTriggerUnit())
local real Real = 0
local location array LocOffset
local unit array Dummy
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 039;h003039;, GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
set LocOffset[(bj_forLoopAIndex)] = PolarProjectionBJ(casterLoc, 700.00, Real)
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", LocOffset[bj_forLoopAIndex] )
call UnitApplyTimedLifeBJ( 3.50, 039;BTLF039;, GetLastCreatedUnit() )
set Dummy[(bj_forLoopAIndex)] = GetLastCreatedUnit()
set Real = (Real + (360/8))
set LocOffset[(bj_forLoopAIndex)] = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set Real = (360/16)
set bj_forLoopAIndex = 9
set bj_forLoopAIndexEnd = 16
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 039;h002039;, GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), bj_UNIT_FACING )
set LocOffset[(bj_forLoopAIndex)] = PolarProjectionBJ(casterLoc, 500.00, Real)
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", LocOffset[bj_forLoopAIndex] )
call UnitApplyTimedLifeBJ( 3.50, 039;BTLF039;, GetLastCreatedUnit() )
set Dummy[(bj_forLoopAIndex)] = GetLastCreatedUnit()
set Real = (Real + (360/8))
set LocOffset[(bj_forLoopAIndex)] = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 3.45 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 16
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call ForGroupBJ( GetUnitsInRangeOfLocAll(50.00, GetUnitLoc(Dummy[(bj_forLoopAIndex)])), function Trig_Elemental_Vortex_Func011Func001A )
set Dummy[(bj_forLoopAIndex)] = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set casterLoc = null
endfunction
//===========================================================================
function InitTrig_Elemental_Vortex takes nothing returns nothing
set gg_trg_Elemental_Vortex = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Elemental_Vortex, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Elemental_Vortex, Condition( function Trig_Elemental_Vortex_Conditions ) )
call TriggerAddAction( gg_trg_Elemental_Vortex, function Trig_Elemental_Vortex_Actions )
endfunction
Also if u find any leaks tell me please. Thanks