Hi guys. I made this triger (and similar trigers) for 7 my custom spells. Everything work fine, until i add couple of neutral hostile creeps. I understand why game lags. Trigers picking every unit in map (neutral hostile 300+ unit). I need fix this triger. Need only picking heros , or player units.
I try to fix with this, but no working.
Thanx for your answers.
Code:
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Set TempUnitGroup = (Units in (Playable map area))
Unit Group - Pick every unit in TempUnitGroup and do (If (((Picked unit) has buff Melody Aura ) Equal to True) then do (Unit - Add Spell Book 1 to (Picked unit)) else do (Unit - Remove Spell Book 1 from (Picked unit)))
Custom script: call DestroyGroup ( udg_TempUnitGroup )
I try to fix with this, but no working.
Code:
Actions
Set TempUnitGroup = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
Unit Group - Pick every unit in TempUnitGroup and do (If (((Picked unit) has buff Melody Aura ) Equal to True) then do (Unit - Add Spell Book 1 to (Picked unit)) else do (Unit - Remove Spell Book 1 from (Picked unit)))
Custom script: call DestroyGroup ( udg_TempUnitGroup )
Thanx for your answers.