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
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
EnterLava

Events


Unit - A unit enters Burn <gen>

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




GroupIndex Equal to 20



Then - Actions




Set GroupIndex = 0




Set LavaGroup[GroupIndex] = (Triggering unit)



Else - Actions




Set LavaGroup[GroupIndex] = (Triggering unit)




Set GroupIndex = (GroupIndex + 1)


Trigger - Turn on BurnBaby <gen>
BurnBaby

Events


Time - Every 1.00 seconds of game time

Conditions

Actions


For each (Integer A) from 1 to LoopNumber, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






LavaGroup[LavaIndex] Equal to No unit





Then - Actions






Set LavaIndex = (LavaIndex + 1)





Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(Burn <gen> contains LavaGroup[LavaIndex]) Equal to True







Then - Actions








Unit - Set life of LavaGroup[LavaIndex] to ((Life of LavaGroup[LavaIndex]) - 16.00)








Set LavaIndex = (LavaIndex + 1)







Else - Actions








Set LavaIndex = (LavaIndex + 1)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Number of units in (Units in Burn <gen>)) Equal to 0



Then - Actions




Trigger - Turn off (This trigger)




Set LavaIndex = 0




For each (Integer A) from 1 to LoopNumber, do (Actions)





Loop - Actions






Set LavaGroup[LavaIndex] = No unit






Set LavaIndex = (LavaIndex + 1)



Else - Actions




Do nothing


Set LavaIndex = 0
I didn't say that the JASS one will not lag (I guess it won'tPaskovich, 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...
