- Joined
- Jun 16, 2008
- Messages
- 333
How do you make a trigger where if you enter a certain terrain your health decreases slowly?
I have this much so far in jass
I have this much so far in jass
JASS:
function Trig_Burn_Copy_Func002Func002Func005C takes nothing returns boolean
return false
endfunction
function Trig_Burn_Copy_Func002Func002C takes nothing returns boolean
if ( not ( IsUnitAliveBJ(GetEnumUnit()) == true ) ) then
return false
endif
if ( not Trig_Burn_Copy_Func002Func002Func005C() ) then
return false
endif
if ( not ( GetTerrainTypeBJ(udg_tempPoint) == 'Dlav' ) ) then
return false
endif
return true
endfunction
function Trig_Burn_Copy_Func002A takes nothing returns nothing
set udg_tempPoint = GetUnitLoc(GetEnumUnit())
if ( Trig_Burn_Copy_Func002Func002C() ) then
call UnitDamageTargetBJ( GetEnumUnit(), GetEnumUnit(), 20.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
call RemoveLocation(udg_tempPoint)
call DestroyGroup(udg_tempGroup)
endif
endfunction
function Trig_Burn_Copy_Actions takes nothing returns nothing
set udg_tempGroup = GetUnitsOfTypeIdAll('Edem')
call ForGroupBJ( udg_tempGroup, function Trig_Burn_Copy_Func002A )
endfunction
//===========================================================================
function InitTrig_Burn_Copy takes nothing returns nothing
set gg_trg_Burn_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Burn_Copy, 0.25 )
call TriggerAddAction( gg_trg_Burn_Copy, function Trig_Burn_Copy_Actions )
endfunction
- Terrain killer Events Time - Every 0.12 seconds of game time Conditions Actions Set tempGroup = (Units of type Paladin) Unit Group - Pick every unit in tempGroup and do (Actions) Loop - Actions Set tempPoint = (Position of (Picked unit)) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions ((Picked unit) is alive) Equal to True Or - Any (Conditions) are true Conditions (Terrain type at (Position of (Picked unit))) Equal to Ashenvale - dungeon lava Then - Actions Unit - IDK Else - Actions Custom script: call RemoveLocation(udg_tempPoint) Custom script: call DestroyGroup(udg_tempGroup)
Last edited by a moderator: