- Joined
- Sep 24, 2004
- Messages
- 49
JASS:
scope pZONE initializer init
globals
private constant rect PORTALA = gg_rct_ENTRY_ZONE
private constant rect PORTALB = gg_rct_EXIT_ZONE
endglobals
private function Conditions takes nothing returns boolean
return true
//return GetPlayerController(GetOwningPlayer(GetEnteringUnit())) == MAP_CONTROL_USER
endfunction
private function ActionsA takes nothing returns nothing
local location l = Location(GetRectCenterX(PORTALB), GetRectCenterY(PORTALB))
call SetUnitPositionLoc(GetEnteringUnit(), l)
call RemoveLocation(l)
endfunction
private function ActionsB takes nothing returns nothing
local location l = Location(GetRectCenterX(PORTALA), GetRectCenterY(PORTALA))
call SetUnitPositionLoc(GetEnteringUnit(), l)
call RemoveLocation(l)
endfunction
//===========================================================================
private function init takes nothing returns nothing
local trigger tA = CreateTrigger( )
local trigger tB = CreateTrigger( )
local region rectRegionA = CreateRegion()
local region rectRegionB = CreateRegion()
call RegionAddRect(rectRegionA, PORTALA)
call TriggerRegisterEnterRegion(tA, rectRegionA, null)
call TriggerAddCondition( tA, Condition( function Conditions ) )
call TriggerAddAction( tA, function ActionsA)
//call RemoveRegion(rectRegionA)
call RegionAddRect(rectRegionB, PORTALB)
call TriggerRegisterEnterRegion(tB, rectRegionB, null)
call TriggerAddCondition( tB, Condition( function Conditions ) )
call TriggerAddAction( tB, function ActionsB)
//call RemoveRegion(rectRegionB)
set tA = null
set tB = null
endfunction
endscope