NeJiIjEn
N
NeJiIjEn
Whats trigger for when a hero that is owned by the assaulters or sumtin walks on lava and hp goes down. I got the Unit Enters region and the Terrain type. But i dont know how to do the -100 hp
I didn't say that the JASS one will not lag (I guess it won't ). But triggers written in JASS are much more efficient than their pairs in GUI.Paskovich, can you show JASS solution and explain why it do not lag?
function IsUnitInLava takes nothing returns boolean
return GetTerrainType(GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit())) == 'Dlav'
endfunction
function DamageUnitInLava takes nothing returns nothing
call SetUnitState(GetEnumUnit(), UNIT_STATE_LIFE, GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE) - 100)
endfunction
function Trig_LavaDamage_Actions takes nothing returns nothing
local group g = CreateGroup()
call GroupEnumUnitsInRect(g, GetPlayableMapRect(), Filter(function IsUnitInLava))
call ForGroup(g, function DamageUnitInLava)
call DestroyGroup(g)
set g = null
endfunction
function InitTrig_LavaDamage takes nothing returns nothing
set gg_trg_LavaDamage = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_LavaDamage, 1, true)
call TriggerAddAction(gg_trg_LavaDamage, function Trig_LavaDamage_Actions)
endfunction
OR:
Event - Every 1 sec
Actions-
Pick all units in playable map matching (Terrain type at position of Picked unit is equal to Lava) and do Actions
-Damage picked unit
I know, i know it is leaky and may be laggy but not that long... Or i'll write you a leakless JASS trigger if you want.
why jass?
its easy in GUI too.
i post screenshots because the trigger tags arent working.
Tested and works fine!
should be leakless
Why do u use TempPoint variable? If your picked unit is from a group there should be more than 1 unit sometime...