- Joined
- Jul 1, 2008
- Messages
- 1,314
hey guys, its me again
This time, i got an ability, that should be used by dummies created in a pick loop.
Its seems that either the ability itself or the trigger causes heavy lags...
I tested the ability, and it laged, as i used it without this trigger, but i never heard, that an ability can cause so much traffic.
Its based on shadow strike, and here is the trigger:
I dont know what to do....any suggestions? The ability added above, which i marked red, is the lag source
Thanks in advance
Greetings
This time, i got an ability, that should be used by dummies created in a pick loop.
Its seems that either the ability itself or the trigger causes heavy lags...
I tested the ability, and it laged, as i used it without this trigger, but i never heard, that an ability can cause so much traffic.
Its based on shadow strike, and here is the trigger:
JASS:
//Conditions for picking units
function Plants_Check takes nothing returns boolean
local unit U = GetFilterUnit()
if IsUnitType(U, UNIT_TYPE_MECHANICAL) == false then
set U = null
return false
endif
if GetUnitState(U, UNIT_STATE_LIFE) <= 0 then
set U = null
return false
endif
if GetUnitAbilityLevel(U, 'Avul') > 0 then
set U = null
return false
endif
set U = null
return true
endfunction
//Condition, if the start ability is the right one
function Trig_Duengen_Conditions takes nothing returns boolean
if GetSpellAbilityId() == 'A02V' then
return true
endif
return false
endfunction
function Trig_Duengen_Actions takes nothing returns nothing
local unit Picked
local group Plants = CreateGroup()
local location Center = GetSpellTargetLoc()
local integer Count = 10
local unit dummy
// Pick every Unit in Range 350, when Cond == true
call GroupEnumUnitsInRangeOfLoc( Plants, Center, 350.00, Condition(function Plants_Check))
// loop to manage the group
loop
set Picked = FirstOfGroup(Plants)
exitwhen Picked == null or Count == 0
set dummy = CreateUnitAtLoc(Player(0), 'hspt', Center, bj_UNIT_FACING )
[COLOR="Red"]call UnitAddAbility(dummy, 'A02U')[/COLOR]
call UnitApplyTimedLife(dummy, 'BTLF', 5.00)
call IssueTargetOrder( dummy, "shadowstrike", Picked)
//next Unit
call GroupRemoveUnit(Plants,Picked)
set dummy=null
endloop
//reset
set Picked = null
call RemoveLocation(Center)
set Center = null
call DestroyGroup(Plants)
set Plants = null
endfunction
//==== Init Trigger Duengen ===================================================
function InitTrig_Duengen takes nothing returns nothing
set gg_trg_Duengen = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Duengen,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_Duengen, Condition(function Trig_Duengen_Conditions))
call TriggerAddAction(gg_trg_Duengen, function Trig_Duengen_Actions)
endfunction
I dont know what to do....any suggestions? The ability added above, which i marked red, is the lag source
Thanks in advance
Greetings