I scratch my head and i spent 3 hours trying to find out wuts wrong
Can someone tell me wuts wrong with this?
function Trig_Nova_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Nova_Actions takes nothing returns nothing
call PolledWait( 0.50 )
// The Angel swings his sword just after 1.5 seconds
set udg_UnitVar = GetTriggerUnit()
// Save the casting unit to use it later and easily in JASS function calls
set udg_PointVar = GetUnitLoc(GetTriggerUnit())
// Save PointVar to use it later in a function call and to remove it
call CasterSetCastSourceLoc(udg_PointVar)
// Will set the caster spawn position at the position of PointVar, this will only work for the functions in this process before a wait
call CasterSetRecycleDelay(5)
// The damage from shockwave is not instant, let's say the damage will be of 5 seconds
// Determine the Recicling delay to 5 seconds for next called caster system functions
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 36
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
// Shockwave at all the directions around the casting unit :
set udg_PointVar2 = PolarProjectionBJ(udg_PointVar, 50.00, ( I2R(GetForLoopIndexA()) * 10.00 ))
// We can use PointVar since we know it is at the position of the Unit
// -------------------------------- Calling the function: ---------------------------------
// function CasterCastAbilityPointLoc takes player owner, integer abilid, string order, location loc, boolean instant returns unit
// To call it use:
call CasterCastAbilityPointLoc( GetOwningPlayer(udg_UnitVar), 'A018' , "shockwave", udg_PointVar2, false)
// Uses The owner of the UnitVar unit
// The rawcode of the ability in this map is 'A018'
// The orderstring is "shockwave"
// Use PointVar2 as target point
// this is not instant and it will also take some time to do all its damage, last argument is false
// (remember that CasterSetCastSourceLoc and CasterSetRecycleDelay are making effect)
call RemoveLocation( udg_ )
// Remove PointVar2 so it doesn't leak
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_)
// Remove PointVar so it doesn't leak
endfunction
//===========================================================================
function InitTrig_Nova takes nothing returns nothing
set gg_trg_Nova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nova, Condition( function Trig_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Nova, function Trig_Nova_Actions )
endfunction
Can someone tell me wuts wrong with this?
function Trig_Nova_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Nova_Actions takes nothing returns nothing
call PolledWait( 0.50 )
// The Angel swings his sword just after 1.5 seconds
set udg_UnitVar = GetTriggerUnit()
// Save the casting unit to use it later and easily in JASS function calls
set udg_PointVar = GetUnitLoc(GetTriggerUnit())
// Save PointVar to use it later in a function call and to remove it
call CasterSetCastSourceLoc(udg_PointVar)
// Will set the caster spawn position at the position of PointVar, this will only work for the functions in this process before a wait
call CasterSetRecycleDelay(5)
// The damage from shockwave is not instant, let's say the damage will be of 5 seconds
// Determine the Recicling delay to 5 seconds for next called caster system functions
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 36
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
// Shockwave at all the directions around the casting unit :
set udg_PointVar2 = PolarProjectionBJ(udg_PointVar, 50.00, ( I2R(GetForLoopIndexA()) * 10.00 ))
// We can use PointVar since we know it is at the position of the Unit
// -------------------------------- Calling the function: ---------------------------------
// function CasterCastAbilityPointLoc takes player owner, integer abilid, string order, location loc, boolean instant returns unit
// To call it use:
call CasterCastAbilityPointLoc( GetOwningPlayer(udg_UnitVar), 'A018' , "shockwave", udg_PointVar2, false)
// Uses The owner of the UnitVar unit
// The rawcode of the ability in this map is 'A018'
// The orderstring is "shockwave"
// Use PointVar2 as target point
// this is not instant and it will also take some time to do all its damage, last argument is false
// (remember that CasterSetCastSourceLoc and CasterSetRecycleDelay are making effect)
call RemoveLocation( udg_ )
// Remove PointVar2 so it doesn't leak
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call RemoveLocation(udg_)
// Remove PointVar so it doesn't leak
endfunction
//===========================================================================
function InitTrig_Nova takes nothing returns nothing
set gg_trg_Nova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nova, Condition( function Trig_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Nova, function Trig_Nova_Actions )
endfunction