V
Voodoo
Guest
My code:
The Ability :
Ice Explosion
summons numerous ice explosion to destroy enemies. Each explosion deals 100/200/300 damage, (Imagine a Chain Lightning, being cast several times, bouncing from one unit to another, the missle is deleted, only the frost nova effect is added)
My Problem :
When I cast the ability(everytime) I hang (sever lag)....after 2 sec, it come back to normal, but the events are forwarded. The damage takes place, ALL takes place. But I just hate what is that Lag every time i cast the spell
Note : I preloaded ALL units, and abilities.
Plss help
JASS:
function Trig_Ice_Explosion_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 039;A00S039;
endfunction
function Trig_Ice_Explosion_Actions takes nothing returns nothing
local unit icecaster
local unit icetarget
local location icecasterpoint
local location icetargetpoint
local group icegroup
set icecaster = GetTriggerUnit()
set icetargetpoint = GetSpellTargetLoc()
set icecasterpoint = GetUnitLoc(icecaster)
set icegroup = GetUnitsInRangeOfLocAll(( 100.00 + ( 200.00 * I2R(GetUnitAbilityLevelSwapped(039;A00S039;, icecaster)) ) ), icetargetpoint)
loop
exitwhen icegroup == null
set icetarget = FirstOfGroup(icegroup)
if IsUnitEnemy(icetarget, GetOwningPlayer(icecaster))==true then
call GroupRemoveUnit(icegroup,icetarget)
call CreateNUnitsAtLoc( 1, 039;h008039;, GetOwningPlayer(icecaster), icecasterpoint, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 039;BTLF039;, GetLastCreatedUnit() )
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 039;A00R039;, GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 039;A00R039;, GetLastCreatedUnit(), GetUnitAbilityLevelSwapped(039;A00S039;, icecaster) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "chainlightning", icetarget )
set icetarget = null
else
call GroupRemoveUnit(icegroup,icetarget)
set icetarget = null
endif
endloop
set icegroup = null
set icecaster = null
set icetargetpoint = null
set icecasterpoint = null
endfunction
//===========================================================================
function InitTrig_Ice_Explosion takes nothing returns nothing
set gg_trg_Ice_Explosion = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Explosion, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ice_Explosion, Condition( function Trig_Ice_Explosion_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Explosion, function Trig_Ice_Explosion_Actions )
endfunction
The Ability :
Ice Explosion
summons numerous ice explosion to destroy enemies. Each explosion deals 100/200/300 damage, (Imagine a Chain Lightning, being cast several times, bouncing from one unit to another, the missle is deleted, only the frost nova effect is added)
My Problem :
When I cast the ability(everytime) I hang (sever lag)....after 2 sec, it come back to normal, but the events are forwarded. The damage takes place, ALL takes place. But I just hate what is that Lag every time i cast the spell
Note : I preloaded ALL units, and abilities.
Plss help