- Joined
- Jul 3, 2011
- Messages
- 251
Hey guys, im new to JASS and i want to make an ability like Razor's plasma field in DotA, i just dont understand why this is moving so slow.
I know that it is leaking and that i have variables that im not using, i fix leaks after making the spell and i want to speed the spell up before making the rest.
JASS:
function Trig_JASS_Vers_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_JASS_Vers_Actions takes nothing returns nothing
local unit Triggering_Unit = GetTriggerUnit()
local integer Countdown = 80
local real Distance_Forward = 0
local real Distance_Back = 900
local location Position_Of_Warden = GetUnitLoc(GetTriggerUnit())
local location Dummies_Position
local unit array Dummies
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer(GetTriggerUnit()), Position_Of_Warden, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
set Dummies[GetForLoopIndexA()] = GetLastCreatedUnit()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
loop
exitwhen Distance_Forward == 900
set Position_Of_Warden = GetUnitLoc(Triggering_Unit)
set Distance_Forward = ( Distance_Forward + 25.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set Dummies_Position = PolarProjectionBJ(Position_Of_Warden, Distance_Forward, ( 36.00 * I2R(GetForLoopIndexA()) ))
call SetUnitPositionLoc( Dummies[GetForLoopIndexA()], Dummies_Position )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.03 )
endloop
endfunction
//===========================================================================
function InitTrig_JASS_Vers takes nothing returns nothing
set gg_trg_JASS_Vers = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_JASS_Vers, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_JASS_Vers, Condition( function Trig_JASS_Vers_Conditions ) )
call TriggerAddAction( gg_trg_JASS_Vers, function Trig_JASS_Vers_Actions )
endfunction
I know that it is leaking and that i have variables that im not using, i fix leaks after making the spell and i want to speed the spell up before making the rest.
Last edited: